Storeable Class ReferenceClass that defines objects storeable in Archive using obiject ouytput streams and loadable from Archive using object input streams.
More...
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Classes | |
| class | StidLocker |
| Helper class for locking Storeable data when doing Archive operations. More... | |
Public Types | |
| enum | stState { NEW, CHANGED, DELETED, OK } |
| state of storeable object More... | |
Public Member Functions | |
| id | getId () const |
| get object id | |
| const char * | getRootTable () |
| get name of root table | |
| stState | getState () const |
| get object state | |
| bool | isChanged () const |
| Check if object is in CHANGED state. | |
| bool | isDeleted () const |
| Check if object is in DELETED state. | |
| bool | isNew () const |
| Check if object is in NEW state. | |
| bool | isOk () const |
| Check if object is in OK state. | |
| virtual void | lockStid (bool pPreserveState) |
| Lock id. | |
| Storeable & | operator= (const Storeable &pObj) |
| Assignent operator. | |
| void | setChanged () |
| set object state to CHANGED | |
| void | setDeleted () |
| set object state to DELETED | |
| void | setId (id pId) |
| assingn id by hand. | |
| template<typename T > | |
| bool | setMember (T &pMember, const T &pNevVal) |
| Generic optimal way to change member of persistant object. | |
| virtual void | setNew () |
| set object to NEW state, reset Id and mStoredTables | |
| void | setOk () |
| set object state to OK | |
| virtual void | setState (stState pState) |
| Set state of object. | |
| Storeable (const Storeable &pObj) | |
| Copy constructor. | |
| Storeable (id pId=InvalidId) | |
| Create new object with id. | |
| virtual void | unlockStid () |
| Unlock state and id of object for copy constructor and assigment operator. | |
| virtual | ~Storeable () |
| Destructor. | |
Static Public Attributes | |
| static const Storeable *const | dba_pointer_place |
| Internal pointer for computing offsets corrections in case of multiple inheritance. | |
| static const id | InvalidId |
| id of object that was now stored in database. | |
| static StoreTableList | sStoreTableList |
| Static list of created tables Responsible for freeing all memory allocated by BEGIN_STORE_TABLE macro. | |
Protected Types | |
| enum | lock_state { , LOCKED, LOCKED_PRESERVE_STATE } |
| state of lock on object data for assigment operator and copy constructor More... | |
Protected Member Functions | |
| int | countTables () |
| Get number. | |
| void | normalAssigment (const Storeable &pObj) |
| Variant of assigment operator. | |
| void | preserveIdAssigment (const Storeable &pObj) |
| Variant of assigment operator. | |
| virtual const ColTable * | st_getColTable () |
| Get collection table list for object. | |
| virtual const StoreTable * | st_getTable () |
| Get store table list for object. | |
Protected Attributes | |
| id | mId |
| id of object | |
| lock_state | mIdLocked |
| Lock state. | |
| int | mStoredTables |
| number of tables from first one that are already stored for object | |
| stState | mStoreState |
| Store state. | |
Detailed Description
Class that defines objects storeable in Archive using obiject ouytput streams and loadable from Archive using object input streams.Derived classes must provide default constructor and copy constructor.
Member Enumeration Documentation
enum lock_state [protected] |
| enum stState |
Constructor & Destructor Documentation
Create new object with id.
- Parameters:
-
pId id of object or InvalidId if unknown
Copy constructor.
Copies object state if no IdLocker is constructed.
- Parameters:
-
pObj object to copy from
Member Function Documentation
| id getId | ( | ) | const |
get object id
- Returns:
- object id
| const char* getRootTable | ( | ) |
get name of root table
- Returns:
- pointer to root table name or NULL if root table name is not set
| bool isChanged | ( | ) | const |
Check if object is in CHANGED state.
- Returns:
- true if object is in CHANGED state or false otherwise
| bool isDeleted | ( | ) | const |
Check if object is in DELETED state.
- Returns:
- true if object is in DELETED state or false otherwise
| bool isNew | ( | ) | const |
Check if object is in NEW state.
- Returns:
- true if object is in NEW state or false otherwise
| bool isOk | ( | ) | const |
Check if object is in OK state.
- Returns:
- true if object is in OK state or false otherwise
| virtual void lockStid | ( | bool | pPreserveState | ) | [virtual] |
Lock id.
Used by StidLocker to lock object id before assigment.
- Parameters:
-
pPreserveState if true then lock state but not id, otherwise lock both state and id
| void normalAssigment | ( | const Storeable & | pObj | ) | [protected] |
Variant of assigment operator.
Copies state.
- Parameters:
-
pObj object to copy from
Assignent operator.
Copies object state if no IdLocker is constructed.
- Parameters:
-
pObj object to copy from
| void preserveIdAssigment | ( | const Storeable & | pObj | ) | [protected] |
| void setChanged | ( | ) |
| void setDeleted | ( | ) |
| void setId | ( | id | pId | ) |
| bool setMember | ( | T & | pMember, | |
| const T & | pNewVal | |||
| ) |
Generic optimal way to change member of persistant object.
helper function to set member of Storeable derived object.
It changes state of object to CHANGED if new value is different from old value
- Parameters:
-
pMember member value pNewVal new value
- Returns:
- true if member was set or false otherwise
| void setOk | ( | ) |
| virtual void setState | ( | stState | pState | ) | [virtual] |
Set state of object.
- Parameters:
-
pState new object state. Result state after calling of this function is dependent of current object state (mState) and pState parameter.
| new state old state | OK | NEW | CHANGED | DELETED |
| OK | OK | CHANGED | CHANGED | DELETED |
| NEW | NEW | NEW | NEW | NEW |
| CHANGED | OK | CHANGED | CHANGED | DELETED |
| DELETED | OK | CHANGED | CHANGED | DELETED |
Member Data Documentation
id of object that was now stored in database.
If object has this id it means that id was never assigned
The documentation for this class was generated from the following file:
| Documentation |
|---|
| Quick start |
| Examples |
| API Documentation |
|---|
| Class hierarchy |
| Member index |
| API Reference |
| Store filters |
| Store table macros |
Generated by doxygen at Fri Oct 22 23:15:47 2010

