Helper class for the TAO_Storable_Naming_Context.
More...
#include <Storable_Naming_Context.h>
Helper class for the TAO_Storable_Naming_Context.
Guard class for the TAO_Storable_Naming_Context. It 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.
The destructor insures that the lock gets released.
How to use this class:
File_Open_Lock_and_Check flck(this, name_len > 1 ? "r" : "rw");
Symbolic values for the flags in the above.
- Enumerator:
mode_write |
|
mode_read |
|
mode_create |
|
TAO_Storable_Naming_Context::File_Open_Lock_and_Check::File_Open_Lock_and_Check |
( |
TAO_Storable_Naming_Context * |
context, |
|
|
const char * |
mode |
|
) |
| |
Constructor - we always need the object which we guard.
TAO_Storable_Naming_Context::File_Open_Lock_and_Check::~File_Open_Lock_and_Check |
( |
void |
| ) |
|
TAO_Storable_Naming_Context::File_Open_Lock_and_Check::File_Open_Lock_and_Check |
( |
void |
| ) |
|
|
private |
TAO_Storable_Base & TAO_Storable_Naming_Context::File_Open_Lock_and_Check::peer |
( |
void |
| ) |
|
Returns the stream to read/write on.
void TAO_Storable_Naming_Context::File_Open_Lock_and_Check::release |
( |
void |
| ) |
|
Releases the lock, closes the file, and deletes the I/O stream.
int TAO_Storable_Naming_Context::File_Open_Lock_and_Check::closed_ |
|
private |
A flag to keep us from trying to close things more than once.
We need to save the pointer to our parent for cleaning up.
The pointer to the actual file I/O (bridge pattern)
int TAO_Storable_Naming_Context::File_Open_Lock_and_Check::rwflags_ |
|
private |
The flags that we were opened with.
The documentation for this class was generated from the following files: