Savable Class Reference

An interface to for SavableManager wrappers. More...

#include <Savable.h>

Inheritance diagram for Savable:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Savable (void)
 Construct a new Savable.
virtual ~Savable (void)
 Destructor, a noop.
virtual void Delete ()=0
 Delete this savable.
virtual void Save ()=0
 Save this savable.
virtual void Delete (value_type accountid, const std::string &description)
 Delete this savable providing details as to who deleted it and why.
virtual void Save (value_type accountid, const std::string &description)
 Save this savable providing details as to who deleted it and why.
virtual void Discard ()=0
 Discard changes made to this savable.
virtual bool Exists ()=0
 Wether this savable has been saved yet.
void Lock ()
 Locks the manager if no lock was aquired yet.
void Unlock ()
 Unlocks the savable if we previously aquired a lock.
virtual std::vector
< std::string > 
toStrings ()
 Returns an elaborate string representation of the savable, getManager() is asserted not to return NULL.
virtual std::string toString ()
 Returns a one-line string representation of the savable, getManager() is asserted not to return NULL.
virtual TableImplPtr getTable () const =0
 Returns the table this savable belongs to.

Protected Member Functions

virtual SavableManagerPtr getManager () const =0
 Returns the SavableManager this savable usesotherwise.

Protected Attributes

bool m_haslock
 Whether we have a lock on our savable.


Detailed Description

An interface to for SavableManager wrappers.

This interface is meant to wrap a SavableManager. It provides basic functionality to allow general interaction with SavableManagers.

See also:
SavableManager

Definition at line 39 of file Savable.h.


Constructor & Destructor Documentation

Savable::Savable ( void   ) 

Construct a new Savable.

virtual Savable::~Savable ( void   )  [virtual]

Destructor, a noop.


Member Function Documentation

virtual void Savable::Delete (  )  [pure virtual]

Delete this savable.

Implemented in mud::Account, mud::Area, mud::Channel, mud::Character, mud::Chunk, mud::Cluster, mud::Colour, mud::Command, mud::Detail, mud::Echo, mud::Exit, mud::GrantGroup, mud::Permission, mud::Race, mud::Room, mud::Sector, and mud::Trace.

virtual void Savable::Save (  )  [pure virtual]

Save this savable.

Implemented in mud::PCharacter, mud::Account, mud::Area, mud::Channel, mud::Character, mud::Chunk, mud::Cluster, mud::Colour, mud::Command, mud::Detail, mud::Echo, mud::Exit, mud::GrantGroup, mud::Permission, mud::Race, mud::Room, mud::Sector, and mud::Trace.

virtual void Savable::Delete ( value_type  accountid,
const std::string &  description 
) [virtual]

Delete this savable providing details as to who deleted it and why.

Reimplemented in mud::Detail, and mud::Room.

virtual void Savable::Save ( value_type  accountid,
const std::string &  description 
) [virtual]

Save this savable providing details as to who deleted it and why.

Reimplemented in mud::Detail, and mud::Room.

virtual void Savable::Discard (  )  [pure virtual]

Discard changes made to this savable.

Implemented in mud::Account, mud::Area, mud::Channel, mud::Character, mud::Chunk, mud::Cluster, mud::Colour, mud::Command, mud::Detail, mud::Echo, mud::Exit, mud::GrantGroup, mud::Permission, mud::Race, mud::Room, mud::Sector, and mud::Trace.

virtual bool Savable::Exists (  )  [pure virtual]

Wether this savable has been saved yet.

Implemented in mud::Account, mud::Area, mud::Channel, mud::Character, mud::Chunk, mud::Cluster, mud::Colour, mud::Command, mud::Detail, mud::Echo, mud::Exit, mud::GrantGroup, mud::Permission, mud::Race, mud::Room, mud::Sector, and mud::Trace.

void Savable::Lock (  ) 

Locks the manager if no lock was aquired yet.

getManager() is asserted not to return NULL. If no lock could be aquired throws SavableLocked. When called succesfully (that is, without throwing) a lock is aquired. If a lock is aquired, Unlock should be called before the savable is destroyed.

See also:
getManager

SavableLocked

Unlock

void Savable::Unlock (  ) 

Unlocks the savable if we previously aquired a lock.

virtual std::vector<std::string> Savable::toStrings (  )  [virtual]

Returns an elaborate string representation of the savable, getManager() is asserted not to return NULL.

virtual std::string Savable::toString (  )  [virtual]

Returns a one-line string representation of the savable, getManager() is asserted not to return NULL.

virtual TableImplPtr Savable::getTable (  )  const [pure virtual]

Returns the table this savable belongs to.

Implemented in mud::Account, mud::Area, mud::Channel, mud::Character, mud::Chunk, mud::Cluster, mud::Colour, mud::Command, mud::Detail, mud::Echo, mud::Exit, mud::GrantGroup, mud::Permission, mud::Race, mud::Room, mud::Sector, and mud::Trace.

virtual SavableManagerPtr Savable::getManager (  )  const [protected, pure virtual]

Returns the SavableManager this savable usesotherwise.

Implemented in mud::Account, mud::Area, mud::Channel, mud::Character, mud::Chunk, mud::Cluster, mud::Colour, mud::Command, mud::Detail, mud::Echo, mud::Exit, mud::GrantGroup, mud::Permission, mud::Race, mud::Room, mud::Sector, and mud::Trace.


Member Data Documentation

bool Savable::m_haslock [protected]

Whether we have a lock on our savable.

Definition at line 95 of file Savable.h.


Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo