| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

ObjectReg Class Reference

Encapsulates the registration of a DataObject in the TES/AES. More...

#include <ObjectReg.h>

Collaboration diagram for ObjectReg:

[legend]
List of all members.

Public Member Functions

 ObjectReg (IRegistry *registry, DataObject *object, bool store)
 Standard constructor.
 ObjectReg (const ObjectReg &rhs)
 Copy constructor.
 ObjectReg ()
 Default Constructor.
virtual ~ObjectReg ()
 Destructor.
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
const std::string & path () const
 The path at which this associated object was registered.
const IRegistryregistry () const
 Retrieve the registry.
const DataObjectobject () const
 Retrieve const The object registered in the TES/AES system.
DataObjectobject ()
 Retrieve nonconst.
bool store () const
 Retrieve const True if the object should be stored.
void setStore (bool value)
 Update True if the object should be stored.
int entry () const
 The I/O stream entry number.
void setEntry (int entry)
ObjectRegoperator= (const ObjectReg &rhs)

Static Public Member Functions

static void * operator new (size_t size)
 operator new
static void * operator new (size_t size, void *pObj)
 placement operator new it is needed by libstdc++ 3.2.3 (e.g.
static void operator delete (void *p)
 operator delete
static void operator delete (void *p, void *pObj)
 placement operator delete not sure if really needed, but it does not harm

Private Member Functions

void setRegistry (IRegistry *registry)
 Sets Object pointer.
void setObject (DataObject *value)
 Sets Object pointer.

Private Attributes

IRegistrym_registry
 The IRegistry instance in the AES into which the object was registered.
DataObjectm_object
 The object registered in the TES/AES system.
bool m_store
 True if the object should be stored.
int m_entry
 Output stream entry number.

Detailed Description

Encapsulates the registration of a DataObject in the TES/AES.

Author:
Simon Patton <SJPatton@lbl.gov> created Mon Jul 7 13:51:05 2008

Definition at line 20 of file ObjectReg.h.


Constructor & Destructor Documentation

ObjectReg::ObjectReg ( IRegistry registry,
DataObject object,
bool  store 
)

Standard constructor.

Definition at line 22 of file ObjectReg.cc.

00024                                 :
00025   m_registry(0),
00026   m_object(0),
00027   m_store(store)
00028 {
00029   setRegistry(registry);
00030   setObject(object);
00031 }

ObjectReg::ObjectReg ( const ObjectReg rhs  ) 

Copy constructor.

Definition at line 33 of file ObjectReg.cc.

00033                                          :
00034   m_registry(0),
00035   m_object(0),
00036   m_store(rhs.m_store)
00037 {
00038   setRegistry(rhs.m_registry);
00039   setObject(rhs.m_object);
00040 }

ObjectReg::ObjectReg (  )  [inline]

Default Constructor.

Definition at line 33 of file ObjectReg.h.

00033                 : m_registry(0),
00034                   m_object(0),
00035                   m_store(false) {}

ObjectReg::~ObjectReg (  )  [virtual]

Destructor.

Definition at line 42 of file ObjectReg.cc.

00043 {
00044   if (m_registry) {
00045     m_registry->release();
00046   }
00047   if (0 != m_object) {
00048     m_object->release();
00049   }          
00050 }


Member Function Documentation

std::ostream & ObjectReg::fillStream ( std::ostream &  s  )  const [inline, virtual]

Fill the ASCII output stream.

Definition at line 130 of file ObjectReg.h.

00131 {
00132   char l_store = (m_store) ? 'T' : 'F';
00133   s << "{ " << "registry :      " << m_registry << std::endl
00134             << "object :        " << m_object << std::endl
00135             << "store : " << l_store << std::endl << " }";
00136   return s;
00137 }

const std::string & ObjectReg::path (  )  const

The path at which this associated object was registered.

Definition at line 52 of file ObjectReg.cc.

00053 {
00054   return m_registry->identifier();
00055 }

const IRegistry * ObjectReg::registry (  )  const

Retrieve the registry.

Definition at line 57 of file ObjectReg.cc.

00058 {
00059     return m_registry;
00060 }

const DataObject * ObjectReg::object (  )  const

Retrieve const The object registered in the TES/AES system.

Definition at line 3 of file ObjectReg.cc.

00004 {
00005   return m_object;
00006 }

DataObject * ObjectReg::object (  ) 

Retrieve nonconst.

Definition at line 7 of file ObjectReg.cc.

00008 {
00009   return m_object;
00010 }

bool ObjectReg::store (  )  const

Retrieve const True if the object should be stored.

Definition at line 12 of file ObjectReg.cc.

00013 {
00014   return m_store;
00015 }

void ObjectReg::setStore ( bool  value  ) 

Update True if the object should be stored.

Definition at line 17 of file ObjectReg.cc.

00018 {
00019   m_store = value;
00020 }

int ObjectReg::entry (  )  const

The I/O stream entry number.

This is meant to be used by the framework.

Definition at line 94 of file ObjectReg.cc.

00095 {
00096   return m_entry;
00097 }

void ObjectReg::setEntry ( int  entry  ) 

Definition at line 98 of file ObjectReg.cc.

00099 {
00100   m_entry = entry;
00101 }

ObjectReg & ObjectReg::operator= ( const ObjectReg rhs  ) 

Definition at line 103 of file ObjectReg.cc.

00103                                                     {
00104   if (this != &rhs) {
00105     setRegistry(rhs.m_registry);
00106     setObject(rhs.m_object);
00107     m_store=rhs.m_store;
00108   }
00109   return *this;
00110 }

static void* ObjectReg::operator new ( size_t  size  )  [inline, static]

operator new

Definition at line 73 of file ObjectReg.h.

00074     {
00075       return ( sizeof(ObjectReg) == size ? 
00076                boost::singleton_pool<ObjectReg, sizeof(ObjectReg)>::malloc() :
00077                ::operator new(size) );
00078     }

static void* ObjectReg::operator new ( size_t  size,
void *  pObj 
) [inline, static]

placement operator new it is needed by libstdc++ 3.2.3 (e.g.

in std::vector) it is not needed in libstdc++ >= 3.4

Definition at line 83 of file ObjectReg.h.

00084     {
00085       return ::operator new (size,pObj);
00086     }

static void ObjectReg::operator delete ( void *  p  )  [inline, static]

operator delete

Definition at line 89 of file ObjectReg.h.

00090     {
00091       boost::singleton_pool<ObjectReg, sizeof(ObjectReg)>::is_from(p) ?
00092               boost::singleton_pool<ObjectReg, sizeof(ObjectReg)>::free(p) :
00093               ::operator delete(p);
00094     }

static void ObjectReg::operator delete ( void *  p,
void *  pObj 
) [inline, static]

placement operator delete not sure if really needed, but it does not harm

Definition at line 98 of file ObjectReg.h.

00099     {
00100       ::operator delete (p, pObj);
00101     }

void ObjectReg::setRegistry ( IRegistry registry  )  [private]

Sets Object pointer.

Definition at line 78 of file ObjectReg.cc.

00079 {
00080   if (registry == m_registry) {
00081     return;
00082   }
00083 
00084   if (0 != registry) {
00085     registry->addRef();
00086   }
00087 
00088   if (0 != m_registry) {
00089     m_registry->release();
00090   }
00091   m_registry = registry;
00092 }

void ObjectReg::setObject ( DataObject value  )  [private]

Sets Object pointer.

Definition at line 62 of file ObjectReg.cc.

00063 {
00064   if (value == m_object) {
00065     return;
00066   }
00067 
00068   if (0 != value) {
00069     value->addRef();
00070   }
00071 
00072   if (0 != m_object) {
00073     m_object->release();
00074   }
00075   m_object = value;
00076 }


Member Data Documentation

IRegistry* ObjectReg::m_registry [private]

The IRegistry instance in the AES into which the object was registered.

Definition at line 112 of file ObjectReg.h.

DataObject* ObjectReg::m_object [private]

The object registered in the TES/AES system.

Definition at line 113 of file ObjectReg.h.

bool ObjectReg::m_store [private]

True if the object should be stored.

Definition at line 114 of file ObjectReg.h.

int ObjectReg::m_entry [mutable, private]

Output stream entry number.

Definition at line 115 of file ObjectReg.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:09:25 2011 for DybKernel by doxygen 1.4.7