1 #ifndef SHARED_MEMORY_CLASS
2 #define SHARED_MEMORY_CLASS
48 bool valid()
const {
return _valid; }
52 int size()
const {
return _size; }
87 #elif defined(__WIN32__)
Implements storage for memory that can be shared between threads.
const basis::astring & identity() const
provides a peek at the name that this chunk was constructed with.
bool valid() const
this must be true for the shared_memory to be usable.
shared_memory(int size, const char *identity)
a shared chunk of the "size" specified will be created.
int size() const
returns the size of the shared chunk of memory.
static basis::astring unique_shared_mem_identifier(int sequencer)
returns a unique identifier for a shared memory chunk.
DEFINE_CLASS_NAME("shared_memory")
void unlock(basis::abyte *&to_unlock)
returns control of the shared memory so others can access it.
basis::abyte * lock()
locks the shared memory and returns a pointer to the storage.
bool first_usage(basis::abyte *locked_memory, int max_compare)
returns true if the "locked_memory" was just created.
virtual ~shared_memory()
cleans up the shared bit of memory as far as we're concerned.
Provides a dynamically resizable ASCII character string.
An inter-process synchronization primitive.
Implements an application lock to ensure only one is running at once.
unsigned char abyte
A fairly important unit which is seldom defined...