CoreLinux++  0.4.32
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
corelinux::Memory Class Reference

Memory is high speed transient storage managed by the operating system, for both itself and user processes, used to store data and programs. More...

#include <Memory.hpp>

Public Member Functions

 Memory (void) throw ( Assertion )
 Default constructor.
 
virtual ~Memory (void)
 Virtual Destructor.
 
- Public Member Functions inherited from corelinux::Synchronized
 Synchronized (void)
 Default constructor.
 
 Synchronized (SynchronizedCref)
 Copy constructor.
 
virtual ~Synchronized (void)
 Virtual Destructor.
 
SynchronizedRef operator= (SynchronizedCref)
 Assignment operator.
 
bool operator== (SynchronizedCref) const
 Equality operator.
 

Static Public Member Functions

static MemoryStoragePtr createStorage (Size aByteSize, Int Rights=OWNER_ALL) throw ( StorageException )
 Default create method, creates a private block of read write shared memory of size aByteSize, sharing attributes default to owner. More...
 
static MemoryStoragePtr createStorage (MemoryIdentifierCref aIdentifier, Size aByteSize, CreateDisposition disp=CREATE_OR_REUSE, Int Rights=OWNER_ALL, AddressingConstraint addressing=READ_WRITE)
 Create method, creates or opens a specifically identified block of shared memory of size aByteSize, sharing attributes default to owner. More...
 
static MemoryStoragePtr createStorage (CharCptr aName, Size aByteSize, CreateDisposition disp=CREATE_OR_REUSE, Int Rights=OWNER_ALL, AddressingConstraint addressing=READ_WRITE)
 Create method, creates or opens a specifically identified block of shared memory of size aByteSize, sharing attributes default to owner. More...
 
static void destroyStorage (MemoryStoragePtr)
 Destroy a previously allocated storage block. More...
 

Protected Member Functions

 Memory (MemoryCref) throw ( Assertion )
 Copy constructor prohibited.
 
MemoryRef operator= (MemoryCref) throw ( Assertion )
 Assignment operator prohibited.
 
bool operator== (MemoryCref) const
 Equality always returns false.
 
- Protected Member Functions inherited from corelinux::Synchronized
Guard access (void) const throw (SemaphoreException)
 Access returns a instance of Guard which is block scoped to the caller. More...
 

Static Protected Attributes

static MemoryManager theMemoryManager
 The singleton instance of Memory for synchronization.
 

Additional Inherited Members

- Protected Types inherited from corelinux::Synchronized
typedef GuardGuardPtr
 
typedef const GuardGuardCptr
 
typedef GuardGuardRef
 
typedef const GuardGuardCref
 

Detailed Description

Memory is high speed transient storage managed by the operating system, for both itself and user processes, used to store data and programs.

Upon allocation request, the operating system provides user processes with a memory storage region that is in addition to the current memory resources (stack, program, data) of the process. The memory can be made visible to all processes in the system, a select few, or just to the process that requested the storage. If made visible to other processes, memory provides a fast and efficient way to transfer information between the processes, and in this manner can be catagorized as high speed interprocess communication. It is up to the processes that share this memory area to agree on a synchronization protocol. The operating system allows a process to "mark" a memory region attribute as:

Member Function Documentation

MemoryStoragePtr corelinux::Memory::createStorage ( Size  aByteSize,
Int  Rights = OWNER_ALL 
)
throw (StorageException
)
static

Default create method, creates a private block of read write shared memory of size aByteSize, sharing attributes default to owner.

Parameters
Sizenumber of bytes to allocate
Intrights specificed
Returns
MemoryStorage pointer

References corelinux::FAIL_IF_EXISTS, corelinux::ScalarIdentifier< ScalarType >::getScalar(), corelinux::Singleton< TypeImpl >::instance(), corelinux::Environment::setupCommonAccess(), and theMemoryManager.

Referenced by createStorage(), and corelinux::SemaphoreCommon::SemaphoreCommon().

MemoryStoragePtr corelinux::Memory::createStorage ( MemoryIdentifierCref  aIdentifier,
Size  aByteSize,
CreateDisposition  disp = CREATE_OR_REUSE,
Int  Rights = OWNER_ALL,
AddressingConstraint  addressing = READ_WRITE 
)
static

Create method, creates or opens a specifically identified block of shared memory of size aByteSize, sharing attributes default to owner.

Parameters
MemoryIdentifierreference to identifier.
Sizenumber of bytes to allocate
Intrights specificed
Returns
MemoryStorage pointer

References corelinux::CREATE_OR_REUSE, createStorage(), corelinux::FAIL_IF_EXISTS, corelinux::ScalarIdentifier< ScalarType >::getScalar(), corelinux::Singleton< TypeImpl >::instance(), and theMemoryManager.

MemoryStoragePtr corelinux::Memory::createStorage ( CharCptr  aName,
Size  aByteSize,
CreateDisposition  disp = CREATE_OR_REUSE,
Int  Rights = OWNER_ALL,
AddressingConstraint  addressing = READ_WRITE 
)
static

Create method, creates or opens a specifically identified block of shared memory of size aByteSize, sharing attributes default to owner.

Parameters
stringname of shared memory storage.
Sizenumber of bytes to allocate
Intrights specificed
Returns
MemoryStorage pointer

References corelinux::CREATE_OR_REUSE, corelinux::FAIL_IF_EXISTS, corelinux::ScalarIdentifier< ScalarType >::getScalar(), corelinux::Singleton< TypeImpl >::instance(), corelinux::Environment::setupCommonAccess(), and theMemoryManager.

void corelinux::Memory::destroyStorage ( MemoryStoragePtr  aMPtr)
static

Destroy a previously allocated storage block.

Parameters
MemoryStoragepointer to storage object

References corelinux::ScalarIdentifier< ScalarType >::getScalar(), and corelinux::Environment::removeCommonAccess().

Referenced by corelinux::SemaphoreCommon::~SemaphoreCommon().


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

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium