// 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_SharedMemory_HeaderFile #define _OSD_SharedMemory_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _Standard_Address_HeaderFile #include #endif #ifndef _TCollection_AsciiString_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; //! IPC Tools -Shared Memory
//! This is a low level interface for communications.
//! Using shared memory, processes can use a common area to
//! communicate.
//! You can create and delete a shared memory.
class OSD_SharedMemory { 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); } //! Allocates room for shared memory name.
//! This is to be used with 'Open'.
//! In this case, the process is a client of shared memory.
Standard_EXPORT OSD_SharedMemory(); //! Instantiates SharedMemory object with parameters.
//! A name to make sure shared memory is unique and a size in
//! bytes for the size of shared memory.
Standard_EXPORT OSD_SharedMemory(const TCollection_AsciiString& Name,const Standard_Integer size); //! Creates a shared memory in the system
//! This is for a server process.
Standard_EXPORT void Build() ; //! Opens a shared memory
//! Raises ConstructionError when the name contains characters
//! not in range of ' '...'~'.
//! Raises ProgramError when the size given is negative or null.
//! This is for a server process.
//!
Standard_EXPORT void Open(const TCollection_AsciiString& Name,const Standard_Integer size) ; //! Removes a shared memory access.
//! This is used only by a server process !
Standard_EXPORT void Delete() ; //! Returns address of shared memory.
//! Raises NullObject when the Shared Memory is not created.
Standard_EXPORT Standard_Address GiveAddress() const; //! 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; Standard_Address myAddress; TCollection_AsciiString myName; Standard_Integer mySize; OSD_Error myError; }; // other Inline functions and methods (like "C++: function call" methods) #endif