The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CSharedMemory Class Reference
[Interprocess CommunicationWin32 Kernel Objects]

Collaboration diagram for CSharedMemory:

List of all members.


Detailed Description

A wrapper around the File Mapping, memory management, API which makes shared memory easier to use. Note that this class creates shared memory and if you pass in a name that's in the Global namespace then the caller needs to have the SeCreateGlobalPrivilege on their account for the code to work without an access denied exception from the constructor.

Public Types

enum  PageProtection { ReadOnly, ReadWrite }
enum  CreationSemantics { CreateFailsIfExists, CreateFailsIfExistsAndDifferentSize }

Public Member Functions

 CSharedMemory (const IKernelObjectName &name, DWORD size, PageProtection protection, CreationSemantics creation=CreateFailsIfExists, SECURITY_ATTRIBUTES *pSecurityAttributes=nullptr)
 Creates a new named shared memory segment of the specified size.
 CSharedMemory (const IKernelObjectName &name, PageProtection protection)
 Opens an existing named shared memory segment.
 CSharedMemory (const CSharedMemory &rhs)
 ~CSharedMemory ()
CSharedMemoryoperator= (const CSharedMemory &rhs)
void const * GetMemory () const
 Access the memory.
void * GetMemory ()
 Access the memory.
DWORD GetSize () const
 Get the size of the memory segment.

Member Enumeration Documentation

Enumerator:
ReadOnly 
ReadWrite 

Enumerator:
CreateFailsIfExists 
CreateFailsIfExistsAndDifferentSize 


Constructor & Destructor Documentation

CSharedMemory ( const IKernelObjectName name,
DWORD  size,
PageProtection  protection,
CreationSemantics  creation = CreateFailsIfExists,
SECURITY_ATTRIBUTES pSecurityAttributes = nullptr 
)

Creates a new named shared memory segment of the specified size.

CSharedMemory ( const IKernelObjectName name,
PageProtection  protection 
)

Opens an existing named shared memory segment.

CSharedMemory ( const CSharedMemory rhs  ) 

~CSharedMemory (  ) 


Member Function Documentation

CSharedMemory& operator= ( const CSharedMemory rhs  ) 

void const * GetMemory (  )  const

Access the memory.

void * GetMemory (  ) 

Access the memory.

DWORD GetSize (  )  const

Get the size of the memory segment.


Generated on Sun Sep 12 19:11:47 2021 for The Server Framework - v7.4 by doxygen 1.5.3