Functions | |
void | generate (UTL_ScopedName *name) |
void face_ts_generator::generate | ( | UTL_ScopedName * | name | ) |
Definition at line 236 of file ts_generator.cpp.
References BE_GlobalData::add_include(), be_global, BE_GlobalData::export_macro(), exporter(), BE_GlobalData::facets_header_, BE_GlobalData::facets_impl_, scoped(), dds_generator::scoped_helper(), and BE_GlobalData::STREAM_FACETS_H.
Referenced by ts_generator::gen_struct().
00236 { 00237 const std::string name_cxx = scoped(name), 00238 name_underscores = dds_generator::scoped_helper(name, "_"), 00239 exportMacro = be_global->export_macro().c_str(), 00240 exporter = exportMacro.empty() ? "" : (" " + exportMacro + '\n'); 00241 be_global->add_include("FACE/TS.hpp", BE_GlobalData::STREAM_FACETS_H); 00242 be_global->facets_header_ << 00243 "namespace FACE\n" 00244 "{\n" 00245 " namespace Read_Callback\n" 00246 " {\n" 00247 " typedef void (*send_event_" << name_underscores << "_Ptr) (\n" 00248 " /* in */ TRANSACTION_ID_TYPE transaction_id,\n" 00249 " /* inout */ " << name_cxx << "& message,\n" 00250 " /* in */ MESSAGE_TYPE_GUID message_type_id,\n" 00251 " /* in */ MESSAGE_SIZE_TYPE message_size,\n" 00252 " /* in */ const WAITSET_TYPE waitset,\n" 00253 " /* out */ RETURN_CODE_TYPE& return_code);\n" 00254 " }\n\n" 00255 " namespace TS\n" 00256 " {\n" << exporter << 00257 " void Receive_Message(\n" 00258 " /* in */ CONNECTION_ID_TYPE connection_id,\n" 00259 " /* in */ TIMEOUT_TYPE timeout,\n" 00260 " /* inout */ TRANSACTION_ID_TYPE& transaction_id,\n" 00261 " /* out */ " << name_cxx << "& message,\n" 00262 " /* in */ MESSAGE_SIZE_TYPE message_size,\n" 00263 " /* out */ RETURN_CODE_TYPE& return_code);\n\n" << exporter << 00264 " void Send_Message(\n" 00265 " /* in */ CONNECTION_ID_TYPE connection_id,\n" 00266 " /* in */ TIMEOUT_TYPE timeout,\n" 00267 " /* inout */ TRANSACTION_ID_TYPE& transaction_id,\n" 00268 " /* inout */ " << name_cxx << "& message,\n" 00269 " /* inout */ MESSAGE_SIZE_TYPE& message_size,\n" 00270 " /* out */ RETURN_CODE_TYPE& return_code);\n\n" << exporter << 00271 " void Register_Callback(\n" 00272 " /* in */ CONNECTION_ID_TYPE connection_id,\n" 00273 " /* in */ const WAITSET_TYPE waitset,\n" 00274 " /* in */ Read_Callback::send_event_" << name_underscores 00275 << "_Ptr data_callback,\n" 00276 " /* in */ MESSAGE_SIZE_TYPE max_message_size,\n" 00277 " /* out */ RETURN_CODE_TYPE& return_code);\n\n" 00278 " }\n" 00279 "}\n\n"; 00280 be_global->facets_impl_ << 00281 "void Receive_Message(CONNECTION_ID_TYPE connection_id,\n" 00282 " TIMEOUT_TYPE timeout,\n" 00283 " TRANSACTION_ID_TYPE& transaction_id,\n" 00284 " " << name_cxx << "& message,\n" 00285 " MESSAGE_SIZE_TYPE message_size,\n" 00286 " RETURN_CODE_TYPE& return_code) {\n" 00287 " OpenDDS::FaceTSS::receive_message(connection_id, timeout,\n" 00288 " transaction_id, message,\n" 00289 " message_size, return_code);\n" 00290 "}\n\n" 00291 "void Send_Message(CONNECTION_ID_TYPE connection_id,\n" 00292 " TIMEOUT_TYPE timeout,\n" 00293 " TRANSACTION_ID_TYPE& transaction_id,\n" 00294 " " << name_cxx << "& message,\n" 00295 " MESSAGE_SIZE_TYPE& message_size,\n" 00296 " RETURN_CODE_TYPE& return_code) {\n" 00297 " OpenDDS::FaceTSS::send_message(connection_id, timeout,\n" 00298 " transaction_id, message,\n" 00299 " message_size, return_code);\n" 00300 "}\n\n" 00301 "void Register_Callback(CONNECTION_ID_TYPE connection_id,\n" 00302 " const WAITSET_TYPE waitset,\n" 00303 " Read_Callback::send_event_" << name_underscores 00304 << "_Ptr data_callback,\n" 00305 " MESSAGE_SIZE_TYPE max_message_size,\n" 00306 " RETURN_CODE_TYPE& return_code) {\n" 00307 " OpenDDS::FaceTSS::register_callback(connection_id, waitset,\n" 00308 " data_callback,\n" 00309 " max_message_size, return_code);\n" 00310 "}\n\n" 00311 "struct " << name_underscores << "_Initializer {\n" 00312 " " << name_underscores << "_Initializer()\n" 00313 " {\n" 00314 " " << name_cxx << "TypeSupport_var ts = new " << name_cxx 00315 << "TypeSupportImpl;\n" 00316 " ts->register_type(0, \"\");\n" 00317 " }\n" 00318 "} init_" << name_underscores << ";\n\n"; 00319 }