# FoundationClasses
TKernel
OSD

# OSD_SharedMemory Class Reference

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.
.

`#include <OSD_SharedMemory.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_SharedMemory ()
| 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 (const TCollection_AsciiString &Name, const Standard_Integer size)
| 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 void | Build ()
| Creates a shared memory in the system This is for a server process. .
Standard_EXPORT void | Open (const TCollection_AsciiString &Name, const Standard_Integer size)
| 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 | Delete ()
| Removes a shared memory access. This is used only by a server process ! .
Standard_EXPORT Standard_Address | GiveAddress () const
| Returns address of shared memory. Raises NullObject when the Shared Memory is not created. .
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
Standard_Address | myAddress
TCollection_AsciiString | myName
Standard_Integer | mySize
OSD_Error | myError

## Constructor & Destructor Documentation

Standard_EXPORT OSD_SharedMemory::OSD_SharedMemory | ( |  | ) |

Standard_EXPORT OSD_SharedMemory::OSD_SharedMemory | ( | const TCollection_AsciiString & | Name,
|  | const Standard_Integer | size
| ) |

## Member Function Documentation

Standard_EXPORT void OSD_SharedMemory::Build | ( |  | ) |

Standard_EXPORT void OSD_SharedMemory::Delete | ( |  | ) |

Standard_EXPORT Standard_Integer OSD_SharedMemory::Error | ( |  | ) | const

Standard_EXPORT Standard_Boolean OSD_SharedMemory::Failed | ( |  | ) | const

Standard_EXPORT Standard_Address OSD_SharedMemory::GiveAddress | ( |  | ) | const

Standard_EXPORT void OSD_SharedMemory::Open | ( | const TCollection_AsciiString & | Name,
|  | const Standard_Integer | size
| ) |

void OSD_SharedMemory::operator delete | ( | void * | anAddress | ) | `[inline]`

void* OSD_SharedMemory::operator new | ( | size_t | size | ) | `[inline]`

void* OSD_SharedMemory::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

Standard_EXPORT void OSD_SharedMemory::Perror | ( |  | ) |

Standard_EXPORT void OSD_SharedMemory::Reset | ( |  | ) |

## Field Documentation

Standard_Address OSD_SharedMemory::myAddress `[private]`

OSD_Error OSD_SharedMemory::myError `[private]`

Standard_Integer OSD_SharedMemory::myId `[private]`

TCollection_AsciiString OSD_SharedMemory::myName `[private]`

Standard_Integer OSD_SharedMemory::mySize `[private]`

The documentation for this class was generated from the following file:

- OSD_SharedMemory.hxx