TopicDescriptionImpl.cpp

Go to the documentation of this file.
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 #include "TopicDescriptionImpl.h"
00010 #include "DomainParticipantImpl.h"
00011 #include "TopicImpl.h"
00012 #include "Service_Participant.h"
00013 
00014 namespace OpenDDS {
00015 namespace DCPS {
00016 
00017 // Implementation skeleton constructor
00018 TopicDescriptionImpl::TopicDescriptionImpl(const char*            topic_name,
00019                                            const char*            type_name,
00020                                            TypeSupport_ptr        type_support,
00021                                            DomainParticipantImpl* participant)
00022   : topic_name_(topic_name),
00023     type_name_(type_name),
00024     participant_(participant),
00025     type_support_(type_support)
00026 {
00027   // make sure the type_support doesn't get deleted while
00028   // were still using it.
00029   if (type_support_)
00030     type_support_->_add_ref();
00031 }
00032 
00033 // Implementation skeleton destructor
00034 TopicDescriptionImpl::~TopicDescriptionImpl()
00035 {
00036   // were finished with the type_support
00037   if (type_support_)
00038     type_support_->_remove_ref();
00039 }
00040 
00041 char *
00042 TopicDescriptionImpl::get_type_name()
00043 {
00044   return CORBA::string_dup(type_name_.c_str());
00045 }
00046 
00047 char *
00048 TopicDescriptionImpl::get_name()
00049 {
00050   return CORBA::string_dup(topic_name_.c_str());
00051 }
00052 
00053 DDS::DomainParticipant_ptr
00054 TopicDescriptionImpl::get_participant()
00055 {
00056   return DDS::DomainParticipant::_duplicate(participant_);
00057 }
00058 
00059 OpenDDS::DCPS::TypeSupport_ptr
00060 TopicDescriptionImpl::get_type_support()
00061 {
00062   return type_support_;
00063 }
00064 
00065 } // namespace DCPS
00066 } // namespace OpenDDS

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7