OpenDDS  Snapshot(2023/04/28-20:55)
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 576 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().

576  {
577  const std::string cxx_name = scoped(name),
578  name_underscores = dds_generator::scoped_helper(name, "_"),
579  exportMacro = be_global->export_macro().c_str(),
580  exporter = exportMacro.empty() ? "" : (" " + exportMacro + '\n');
581  be_global->add_include("FACE/TS.hpp", BE_GlobalData::STREAM_FACETS_H);
582  be_global->facets_header_ <<
583  "namespace FACE\n"
584  "{\n"
585  " namespace Read_Callback\n"
586  " {\n"
587  " typedef void (*send_event_" << name_underscores << "_Ptr) (\n"
588  " /* in */ TRANSACTION_ID_TYPE transaction_id,\n"
589  " /* inout */ " << cxx_name << "& message,\n"
590  " /* in */ MESSAGE_TYPE_GUID message_type_id,\n"
591  " /* in */ MESSAGE_SIZE_TYPE message_size,\n"
592  " /* in */ const WAITSET_TYPE waitset,\n"
593  " /* out */ RETURN_CODE_TYPE& return_code);\n"
594  " }\n\n"
595  " namespace TS\n"
596  " {\n" << exporter <<
597  " void Receive_Message(\n"
598  " /* in */ CONNECTION_ID_TYPE connection_id,\n"
599  " /* in */ TIMEOUT_TYPE timeout,\n"
600  " /* inout */ TRANSACTION_ID_TYPE& transaction_id,\n"
601  " /* out */ " << cxx_name << "& message,\n"
602  " /* in */ MESSAGE_SIZE_TYPE message_size,\n"
603  " /* out */ RETURN_CODE_TYPE& return_code);\n\n" << exporter <<
604  " void Send_Message(\n"
605  " /* in */ CONNECTION_ID_TYPE connection_id,\n"
606  " /* in */ TIMEOUT_TYPE timeout,\n"
607  " /* inout */ TRANSACTION_ID_TYPE& transaction_id,\n"
608  " /* inout */ " << cxx_name << "& message,\n"
609  " /* inout */ MESSAGE_SIZE_TYPE& message_size,\n"
610  " /* out */ RETURN_CODE_TYPE& return_code);\n\n" << exporter <<
611  " void Register_Callback(\n"
612  " /* in */ CONNECTION_ID_TYPE connection_id,\n"
613  " /* in */ const WAITSET_TYPE waitset,\n"
614  " /* in */ Read_Callback::send_event_" << name_underscores
615  << "_Ptr data_callback,\n"
616  " /* in */ MESSAGE_SIZE_TYPE max_message_size,\n"
617  " /* out */ RETURN_CODE_TYPE& return_code);\n\n"
618  " }\n"
619  "}\n\n";
620  be_global->facets_impl_ <<
621  "void Receive_Message(CONNECTION_ID_TYPE connection_id,\n"
622  " TIMEOUT_TYPE timeout,\n"
623  " TRANSACTION_ID_TYPE& transaction_id,\n"
624  " " << cxx_name << "& message,\n"
625  " MESSAGE_SIZE_TYPE message_size,\n"
626  " RETURN_CODE_TYPE& return_code) {\n"
627  " OpenDDS::FaceTSS::receive_message(connection_id, timeout,\n"
628  " transaction_id, message,\n"
629  " message_size, return_code);\n"
630  "}\n\n"
631  "void Send_Message(CONNECTION_ID_TYPE connection_id,\n"
632  " TIMEOUT_TYPE timeout,\n"
633  " TRANSACTION_ID_TYPE& transaction_id,\n"
634  " " << cxx_name << "& message,\n"
635  " MESSAGE_SIZE_TYPE& message_size,\n"
636  " RETURN_CODE_TYPE& return_code) {\n"
637  " OpenDDS::FaceTSS::send_message(connection_id, timeout,\n"
638  " transaction_id, message,\n"
639  " message_size, return_code);\n"
640  "}\n\n"
641  "void Register_Callback(CONNECTION_ID_TYPE connection_id,\n"
642  " const WAITSET_TYPE waitset,\n"
643  " Read_Callback::send_event_" << name_underscores
644  << "_Ptr data_callback,\n"
645  " MESSAGE_SIZE_TYPE max_message_size,\n"
646  " RETURN_CODE_TYPE& return_code) {\n"
647  " OpenDDS::FaceTSS::register_callback(connection_id, waitset,\n"
648  " data_callback,\n"
649  " max_message_size, return_code);\n"
650  "}\n\n"
651  "namespace {\n"
652  " OpenDDS::DCPS::TypeSupportInitializer<" << cxx_name << "TypeSupportImpl> ts_init_" << name_underscores << ";\n"
653  "}\n\n";
654  }
static std::string scoped_helper(UTL_ScopedName *sn, const char *sep, EscapeContext cxt=EscapeContext_Normal)
const char * c_str(void) const
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