OpenDDS  Snapshot(2023/04/25-14:16)
Functions
face_ts_generator Namespace Reference

Functions

void generate (UTL_ScopedName *name)
 

Function Documentation

◆ generate()

void face_ts_generator::generate ( UTL_ScopedName *  name)

Definition at line 545 of file ts_generator.cpp.

References be_global, ACE_String_Base< char >::c_str(), scoped(), and dds_generator::scoped_helper().

Referenced by ts_generator::generate_ts().

545  {
546  const std::string cxx_name = scoped(name),
547  name_underscores = dds_generator::scoped_helper(name, "_"),
548  exportMacro = be_global->export_macro().c_str(),
549  exporter = exportMacro.empty() ? "" : (" " + exportMacro + '\n');
550  be_global->add_include("FACE/TS.hpp", BE_GlobalData::STREAM_FACETS_H);
551  be_global->facets_header_ <<
552  "namespace FACE\n"
553  "{\n"
554  " namespace Read_Callback\n"
555  " {\n"
556  " typedef void (*send_event_" << name_underscores << "_Ptr) (\n"
557  " /* in */ TRANSACTION_ID_TYPE transaction_id,\n"
558  " /* inout */ " << cxx_name << "& message,\n"
559  " /* in */ MESSAGE_TYPE_GUID message_type_id,\n"
560  " /* in */ MESSAGE_SIZE_TYPE message_size,\n"
561  " /* in */ const WAITSET_TYPE waitset,\n"
562  " /* out */ RETURN_CODE_TYPE& return_code);\n"
563  " }\n\n"
564  " namespace TS\n"
565  " {\n" << exporter <<
566  " void Receive_Message(\n"
567  " /* in */ CONNECTION_ID_TYPE connection_id,\n"
568  " /* in */ TIMEOUT_TYPE timeout,\n"
569  " /* inout */ TRANSACTION_ID_TYPE& transaction_id,\n"
570  " /* out */ " << cxx_name << "& message,\n"
571  " /* in */ MESSAGE_SIZE_TYPE message_size,\n"
572  " /* out */ RETURN_CODE_TYPE& return_code);\n\n" << exporter <<
573  " void Send_Message(\n"
574  " /* in */ CONNECTION_ID_TYPE connection_id,\n"
575  " /* in */ TIMEOUT_TYPE timeout,\n"
576  " /* inout */ TRANSACTION_ID_TYPE& transaction_id,\n"
577  " /* inout */ " << cxx_name << "& message,\n"
578  " /* inout */ MESSAGE_SIZE_TYPE& message_size,\n"
579  " /* out */ RETURN_CODE_TYPE& return_code);\n\n" << exporter <<
580  " void Register_Callback(\n"
581  " /* in */ CONNECTION_ID_TYPE connection_id,\n"
582  " /* in */ const WAITSET_TYPE waitset,\n"
583  " /* in */ Read_Callback::send_event_" << name_underscores
584  << "_Ptr data_callback,\n"
585  " /* in */ MESSAGE_SIZE_TYPE max_message_size,\n"
586  " /* out */ RETURN_CODE_TYPE& return_code);\n\n"
587  " }\n"
588  "}\n\n";
589  be_global->facets_impl_ <<
590  "void Receive_Message(CONNECTION_ID_TYPE connection_id,\n"
591  " TIMEOUT_TYPE timeout,\n"
592  " TRANSACTION_ID_TYPE& transaction_id,\n"
593  " " << cxx_name << "& message,\n"
594  " MESSAGE_SIZE_TYPE message_size,\n"
595  " RETURN_CODE_TYPE& return_code) {\n"
596  " OpenDDS::FaceTSS::receive_message(connection_id, timeout,\n"
597  " transaction_id, message,\n"
598  " message_size, return_code);\n"
599  "}\n\n"
600  "void Send_Message(CONNECTION_ID_TYPE connection_id,\n"
601  " TIMEOUT_TYPE timeout,\n"
602  " TRANSACTION_ID_TYPE& transaction_id,\n"
603  " " << cxx_name << "& message,\n"
604  " MESSAGE_SIZE_TYPE& message_size,\n"
605  " RETURN_CODE_TYPE& return_code) {\n"
606  " OpenDDS::FaceTSS::send_message(connection_id, timeout,\n"
607  " transaction_id, message,\n"
608  " message_size, return_code);\n"
609  "}\n\n"
610  "void Register_Callback(CONNECTION_ID_TYPE connection_id,\n"
611  " const WAITSET_TYPE waitset,\n"
612  " Read_Callback::send_event_" << name_underscores
613  << "_Ptr data_callback,\n"
614  " MESSAGE_SIZE_TYPE max_message_size,\n"
615  " RETURN_CODE_TYPE& return_code) {\n"
616  " OpenDDS::FaceTSS::register_callback(connection_id, waitset,\n"
617  " data_callback,\n"
618  " max_message_size, return_code);\n"
619  "}\n\n"
620  "namespace {\n"
621  " OpenDDS::DCPS::TypeSupportInitializer<" << cxx_name << "TypeSupportImpl> ts_init_" << name_underscores << ";\n"
622  "}\n\n";
623  }
const char * c_str(void) const
static std::string scoped_helper(UTL_ScopedName *sn, const char *sep, EscapeContext cxt=EscapeContext_Normal)
const char *const name
Definition: debug.cpp:60
std::string scoped(UTL_ScopedName *sn, EscapeContext ec=EscapeContext_Normal)
BE_GlobalData * be_global
Definition: be_global.cpp:44