uLib  User mode C/C++ extended API library for Win32 programmers.
SharedMem Class Reference

Interprocess shared memory. More...

#include <uLib/MemFunc.h>

Detailed Description

Interprocess shared memory.

The SharedMem class simplifies sharing memory between processes.

It encapsulates a mapped view of a "memory file" (CreateFileMapping( -1, ... ).
DWORD Size() is determined by VirtualQuery() (an undocumented technique).
bool Flush() is provided in case the OS backs the memory by lazy-write file.

Definition at line 204 of file MemFunc.h.

Public Data

PVOID const & pData
 Const pointer to variable data. More...
 

Public Functions

 operator PVOID ()
 
 operator TSTR ()
 
 SharedMem (size_t Size, CSTR Name)
 
 SharedMem (CSTR Name)
 
 ~SharedMem ()
 
size_t Size ()
 
bool Flush (PVOID Addr, size_t Range)
 

Constructor & Destructor Documentation

◆ SharedMem() [1/2]

SharedMem::SharedMem ( size_t  Size,
CSTR  Name 
)

Primary c'tor; Creator.

Definition at line 254 of file MemFunc.cpp.

◆ SharedMem() [2/2]

SharedMem::SharedMem ( CSTR  Name)

Secondary c'tor; Open existing mapping.

Definition at line 262 of file MemFunc.cpp.

◆ ~SharedMem()

SharedMem::~SharedMem ( )

Definition at line 268 of file MemFunc.cpp.

Member Function Documentation

◆ operator PVOID()

SharedMem::operator PVOID ( )
inline

Definition at line 208 of file MemFunc.h.

◆ operator TSTR()

SharedMem::operator TSTR ( )
inline

Transmutable string ptr. Build specific.

Definition at line 209 of file MemFunc.h.

◆ Size()

size_t SharedMem::Size ( )

Definition at line 274 of file MemFunc.cpp.

◆ Flush()

bool SharedMem::Flush ( PVOID  Addr,
size_t  Range 
)

Definition at line 289 of file MemFunc.cpp.

Member Data Documentation

◆ pData

PVOID const& SharedMem::pData

Const pointer to variable data.

Definition at line 206 of file MemFunc.h.


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