#include <dds_generator.h>
Collaboration diagram for Function:
Public Member Functions | |
Function (const char *name, const char *returntype) | |
void | addArg (const char *name, const std::string &type) |
void | endArgs () |
~Function () | |
Public Attributes | |
bool | has_arg_ |
std::string | preamble_ |
Definition at line 178 of file dds_generator.h.
Function::Function | ( | const char * | name, | |
const char * | returntype | |||
) | [inline] |
Definition at line 182 of file dds_generator.h.
References be_global, BE_GlobalData::export_macro(), exporter(), BE_GlobalData::header_, and BE_GlobalData::impl_.
00183 : has_arg_(false) 00184 { 00185 using std::string; 00186 ACE_CString ace_exporter = be_global->export_macro(); 00187 bool use_exp = ace_exporter != ""; 00188 string exporter = use_exp ? (string(" ") + ace_exporter.c_str()) : ""; 00189 be_global->header_ << ace_exporter << (use_exp ? "\n" : "") 00190 << returntype << " " << name << "("; 00191 be_global->impl_ << returntype << " " << name << "("; 00192 }
Function::~Function | ( | ) | [inline] |
void Function::addArg | ( | const char * | name, | |
const std::string & | type | |||
) | [inline] |
Definition at line 194 of file dds_generator.h.
References be_global, has_arg_, BE_GlobalData::header_, BE_GlobalData::impl_, and preamble_.
Referenced by gen_array(), marshal_generator::gen_enum(), gen_sequence(), v8_generator::gen_struct(), metaclass_generator::gen_struct(), marshal_generator::gen_struct(), keys_generator::gen_struct(), v8_generator::gen_typedef(), metaclass_generator::gen_typedef(), metaclass_generator::gen_union(), marshal_generator::gen_union(), genRtpsParameter(), genRtpsSpecialSequence(), genRtpsSpecialStruct(), and genRtpsSubmessage().
00195 { 00196 std::string sig = (has_arg_ ? ", " : "") + type + (name[0] ? " " : "") 00197 + (name[0] ? name : ""); 00198 be_global->header_ << sig; 00199 be_global->impl_ << sig; 00200 if (name[0]) { 00201 preamble_ += " ACE_UNUSED_ARG(" + std::string(name) + ");\n"; 00202 } 00203 has_arg_ = true; 00204 }
void Function::endArgs | ( | ) | [inline] |
Definition at line 206 of file dds_generator.h.
References be_global, BE_GlobalData::header_, BE_GlobalData::impl_, and preamble_.
Referenced by gen_array(), marshal_generator::gen_enum(), gen_sequence(), v8_generator::gen_struct(), metaclass_generator::gen_struct(), marshal_generator::gen_struct(), keys_generator::gen_struct(), v8_generator::gen_typedef(), metaclass_generator::gen_typedef(), metaclass_generator::gen_union(), marshal_generator::gen_union(), genRtpsParameter(), genRtpsSpecialSequence(), genRtpsSpecialStruct(), and genRtpsSubmessage().
00207 { 00208 be_global->header_ << ");\n\n"; 00209 be_global->impl_ << ")\n{\n" << preamble_; 00210 }
bool Function::has_arg_ |
std::string Function::preamble_ |