"#include <thrift/protocol/TProtocol.h>" << endl <<
"#include <thrift/transport/TTransport.h>" << endl <<
endl;
+ // Include C++xx compatibility header
+ f_types_ << "#include <thrift/cxxfunctional.h>" << endl;
// Include other Thrift includes
const vector<t_program*>& includes = program_->get_includes();
if (!(*f_iter)->is_oneway()) {
out <<
indent() << _this << "channel_->sendAndRecvMessage(" <<
- "std::tr1::bind(cob, this), " << _this << "otrans_.get(), " <<
+ "tcxx::bind(cob, this), " << _this << "otrans_.get(), " <<
_this << "itrans_.get());" << endl;
} else {
out <<
indent() << _this << "channel_->sendMessage(" <<
- "std::tr1::bind(cob, this), " << _this << "otrans_.get());" << endl;
+ "tcxx::bind(cob, this), " << _this << "otrans_.get());" << endl;
}
}
scope_down(out);
class_name_ = service_name_ + pstyle_ + "Processor";
if_name_ = service_name_ + "CobSvIf";
- finish_cob_ = "std::tr1::function<void(bool ok)> cob, ";
- finish_cob_decl_ = "std::tr1::function<void(bool ok)>, ";
+ finish_cob_ = "tcxx::function<void(bool ok)> cob, ";
+ finish_cob_decl_ = "tcxx::function<void(bool ok)>, ";
cob_arg_ = "cob, ";
ret_type_ = "void ";
} else {
: ", const " + type_name((*f_iter)->get_returntype()) + "& _return");
f_header_ <<
indent() << "void return_" << (*f_iter)->get_name() <<
- "(std::tr1::function<void(bool ok)> cob, int32_t seqid, " <<
+ "(tcxx::function<void(bool ok)> cob, int32_t seqid, " <<
"::apache::thrift::protocol::TProtocol* oprot, " <<
"void* ctx" << ret_arg << ");" << endl;
if (generator_->gen_templates_) {
f_header_ <<
indent() << "void return_" << (*f_iter)->get_name() <<
- "(std::tr1::function<void(bool ok)> cob, int32_t seqid, " <<
+ "(tcxx::function<void(bool ok)> cob, int32_t seqid, " <<
"Protocol_* oprot, void* ctx" << ret_arg << ");" << endl;
}
// XXX Don't declare throw if it doesn't exist
f_header_ <<
indent() << "void throw_" << (*f_iter)->get_name() <<
- "(std::tr1::function<void(bool ok)> cob, int32_t seqid, " <<
+ "(tcxx::function<void(bool ok)> cob, int32_t seqid, " <<
"::apache::thrift::protocol::TProtocol* oprot, void* ctx, " <<
"::apache::thrift::TDelayedException* _throw);" << endl;
if (generator_->gen_templates_) {
f_header_ <<
indent() << "void throw_" << (*f_iter)->get_name() <<
- "(std::tr1::function<void(bool ok)> cob, int32_t seqid, " <<
+ "(tcxx::function<void(bool ok)> cob, int32_t seqid, " <<
"Protocol_* oprot, void* ctx, " <<
"::apache::thrift::TDelayedException* _throw);" << endl;
}
out <<
"void " << tservice->get_name() << "AsyncProcessor" << class_suffix <<
"::process_" << tfunction->get_name() <<
- "(std::tr1::function<void(bool ok)> cob, int32_t seqid, " <<
+ "(tcxx::function<void(bool ok)> cob, int32_t seqid, " <<
prot_type << "* iprot, " << prot_type << "* oprot)" << endl;
scope_up(out);
// TODO(dreiss): Call the cob immediately?
out <<
indent() << "iface_->" << tfunction->get_name() << "(" <<
- "std::tr1::bind(cob, true)" << endl;
+ "tcxx::bind(cob, true)" << endl;
indent_up(); indent_up();
} else {
string ret_arg, ret_placeholder;
if (!tfunction->get_returntype()->is_void()) {
ret_arg = ", const " + type_name(tfunction->get_returntype()) +
"& _return";
- ret_placeholder = ", std::tr1::placeholders::_1";
+ ret_placeholder = ", tcxx::placeholders::_1";
}
// When gen_templates_ is true, the return_ and throw_ functions are
// can resolve the correct overloaded version.
out <<
indent() << "void (" << tservice->get_name() << "AsyncProcessor" <<
- class_suffix << "::*return_fn)(std::tr1::function<void(bool ok)> " <<
+ class_suffix << "::*return_fn)(tcxx::function<void(bool ok)> " <<
"cob, int32_t seqid, " << prot_type << "* oprot, void* ctx" <<
ret_arg << ") =" << endl;
out <<
if (!xceptions.empty()) {
out <<
indent() << "void (" << tservice->get_name() << "AsyncProcessor" <<
- class_suffix << "::*throw_fn)(std::tr1::function<void(bool ok)> " <<
+ class_suffix << "::*throw_fn)(tcxx::function<void(bool ok)> " <<
"cob, int32_t seqid, " << prot_type << "* oprot, void* ctx, " <<
"::apache::thrift::TDelayedException* _throw) =" << endl;
out <<
indent() << "iface_->" << tfunction->get_name() << "(" << endl;
indent_up(); indent_up();
out <<
- indent() << "std::tr1::bind(return_fn, this, cob, seqid, oprot, ctx" <<
+ indent() << "tcxx::bind(return_fn, this, cob, seqid, oprot, ctx" <<
ret_placeholder << ")";
if (!xceptions.empty()) {
out
<< ',' << endl <<
- indent() << "std::tr1::bind(throw_fn, this, cob, seqid, oprot, " <<
- "ctx, std::tr1::placeholders::_1)";
+ indent() << "tcxx::bind(throw_fn, this, cob, seqid, oprot, " <<
+ "ctx, tcxx::placeholders::_1)";
}
}
out <<
"void " << tservice->get_name() << "AsyncProcessor" << class_suffix <<
"::return_" << tfunction->get_name() <<
- "(std::tr1::function<void(bool ok)> cob, int32_t seqid, " <<
+ "(tcxx::function<void(bool ok)> cob, int32_t seqid, " <<
prot_type << "* oprot, void* ctx" << ret_arg_decl << ')' << endl;
scope_up(out);
out <<
"void " << tservice->get_name() << "AsyncProcessor" << class_suffix <<
"::throw_" << tfunction->get_name() <<
- "(std::tr1::function<void(bool ok)> cob, int32_t seqid, " <<
+ "(tcxx::function<void(bool ok)> cob, int32_t seqid, " <<
prot_type << "* oprot, void* ctx, " <<
"::apache::thrift::TDelayedException* _throw)" << endl;
scope_up(out);
? "()"
: ("(" + type_name(ttype) + " const& _return)"));
if (has_xceptions) {
- exn_cob = ", std::tr1::function<void(::apache::thrift::TDelayedException* _throw)> /* exn_cob */";
+ exn_cob = ", tcxx::function<void(::apache::thrift::TDelayedException* _throw)> /* exn_cob */";
}
} else {
throw "UNKNOWN STYLE";
return
"void " + prefix + tfunction->get_name() +
- "(std::tr1::function<void" + cob_type + "> cob" + exn_cob +
+ "(tcxx::function<void" + cob_type + "> cob" + exn_cob +
argument_list(arglist, name_params, true) + ")";
} else {
throw "UNKNOWN STYLE";