Registered_Data_Types.h
Go to the documentation of this file.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 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00025
00026 namespace OpenDDS {
00027 namespace DCPS {
00028
00029 typedef OPENDDS_MAP(OPENDDS_STRING, TypeSupport_var) TypeSupportMap;
00030 typedef OPENDDS_MAP(DDS::DomainParticipant_ptr, TypeSupportMap) ParticipantMap;
00031
00032
00033
00034
00035
00036
00037 class OpenDDS_Dcps_Export Data_Types_Register {
00038 friend class ACE_Singleton<Data_Types_Register, ACE_SYNCH_MUTEX>;
00039
00040 public:
00041
00042
00043 static Data_Types_Register* instance();
00044
00045
00046
00047
00048
00049
00050
00051
00052 DDS::ReturnCode_t register_type(DDS::DomainParticipant_ptr domain_participant,
00053 const char* type_name,
00054 TypeSupport_ptr the_type);
00055
00056
00057
00058
00059
00060
00061
00062
00063 DDS::ReturnCode_t unregister_type(DDS::DomainParticipant_ptr domain_participant,
00064 const char* type_name,
00065 TypeSupport_ptr the_type);
00066
00067 DDS::ReturnCode_t unregister_participant(DDS::DomainParticipant_ptr domain_participant);
00068
00069
00070
00071
00072
00073
00074 TypeSupport_ptr lookup(DDS::DomainParticipant_ptr domain_participant,
00075 const char* type_name) const;
00076 private:
00077 Data_Types_Register();
00078 ~Data_Types_Register();
00079
00080 mutable ACE_SYNCH_MUTEX lock_;
00081 ParticipantMap participants_;
00082 };
00083
00084 #define Registered_Data_Types Data_Types_Register::instance()
00085
00086 }
00087 }
00088
00089 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00090
00091 #endif