org::xmlBlaster::util::ReferenceHolder< T > Class Template Reference

Normally stl containers store values, i.e. More...

Collaboration diagram for org::xmlBlaster::util::ReferenceHolder< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ReferenceHolder (T *el)
 ReferenceHolder (T &el)
 ReferenceHolder (const ReferenceHolder &refHolder)
ReferenceHolderoperator= (const ReferenceHolder &refHolder)
 ~ReferenceHolder ()
T & operator * () const
T * operator-> () const
T * getElement () const
bool isNull () const
bool operator== (const ReferenceHolder< T > other) const
bool operator< (const ReferenceHolder< T > other) const
bool operator> (const ReferenceHolder< T > other) const

Detailed Description

template<class T>
class org::xmlBlaster::util::ReferenceHolder< T >

Normally stl containers store values, i.e.

if you pass an entry to a container, the entry is first copied and then put into the container. When you retrieve the entry it is copied again. In cases you want to allocate the objects outside the container and store the references of such objects in the container (i.e. the container is not the owner of the object), you could use pointers. The drawback of using pointers however is that you loose the comparison operator. This class allows you to store the objects as references and at the same time maintains the correct comparison between entries in the container.

Author:
Michele Laghi

Definition at line 28 of file ReferenceHolder.h.


Constructor & Destructor Documentation

template<class T>
org::xmlBlaster::util::ReferenceHolder< T >::ReferenceHolder ( T *  el  ) 

Definition at line 46 of file ReferenceHolder.h.

template<class T>
org::xmlBlaster::util::ReferenceHolder< T >::ReferenceHolder ( T &  el  ) 

Definition at line 52 of file ReferenceHolder.h.

template<class T>
org::xmlBlaster::util::ReferenceHolder< T >::ReferenceHolder ( const ReferenceHolder< T > &  refHolder  ) 

Definition at line 57 of file ReferenceHolder.h.

template<class T>
org::xmlBlaster::util::ReferenceHolder< T >::~ReferenceHolder (  ) 

Definition at line 74 of file ReferenceHolder.h.


Member Function Documentation

template<class T>
ReferenceHolder& org::xmlBlaster::util::ReferenceHolder< T >::operator= ( const ReferenceHolder< T > &  refHolder  ) 

Definition at line 63 of file ReferenceHolder.h.

References org::xmlBlaster::util::ReferenceHolder< T >::element_.

template<class T>
T& org::xmlBlaster::util::ReferenceHolder< T >::operator * (  )  const

Definition at line 80 of file ReferenceHolder.h.

template<class T>
T* org::xmlBlaster::util::ReferenceHolder< T >::operator-> (  )  const

Definition at line 85 of file ReferenceHolder.h.

template<class T>
T* org::xmlBlaster::util::ReferenceHolder< T >::getElement (  )  const

Definition at line 90 of file ReferenceHolder.h.

template<class T>
bool org::xmlBlaster::util::ReferenceHolder< T >::isNull (  )  const

Definition at line 95 of file ReferenceHolder.h.

Referenced by org::xmlBlaster::util::dispatch::ConnectionsHandler::connect(), org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueue(), org::xmlBlaster::util::queue::ConnectQueueEntry::getEmbeddedObject(), org::xmlBlaster::client::XmlBlasterAccess::getSessionName(), org::xmlBlaster::client::XmlBlasterAccess::getSessionNameRef(), org::xmlBlaster::util::queue::ConnectQueueEntry::getSizeInBytes(), org::xmlBlaster::util::dispatch::ConnectionsHandler::isFailsafe(), org::xmlBlaster::util::dispatch::ConnectionsHandler::publish(), org::xmlBlaster::util::dispatch::ConnectionsHandler::queuePublish(), org::xmlBlaster::util::dispatch::ConnectionsHandler::queueSubscribe(), org::xmlBlaster::util::dispatch::ConnectionsHandler::startPinger(), org::xmlBlaster::util::dispatch::ConnectionsHandler::timeout(), and org::xmlBlaster::util::dispatch::ConnectionsHandler::~ConnectionsHandler().

template<class T>
bool org::xmlBlaster::util::ReferenceHolder< T >::operator== ( const ReferenceHolder< T >  other  )  const

Definition at line 100 of file ReferenceHolder.h.

References org::xmlBlaster::util::ReferenceHolder< T >::element_.

template<class T>
bool org::xmlBlaster::util::ReferenceHolder< T >::operator< ( const ReferenceHolder< T >  other  )  const

Definition at line 105 of file ReferenceHolder.h.

template<class T>
bool org::xmlBlaster::util::ReferenceHolder< T >::operator> ( const ReferenceHolder< T >  other  )  const

Definition at line 117 of file ReferenceHolder.h.

References org::xmlBlaster::util::ReferenceHolder< T >::element_.


The documentation for this class was generated from the following file: