#include <Storable_Naming_Context.h>
Collaboration diagram for TAO_Storable_Naming_Context::File_Open_Lock_and_Check:
Public Member Functions | |
File_Open_Lock_and_Check (TAO_Storable_Naming_Context *context, const char *mode ACE_ENV_ARG_DECL) | |
Constructor - we always need the object which we guard. | |
~File_Open_Lock_and_Check (void) | |
Destructor. | |
void | release (void) |
Releases the lock, closes the file, and deletes the I/O stream. | |
TAO_Storable_Base & | peer (void) |
Returns the stream to read/write on. | |
Private Types | |
enum | { mode_write = 1, mode_read = 2, mode_create = 4 } |
Symbolic values for the flags in the above. More... | |
Private Member Functions | |
File_Open_Lock_and_Check (void) | |
Default constructor. | |
Private Attributes | |
int | closed_ |
A flag to keep us from trying to close things more than once. | |
TAO_Storable_Naming_Context * | context_ |
We need to save the pointer to our parent for cleaning up. | |
TAO_Storable_Base * | fl_ |
The pointer to the actual file I/O (bridge pattern). | |
int | rwflags_ |
The flags that we were opened with. |
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"); ACE_CHECK;
|
Symbolic values for the flags in the above.
|
|
Constructor - we always need the object which we guard.
|
|
Destructor.
|
|
Default constructor.
|
|
Returns the stream to read/write on.
|
|
Releases the lock, closes the file, and deletes the I/O stream.
|
|
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).
|
|
The flags that we were opened with.
|