00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/ 00009 00010 #include "TypeSupportImpl.h" 00011 00012 #include "Registered_Data_Types.h" 00013 00014 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00015 00016 namespace OpenDDS { 00017 namespace DCPS { 00018 00019 TypeSupportImpl::~TypeSupportImpl() 00020 {} 00021 00022 DDS::ReturnCode_t 00023 TypeSupportImpl::register_type(DDS::DomainParticipant_ptr participant, 00024 const char* type_name) 00025 { 00026 const char* const type = 00027 (!type_name || !type_name[0]) ? default_type_name() : type_name; 00028 return Registered_Data_Types->register_type(participant, type, this); 00029 } 00030 00031 DDS::ReturnCode_t 00032 TypeSupportImpl::unregister_type(DDS::DomainParticipant_ptr participant, 00033 const char* type_name) 00034 { 00035 if (type_name == 0 || type_name[0] == '\0') { 00036 return DDS::RETCODE_BAD_PARAMETER; 00037 } else { 00038 return Registered_Data_Types->unregister_type(participant, type_name, this); 00039 } 00040 } 00041 00042 char* 00043 TypeSupportImpl::get_type_name() 00044 { 00045 CORBA::String_var type = default_type_name(); 00046 return type._retn(); 00047 } 00048 00049 } 00050 } 00051 00052 OPENDDS_END_VERSIONED_NAMESPACE_DECL