XrdCl::AnyObject Class Reference

#include <XrdClAnyObject.hh>

Collaboration diagram for XrdCl::AnyObject:
Collaboration graph
[legend]

List of all members.

Classes

class  ConcreteHolder
class  Holder

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

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.

References XrdCl::AnyObject::Holder::Delete(), pHolder, and pOwn.


Member Function Documentation

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

Retrieve the object being held.

References XrdCl::AnyObject::Holder::Get(), pHolder, and pTypeInfo.

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

Check if we own the object being stored.

References pOwn.

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

References pHolder, pOwn, and pTypeInfo.


Member Data Documentation

Referenced by Get(), Set(), and ~AnyObject().

bool XrdCl::AnyObject::pOwn [private]

Referenced by HasOwnership(), Set(), and ~AnyObject().

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

Referenced by Get(), and Set().


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

Generated on 3 May 2018 for xrootd by  doxygen 1.6.1