00001
00002
00003
00004
00005
00006
00007
00008 #ifndef REGISTERED_DATA_TYPES_H_
00009 #define REGISTERED_DATA_TYPES_H_
00010
00011 #include "dcps_export.h"
00012 #include "dds/DdsDcpsDomainC.h"
00013 #include "dds/DdsDcpsTypeSupportExtC.h"
00014 #include "Definitions.h"
00015
00016 #include "PoolAllocator.h"
00017
00018 #include "ace/Singleton.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif
00023
00024 namespace OpenDDS {
00025 namespace DCPS {
00026
00027 typedef OPENDDS_MAP(OPENDDS_STRING, TypeSupport_var) TypeSupportMap;
00028 typedef OPENDDS_MAP(DDS::DomainParticipant_ptr, TypeSupportMap) ParticipantMap;
00029
00030
00031
00032
00033
00034
00035 class OpenDDS_Dcps_Export Data_Types_Register {
00036 friend class ACE_Singleton<Data_Types_Register, ACE_SYNCH_MUTEX>;
00037
00038 public:
00039
00040
00041 static Data_Types_Register* instance();
00042
00043
00044
00045
00046
00047
00048
00049
00050 DDS::ReturnCode_t register_type(DDS::DomainParticipant_ptr domain_participant,
00051 const char* type_name,
00052 TypeSupport_ptr the_type);
00053
00054 DDS::ReturnCode_t unregister_participant(DDS::DomainParticipant_ptr domain_participant);
00055
00056
00057
00058
00059
00060
00061 TypeSupport_ptr lookup(DDS::DomainParticipant_ptr domain_participant,
00062 const char* type_name) const;
00063 private:
00064 Data_Types_Register();
00065 ~Data_Types_Register();
00066
00067 mutable ACE_SYNCH_MUTEX lock_;
00068 ParticipantMap participants_;
00069 };
00070
00071 #define Registered_Data_Types Data_Types_Register::instance()
00072
00073 }
00074 }
00075
00076 #endif