Base class to use with TAO_Storable_Base to synch object state with a storable base.
More...
#include <Storable_File_Guard.h>
Base class to use with TAO_Storable_Base to synch object state with a storable base.
A guard for Storable_Base that opens a file for read/write and sets a lock on it. It then checks if the file has changed and re-reads it if it has.
Symbolic values for the flags in the above.
Enumerator |
---|
mode_write |
|
mode_read |
|
mode_create |
|
enum TAO::Storable_File_Guard::Method_Type |
Indicate how the state of the object is being used. This is used for determine the mode for accessing the persistent store.
Enumerator |
---|
CREATE_WITH_FILE |
Construction with persistent file already existing.
|
CREATE_WITHOUT_FILE |
Construction with persistent file not existing.
|
ACCESSOR |
Getting object state.
|
MUTATOR |
Setting object state.
|
TAO::Storable_File_Guard::~Storable_File_Guard |
( |
| ) |
|
|
virtual |
virtual Storable_Base* TAO::Storable_File_Guard::create_stream |
( |
const char * |
mode | ) |
|
|
protectedpure virtual |
virtual time_t TAO::Storable_File_Guard::get_object_last_changed |
( |
| ) |
|
|
pure virtual |
Return when the object in memory has last changed.
void TAO::Storable_File_Guard::init |
( |
Method_Type |
method_type | ) |
|
|
protected |
Should be called by constructors of derived classes since can't call the virtual functions below in constructor of this class.
void TAO::Storable_File_Guard::init_no_load |
( |
Method_Type |
method_type | ) |
|
|
protected |
Initializes the backing store file object but does not actually load the data. This can be called without locks, allowing the caller to decide whether or not to then lock and complete the load.
virtual bool TAO::Storable_File_Guard::is_loaded_from_stream |
( |
| ) |
|
|
protectedpure virtual |
Answer if object has been loaded from file.
int TAO::Storable_File_Guard::load |
( |
| ) |
|
|
private |
virtual int TAO::Storable_File_Guard::load_from_stream |
( |
| ) |
|
|
protectedpure virtual |
Load object from file to memory. Return 0 on success.
void TAO::Storable_File_Guard::mark_object_current |
( |
void |
| ) |
|
|
protectedvirtual |
Mark the object as up to date.
bool TAO::Storable_File_Guard::object_obsolete |
( |
void |
| ) |
|
|
protectedvirtual |
Check if the object is current with the last update.
Get the underlying stream being used.
void TAO::Storable_File_Guard::release |
( |
void |
| ) |
|
Releases the lock, closes the file, and deletes the I/O stream. Destructors of derived classes should call this this will virtual functions are available.
void TAO::Storable_File_Guard::reload |
( |
void |
| ) |
|
|
protected |
Complete the initialization of the containing object, should be called with lock held after calling init_no_load
virtual void TAO::Storable_File_Guard::set_object_last_changed |
( |
const time_t & |
time | ) |
|
|
protectedpure virtual |
Indicate when the object in memory has last changed.
int TAO::Storable_File_Guard::closed_ |
|
private |
A flag to keep us from trying to close things more than once.
The pointer to the actual file I/O (bridge pattern)
bool TAO::Storable_File_Guard::redundant_ |
|
private |
int TAO::Storable_File_Guard::rwflags_ |
|
private |
The flags that we were opened with.
bool TAO::Storable_File_Guard::use_backup_ |
|
private |
A flag indicating if backup/restore should be performed.
The documentation for this class was generated from the following files: