#include <CkptObject.h>
Inheritance diagram for CkptObject:
Public Member Functions | |
CkptObject () | |
virtual | ~CkptObject () |
virtual void | serialize (DAOInterface &dao)=0 |
Method indicating the serialization procedure for this object. | |
CkptObjectState | getState () |
| |
void | setState (CkptObjectState state) |
Set the management state of this object. | |
CkptContainer * | getContainer () |
void | setContainer (CkptContainer *container) |
Sets the container being used to manage this object. | |
virtual CkptObjectKey * | getKey () |
Return the key used to store/retrieve this object. | |
virtual void | setKey (CkptObjectKey *key) |
Set the key used to retrieve this object from its container. | |
virtual void | setKey (CkptObjectKey const &key) |
Set the key used to retrieve this object from its container. | |
virtual void | setKey (std::string s) |
Set the key used to retrieve this object from its container. | |
CkptRC | commit () |
Save any changes made to a managed object. | |
Private Attributes | |
CkptContainer * | _container |
the container managing this object | |
CkptObjectState | _state |
the management state of this object | |
CkptObjectKey * | _key |
pointer to the key associated with the object | |
unsigned long | _serialVersion |
version info for a given class |
Definition at line 22 of file CkptObject.h.
CkptObject::CkptObject | ( | ) | [inline] |
Definition at line 24 of file CkptObject.h.
References _container, _key, _state, and CKPT_OBJ_UNMANAGED.
virtual CkptObject::~CkptObject | ( | ) | [inline, virtual] |
virtual void CkptObject::serialize | ( | DAOInterface & | dao | ) | [pure virtual] |
CkptObjectState CkptObject::getState | ( | ) | [inline] |
Definition at line 52 of file CkptObject.h.
References _state.
Referenced by CkptContainer::commit().
void CkptObject::setState | ( | CkptObjectState | state | ) | [inline] |
Set the management state of this object.
Definition at line 56 of file CkptObject.h.
References _state.
Referenced by setContainer().
CkptContainer* CkptObject::getContainer | ( | ) | [inline] |
void CkptObject::setContainer | ( | CkptContainer * | container | ) | [inline] |
Sets the container being used to manage this object.
Definition at line 63 of file CkptObject.h.
References _container, CKPT_OBJ_MANAGED, CKPT_OBJ_UNMANAGED, and setState().
Referenced by CkptContainer::persist(), and CkptContainer::remove().
virtual CkptObjectKey* CkptObject::getKey | ( | ) | [inline, virtual] |
Return the key used to store/retrieve this object.
This method can be overriden if the implementor wishes to calculate the key on demand instead of holding a key within the object. In this case, the setKey() methods will hold little meaning, although the base framework will still call them when a get() is executed. Overriding this may also have ramifications on memory management policies.
Definition at line 78 of file CkptObject.h.
References _key.
Referenced by CkptContainer::persist(), and CkptContainer::remove().
virtual void CkptObject::setKey | ( | CkptObjectKey * | key | ) | [inline, virtual] |
Set the key used to retrieve this object from its container.
The CkptObject takes ownership of the key passed in and will handle its deallocation appropriately.
Definition at line 86 of file CkptObject.h.
References _key.
Referenced by setKey().
virtual void CkptObject::setKey | ( | CkptObjectKey const & | key | ) | [inline, virtual] |
Set the key used to retrieve this object from its container.
The CkptObject creates a heap-based copy of the key and takes ownership of it.
Definition at line 96 of file CkptObject.h.
References setKey().
virtual void CkptObject::setKey | ( | std::string | s | ) | [inline, virtual] |
Set the key used to retrieve this object from its container.
The string is used to create a heap-based key, owned by the object.
Definition at line 105 of file CkptObject.h.
References setKey().
CkptRC CkptObject::commit | ( | ) |
Save any changes made to a managed object.
Commit the data changes in the object by flushing the data into the CKPT service. This will propigate to all nodes in the cluster that have this checkpoint (aka CkptContainer) open. A simple CkptObject example
Definition at line 4 of file CkptObject.cc.
References _container, CkptFailure, and CkptContainer::commit().
CkptContainer* CkptObject::_container [private] |
the container managing this object
Definition at line 131 of file CkptObject.h.
Referenced by CkptObject(), commit(), getContainer(), and setContainer().
CkptObjectState CkptObject::_state [private] |
the management state of this object
Definition at line 132 of file CkptObject.h.
Referenced by CkptObject(), getState(), and setState().
CkptObjectKey* CkptObject::_key [private] |
pointer to the key associated with the object
Definition at line 133 of file CkptObject.h.
Referenced by CkptObject(), getKey(), setKey(), and ~CkptObject().
unsigned long CkptObject::_serialVersion [private] |