OpenDDS::DCPS::RcHandle< T > Class Template Reference

#include <RcHandle_T.h>

Collaboration diagram for OpenDDS::DCPS::RcHandle< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RcHandle ()
 RcHandle (T *p, bool take_ownership=true)
 RcHandle (const RcHandle &b)
 ~RcHandle ()
RcHandleoperator= (T *p)
RcHandleoperator= (const RcHandle &b)
void swap (RcHandle &rhs)
T * operator-> () const
T & operator * () const
bool is_nil () const
T * in () const
T *& inout ()
T *& out ()
T * _retn ()
bool operator== (const RcHandle &rhs)
bool operator!= (const RcHandle &rhs)

Private Member Functions

void bump_up ()
void bump_down ()

Private Attributes

T * ptr_
 The actual "unsmart" pointer to the T object.

Detailed Description

template<typename T>
class OpenDDS::DCPS::RcHandle< T >

Templated Reference counted handle to a pointer. A non-DDS specific helper class.

Definition at line 17 of file RcHandle_T.h.


Constructor & Destructor Documentation

template<typename T>
OpenDDS::DCPS::RcHandle< T >::RcHandle (  )  [inline]

Definition at line 20 of file RcHandle_T.h.

00021     : ptr_(0)
00022   {}

template<typename T>
OpenDDS::DCPS::RcHandle< T >::RcHandle ( T *  p,
bool  take_ownership = true 
) [inline]

Definition at line 24 of file RcHandle_T.h.

00025     : ptr_(p)
00026   {
00027     if (!take_ownership) {
00028       this->bump_up();
00029     }
00030   }

template<typename T>
OpenDDS::DCPS::RcHandle< T >::RcHandle ( const RcHandle< T > &  b  )  [inline]

Definition at line 32 of file RcHandle_T.h.

00033     : ptr_(b.ptr_)
00034   {
00035     this->bump_up();
00036   }

template<typename T>
OpenDDS::DCPS::RcHandle< T >::~RcHandle (  )  [inline]

Definition at line 38 of file RcHandle_T.h.

00039   {
00040     this->bump_down();
00041   }


Member Function Documentation

template<typename T>
T* OpenDDS::DCPS::RcHandle< T >::_retn (  )  [inline]

Definition at line 95 of file RcHandle_T.h.

Referenced by OpenDDS::DCPS::TcpTransport::accept_datalink(), OpenDDS::DCPS::RtpsUdpTransport::accept_datalink(), OpenDDS::DCPS::MulticastTransport::accept_datalink(), OpenDDS::DCPS::ShmemTransport::add_datalink(), OpenDDS::DCPS::TcpTransport::configure_i(), OpenDDS::DCPS::TcpTransport::connect_datalink(), OpenDDS::DCPS::RtpsUdpTransport::connect_datalink(), OpenDDS::DCPS::MulticastTransport::connect_datalink(), OpenDDS::DCPS::ReceiveListenerSetMap::find(), OpenDDS::DCPS::ReceiveListenerSetMap::find_or_create(), OpenDDS::DCPS::MulticastDataLink::find_or_create_session(), OpenDDS::DCPS::UdpTransport::make_datalink(), OpenDDS::DCPS::ShmemTransport::make_datalink(), OpenDDS::DCPS::TransportImpl::reactor_task(), OpenDDS::DCPS::TcpDataLink::reconnect(), OpenDDS::DCPS::ReceiveListenerSetMap::remove_set(), OpenDDS::DCPS::DataLinkSet::select_links(), OpenDDS::DCPS::MulticastTransport::start_session(), and OpenDDS::DCPS::TcpAcceptor::transport().

00096   {
00097     T* retval = this->ptr_;
00098     this->ptr_ = 0;
00099     return retval;
00100   }

template<typename T>
void OpenDDS::DCPS::RcHandle< T >::bump_down (  )  [inline, private]

Definition at line 121 of file RcHandle_T.h.

Referenced by OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::out(), and OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::~RcHandle().

00122   {
00123     if (this->ptr_ != 0) {
00124       this->ptr_->_remove_ref();
00125       this->ptr_ = 0;
00126     }
00127   }

template<typename T>
void OpenDDS::DCPS::RcHandle< T >::bump_up (  )  [inline, private]

Definition at line 114 of file RcHandle_T.h.

Referenced by OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::RcHandle().

00115   {
00116     if (this->ptr_ != 0) {
00117       this->ptr_->_add_ref();
00118     }
00119   }

template<typename T>
T* OpenDDS::DCPS::RcHandle< T >::in (  )  const [inline]

Definition at line 79 of file RcHandle_T.h.

Referenced by OpenDDS::DCPS::TcpTransport::accept_datalink(), OpenDDS::DCPS::TcpConnection::active_establishment(), OpenDDS::DCPS::RecorderImpl::add_association(), OpenDDS::DCPS::TransportClient::add_link(), OpenDDS::DCPS::ReplayerImpl::association_complete_i(), OpenDDS::DCPS::DataWriterImpl::association_complete_i(), OpenDDS::DCPS::TcpTransport::async_connect_failed(), OpenDDS::DCPS::ComparatorBase::compare(), OpenDDS::DCPS::TransportImpl::config(), OpenDDS::DCPS::TcpTransport::connect_datalink(), OpenDDS::DCPS::RtpsUdpTransport::connect_datalink(), OpenDDS::DCPS::const_rchandle_cast(), OpenDDS::DCPS::RecorderImpl::data_received(), OpenDDS::DCPS::DataReaderImpl::data_received(), OpenDDS::DCPS::DataLink::data_received_i(), OpenDDS::DCPS::TransportClient::disassociate(), OpenDDS::DCPS::dynamic_rchandle_cast(), OpenDDS::DCPS::RemoveAssociationSweeper< T >::ScheduleCommand::execute(), OpenDDS::DCPS::EndHistoricSamplesMissedSweeper::ScheduleCommand::execute(), OpenDDS::DCPS::TcpTransport::find_datalink_i(), OpenDDS::DCPS::TcpTransport::fresh_link(), OpenDDS::DCPS::TcpTransport::get_configuration(), OpenDDS::DCPS::MulticastLoader::init(), OpenDDS::DCPS::MonitorFactoryImpl::initialize(), OpenDDS::Federator::ManagerImpl::initialize(), OpenDDS::DCPS::RtpsUdpDataLink::MultiSendBuffer::insert(), OpenDDS::DCPS::UdpTransport::make_datalink(), OpenDDS::DCPS::ShmemTransport::make_datalink(), OpenDDS::DCPS::RtpsUdpTransport::make_datalink(), OpenDDS::DCPS::MulticastTransport::make_datalink(), OpenDDS::DCPS::MulticastTransport::MulticastTransport(), OpenDDS::DCPS::TcpConnection::open(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::operator!=(), OpenDDS::DCPS::RakeResults< SampleSeq >::SortedSetCmp::operator()(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::operator==(), OpenDDS::DCPS::TcpDataLink::pre_stop_i(), OpenDDS::DCPS::MulticastDataLink::receive_strategy(), OpenDDS::DCPS::TcpDataLink::reconnect(), OpenDDS::DCPS::TcpTransport::release_datalink(), OpenDDS::DCPS::ReplayerImpl::remove_associations(), OpenDDS::DCPS::RecorderImpl::remove_associations_i(), OpenDDS::DCPS::TcpDataLink::reuse_existing_connection(), OpenDDS::DCPS::RtpsUdpTransport::RtpsUdpTransport(), OpenDDS::DCPS::TransportClient::send_i(), OpenDDS::DCPS::MulticastDataLink::send_strategy(), OpenDDS::DCPS::ShmemTransport::ShmemTransport(), OpenDDS::DCPS::TcpReceiveStrategy::start_i(), OpenDDS::DCPS::static_rchandle_cast(), OpenDDS::DCPS::TcpTransport::TcpTransport(), OpenDDS::DCPS::TcpConnection::transfer(), OpenDDS::DCPS::UdpTransport::UdpTransport(), and OpenDDS::DCPS::TransportClient::use_datalink_i().

00080   {
00081     return this->ptr_;
00082   }

template<typename T>
T*& OpenDDS::DCPS::RcHandle< T >::inout (  )  [inline]

Definition at line 84 of file RcHandle_T.h.

00085   {
00086     return this->ptr_;
00087   }

template<typename T>
bool OpenDDS::DCPS::RcHandle< T >::is_nil (  )  const [inline]

Definition at line 74 of file RcHandle_T.h.

Referenced by OpenDDS::DCPS::TcpTransport::accept_datalink(), OpenDDS::DCPS::RtpsUdpTransport::accept_datalink(), OpenDDS::DCPS::MulticastTransport::accept_datalink(), OpenDDS::DCPS::DataLink::add_on_start_callback(), OpenDDS::DCPS::TransportClient::associate(), OpenDDS::DCPS::TransportRegistry::bind_config(), OpenDDS::DCPS::InfoRepoDiscovery::bit_config(), OpenDDS::DCPS::TcpTransport::connect_datalink(), OpenDDS::DCPS::RtpsUdpTransport::connect_datalink(), OpenDDS::DCPS::MulticastTransport::connect_datalink(), FACE::TS::create_opendds_entities(), OpenDDS::DCPS::DomainParticipantFactoryImpl::create_participant(), OpenDDS::DCPS::DataLink::data_received_i(), OpenDDS::DCPS::TransportClient::enable_transport(), OpenDDS::DCPS::TransportClient::enable_transport_using_config(), OpenDDS::DCPS::MulticastDataLink::find_or_create_session(), OpenDDS::DCPS::TransportRegistry::fix_empty_default(), OpenDDS::DCPS::TcpSendStrategy::get_handle(), OpenDDS::DCPS::TcpConnection::handle_close(), OpenDDS::DCPS::TcpConnection::handle_input(), OpenDDS::DCPS::MonitorFactoryImpl::initialize(), OpenDDS::DCPS::TransportClient::PendingAssoc::initiate_connect(), OpenDDS::DCPS::RtpsUdpDataLink::MultiSendBuffer::insert(), OpenDDS::DCPS::ReceiveListenerSetMap::insert(), OpenDDS::DCPS::Service_Participant::load_domain_configuration(), OpenDDS::DCPS::UdpTransport::make_datalink(), OpenDDS::DCPS::ShmemTransport::make_datalink(), OpenDDS::DCPS::DataLink::make_reservation(), OpenDDS::DCPS::MulticastTransport::MulticastTransport(), OpenDDS::DCPS::TcpConnection::open(), OpenDDS::FaceTSS::config::Parser::parse(), OpenDDS::DCPS::StaticDiscovery::parse_endpoints(), OpenDDS::DCPS::TcpTransport::passive_connection(), OpenDDS::DCPS::RtpsUdpTransport::pre_detach(), OpenDDS::DCPS::TransportImpl::reactor(), OpenDDS::DCPS::TcpReceiveStrategy::receive_bytes(), OpenDDS::DCPS::TcpDataLink::reconnect(), OpenDDS::FileSystemStorage::Directory::remove(), OpenDDS::DCPS::DataLink::remove_all_msgs(), OpenDDS::DCPS::DataLink::remove_sample(), OpenDDS::Federator::ManagerImpl::repository(), OpenDDS::DCPS::TcpDataLink::reuse_existing_connection(), OpenDDS::DCPS::RtpsUdpTransport::RtpsUdpTransport(), OpenDDS::DCPS::TcpSendStrategy::send_bytes_i(), OpenDDS::DCPS::TransportClient::send_i(), OpenDDS::DCPS::DataLink::send_i(), OpenDDS::DCPS::DataLink::send_start_i(), OpenDDS::DCPS::DataLink::send_stop_i(), OpenDDS::DCPS::ShmemTransport::ShmemTransport(), OpenDDS::DCPS::RtpsUdpTransport::shutdown_i(), OpenDDS::DCPS::DataLink::start(), OpenDDS::DCPS::MulticastTransport::start_session(), OpenDDS::DCPS::DataLink::stop(), OpenDDS::DCPS::TcpTransport::TcpTransport(), OpenDDS::DCPS::UdpTransport::UdpTransport(), OpenDDS::DCPS::TransportClient::use_datalink_i(), and OpenDDS::DCPS::DataReaderImpl::writer_activity().

00075   {
00076     return this->ptr_ == 0;
00077   }

template<typename T>
T& OpenDDS::DCPS::RcHandle< T >::operator * (  )  const [inline]

Definition at line 69 of file RcHandle_T.h.

00070   {
00071     return *this->ptr_;
00072   }

template<typename T>
bool OpenDDS::DCPS::RcHandle< T >::operator!= ( const RcHandle< T > &  rhs  )  [inline]

Definition at line 107 of file RcHandle_T.h.

00108   {
00109     return in() != rhs.in();
00110   }

template<typename T>
T* OpenDDS::DCPS::RcHandle< T >::operator-> (  )  const [inline]

Definition at line 64 of file RcHandle_T.h.

00065   {
00066     return this->ptr_;
00067   }

template<typename T>
RcHandle& OpenDDS::DCPS::RcHandle< T >::operator= ( const RcHandle< T > &  b  )  [inline]

Definition at line 50 of file RcHandle_T.h.

00051   {
00052     RcHandle tmp(b);
00053     swap(tmp);
00054     return *this;
00055   }

template<typename T>
RcHandle& OpenDDS::DCPS::RcHandle< T >::operator= ( T *  p  )  [inline]

Definition at line 43 of file RcHandle_T.h.

00044   {
00045     RcHandle tmp(p);
00046     swap(tmp);
00047     return *this;
00048   }

template<typename T>
bool OpenDDS::DCPS::RcHandle< T >::operator== ( const RcHandle< T > &  rhs  )  [inline]

Definition at line 102 of file RcHandle_T.h.

00103   {
00104     return in() == rhs.in();
00105   }

template<typename T>
T*& OpenDDS::DCPS::RcHandle< T >::out (  )  [inline]

Definition at line 89 of file RcHandle_T.h.

00090   {
00091     this->bump_down();
00092     return this->ptr_;
00093   }

template<typename T>
void OpenDDS::DCPS::RcHandle< T >::swap ( RcHandle< T > &  rhs  )  [inline]

Definition at line 57 of file RcHandle_T.h.

Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::operator=(), and OpenDDS::DCPS::swap().

00058   {
00059     T* t = this->ptr_;
00060     this->ptr_ = rhs.ptr_;
00061     rhs.ptr_ = t;
00062   }


Member Data Documentation

template<typename T>
T* OpenDDS::DCPS::RcHandle< T >::ptr_ [private]

The actual "unsmart" pointer to the T object.

Definition at line 130 of file RcHandle_T.h.

Referenced by OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::_retn(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::bump_down(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::bump_up(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::in(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::inout(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::is_nil(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::operator *(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::operator->(), OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::out(), and OpenDDS::DCPS::RcHandle< OpenDDS::DCPS::MulticastInst >::swap().


The documentation for this class was generated from the following file:
Generated on Fri Feb 12 20:06:21 2016 for OpenDDS by  doxygen 1.4.7