OCC Main Page | FoundationClasses | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FoundationClasses
TKernel
OSD


OSD_MailBox Class Reference

Establishes a mailbox with VMS-like-features and with
asynchronous functions.
The mail boxes are used to communicate asynchronously
between processes.
Basically MailBox facilities provide tools to communicate
between a client process and a server process.
The client process puts data/requests into the mail-box and
the server process gets these data/requests. In this context
client and server must run on the same machine.
Warning: On VMS, you need TMPMBX privilege.
.

#include <OSD_MailBox.hxx>


Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT OSD_MailBox ()
 To be used with 'Open'.
It just allocates room for 'myName'.
This is for a client process.
.
Standard_EXPORT OSD_MailBox (const TCollection_AsciiString &name, const Standard_Integer Size, const OSD_Function &Async_function)
 Instantiates MailBox object with a name, size required
and a function to read mail boxes asynchronously.
Each process working with the same MailBox must use
a common known access : the mail-box's name.
.
Standard_EXPORT void Build ()
 Builds (physically) <me> into system.
<me> is created and ready to run.
This can be seen as an asynchronous server.
.
Standard_EXPORT void Open (const TCollection_AsciiString &name, const Standard_Integer Size)
 Opens mail box, and is ready to communicate with an
already created mailbox.
Raises NullObject when the name is a null string.
Raises ConstructionError when the name contains characters not
in range of ' '...'~'.
Raises ProgramError when the mail box has a null size.
This can be seen as a client.
.
Standard_EXPORT void Delete ()
 Removes the mail box from system.
This is used only by server process !
Raises ProgramError when the mail box is already deleted.
.
Standard_EXPORT void Write (const TCollection_AsciiString &Message, const Standard_Integer Length)
 Writes a message of specified length into mail box.
<message> is used as a buffer, not as a common string.
So this can be not null terminated like a 'char *'.
This is why <length> is useful.
Raises ProgramError when the length of the data is either
negative or zero.

.
Standard_EXPORT Standard_Boolean Failed () const
 Returns TRUE if an error occurs
.
Standard_EXPORT void Reset ()
 Resets error counter to zero
.
Standard_EXPORT void Perror ()
 Raises OSD_Error
.
Standard_EXPORT Standard_Integer Error () const
 Returns error number if 'Failed' is TRUE.
.

Private Attributes

Standard_Integer myId
TCollection_AsciiString myName
Standard_Integer mySize
OSD_Function myFunc
OSD_Error myError


Constructor & Destructor Documentation

Standard_EXPORT OSD_MailBox::OSD_MailBox  ) 
 

Standard_EXPORT OSD_MailBox::OSD_MailBox const TCollection_AsciiString name,
const Standard_Integer  Size,
const OSD_Function Async_function
 


Member Function Documentation

Standard_EXPORT void OSD_MailBox::Build  ) 
 

Standard_EXPORT void OSD_MailBox::Delete  ) 
 

Standard_EXPORT Standard_Integer OSD_MailBox::Error  )  const
 

Standard_EXPORT Standard_Boolean OSD_MailBox::Failed  )  const
 

Standard_EXPORT void OSD_MailBox::Open const TCollection_AsciiString name,
const Standard_Integer  Size
 

void OSD_MailBox::operator delete void *  anAddress  )  [inline]
 

void* OSD_MailBox::operator new size_t  size  )  [inline]
 

void* OSD_MailBox::operator new size_t  ,
void *  anAddress
[inline]
 

Standard_EXPORT void OSD_MailBox::Perror  ) 
 

Standard_EXPORT void OSD_MailBox::Reset  ) 
 

Standard_EXPORT void OSD_MailBox::Write const TCollection_AsciiString Message,
const Standard_Integer  Length
 


Field Documentation

OSD_Error OSD_MailBox::myError [private]
 

OSD_Function OSD_MailBox::myFunc [private]
 

Standard_Integer OSD_MailBox::myId [private]
 

TCollection_AsciiString OSD_MailBox::myName [private]
 

Standard_Integer OSD_MailBox::mySize [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:13:08 2008 for OpenCASCADE by  doxygen 1.4.1