XrdCl::AnyObject Class Reference

#include <XrdClAnyObject.hh>

Collaboration diagram for XrdCl::AnyObject:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AnyObject ()
 Constructor.
 ~AnyObject ()
 Destructor.
template<class Type>
void Set (Type object, bool own=true)
template<class Type>
void Get (Type &object)
 Retrieve the object being held.
bool HasOwnership () const
 Check if we own the object being stored.

Private Attributes

HolderpHolder
const std::type_info * pTypeInfo
bool pOwn

Classes

class  ConcreteHolder
class  Holder

Detailed Description

Simple implementation of a type safe holder for any object pointer It would have been a better idea to use boost::any here but we don't want to depend on boost


Constructor & Destructor Documentation

XrdCl::AnyObject::AnyObject (  )  [inline]

Constructor.

XrdCl::AnyObject::~AnyObject (  )  [inline]

Destructor.


Member Function Documentation

template<class Type>
void XrdCl::AnyObject::Get ( Type &  object  )  [inline]

Retrieve the object being held.

bool XrdCl::AnyObject::HasOwnership (  )  const [inline]

Check if we own the object being stored.

template<class Type>
void XrdCl::AnyObject::Set ( Type  object,
bool  own = true 
) [inline]

Grab an object By default the ownership of the object is taken as well, ie. the object will be deleted when the AnyObject holding it is deleted. To release an object grab a zero pointer, ie. (int *)0

Parameters:
object object pointer
own take the ownership or not


Member Data Documentation

Holder* XrdCl::AnyObject::pHolder [private]

bool XrdCl::AnyObject::pOwn [private]

const std::type_info* XrdCl::AnyObject::pTypeInfo [private]


The documentation for this class was generated from the following file:
Generated on 13 Mar 2017 for xrootd by  doxygen 1.4.7