// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _OSD_MailBox_HeaderFile #define _OSD_MailBox_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _TCollection_AsciiString_HeaderFile #include #endif #ifndef _OSD_Function_HeaderFile #include #endif #ifndef _OSD_Error_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif class Standard_ConstructionError; class Standard_NullObject; class OSD_OSDError; class Standard_ProgramError; class TCollection_AsciiString; //! 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.
class OSD_MailBox { public: void* operator new(size_t,void* anAddress) { return anAddress; } void* operator new(size_t size) { return Standard::Allocate(size); } void operator delete(void *anAddress) { if (anAddress) Standard::Free((Standard_Address&)anAddress); } //! To be used with 'Open'.
//! It just allocates room for 'myName'.
//! This is for a client process.
Standard_EXPORT OSD_MailBox(); //! 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 OSD_MailBox(const TCollection_AsciiString& name,const Standard_Integer Size,const OSD_Function& Async_function); //! Builds (physically) into system.
//! is created and ready to run.
//! This can be seen as an asynchronous server.
Standard_EXPORT void Build() ; //! 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 Open(const TCollection_AsciiString& name,const Standard_Integer Size) ; //! 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 Delete() ; //! Writes a message of specified length into mail box.
//! is used as a buffer, not as a common string.
//! So this can be not null terminated like a 'char *'.
//! This is why is useful.
//! Raises ProgramError when the length of the data is either
//! negative or zero.
//!
Standard_EXPORT void Write(const TCollection_AsciiString& Message,const Standard_Integer Length) ; //! Returns TRUE if an error occurs
Standard_EXPORT Standard_Boolean Failed() const; //! Resets error counter to zero
Standard_EXPORT void Reset() ; //! Raises OSD_Error
Standard_EXPORT void Perror() ; //! Returns error number if 'Failed' is TRUE.
Standard_EXPORT Standard_Integer Error() const; protected: private: Standard_Integer myId; TCollection_AsciiString myName; Standard_Integer mySize; OSD_Function myFunc; OSD_Error myError; }; // other Inline functions and methods (like "C++: function call" methods) #endif