Memory.hpp
#if !defined(__MEMORY_HPP)
#define __MEMORY_HPP
/*
CoreLinux++
Copyright (C) 1999,2000 CoreLinux Consortium
The CoreLinux++ Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The CoreLinux++ Library Library is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if !defined(__COMMON_HPP)
#include <Common.hpp>
#endif
#if !defined(__SYNCHRONIZED_HPP)
#include <Synchronized.hpp>
#endif
#if !defined(__SINGLETON_HPP)
#include <Singleton.hpp>
#endif
#if !defined(__STORAGEEXCEPTION_HPP)
#include <StorageException.hpp>
#endif
#if !defined(__MEMORYSTORAGE_HPP)
#include <MemoryStorage.hpp>
#endif
#if !defined(__MAP_HPP)
#include <Map.hpp>
#endif
namespace corelinux
{
CORELINUX_MAP
(
MemoryStoragePtr, CharCptr, std::less<MemoryStoragePtr>, MemoryMap
);
DECLARE_CLASS( Memory );
DECLARE_TYPE( Singleton<Memory>, MemoryManager );
class Memory : public Synchronized
{
public:
//
// Constructors and destructor
//
Memory( void ) throw( Assertion );
virtual ~Memory( void );
//
// Operator overloads
//
//
// Accessors
//
//
// Mutators
//
//
// Factory Methods
//
static MemoryStoragePtr createStorage
(
Size aByteSize,
Int Rights = OWNER_ALL
) throw( StorageException );
static MemoryStoragePtr createStorage
(
MemoryIdentifierCref aIdentifier,
Size aByteSize,
CreateDisposition disp = CREATE_OR_REUSE,
Int Rights = OWNER_ALL,
AddressingConstraint addressing = READ_WRITE
);
static MemoryStoragePtr createStorage
(
CharCptr aName,
Size aByteSize,
CreateDisposition disp = CREATE_OR_REUSE,
Int Rights = OWNER_ALL ,
AddressingConstraint addressing = READ_WRITE
);
static void destroyStorage( MemoryStoragePtr );
protected:
Memory( MemoryCref ) throw( Assertion );
MemoryRef operator=( MemoryCref ) throw( Assertion );
bool operator==( MemoryCref ) const;
protected:
static MemoryManager theMemoryManager;
private:
static MemoryMap theMemoryStorageMap;
};
}
#endif // if !defined(__MEMORY_HPP)
/*
Common rcs information do not modify
$Author: prudhomm $
$Revision: 1.5 $
$Date: 2000/08/31 22:52:20 $
$Locker: $
*/
corelinux::Memory::destroyStorage
static void destroyStorage(MemoryStoragePtr)
Destroy a previously allocated storage block.
Definition: Memory.cpp:446
corelinux::Memory::theMemoryManager
static MemoryManager theMemoryManager
The singleton instance of Memory for synchronization.
Definition: Memory.hpp:209
corelinux::Memory::Memory
Memory(void)
Default constructor.
Definition: Memory.cpp:64
corelinux::Singleton
Ensure a class only has one instance, and provide a global point of access to it. ...
Definition: Singleton.hpp:38
corelinux::CreateDisposition
CreateDisposition
Creation dispositions for various system utilities.
Definition: AccessRights.hpp:63
corelinux::ScalarIdentifier
ScalarIdentifier provides a templated interface for declaring CoreLinux Identifiers for simple scalar...
Definition: ScalarIdentifiers.hpp:37
corelinux::StorageException
StorageException is the base exception type for Storage.
Definition: StorageException.hpp:39
corelinux::OWNER_ALL
Owner has read/write access.
Definition: AccessRights.hpp:43
corelinux::AddressingConstraint
AddressingConstraint
Addressings constraints.
Definition: AccessRights.hpp:82
corelinux::Memory::operator==
bool operator==(MemoryCref) const
Equality always returns false.
Definition: Memory.cpp:154
corelinux::Memory::createStorage
static MemoryStoragePtr createStorage(Size aByteSize, Int Rights=OWNER_ALL)
Default create method, creates a private block of read write shared memory of size aByteSize...
Definition: Memory.cpp:162
corelinux::READ_WRITE
read write access (no constraints)
Definition: AccessRights.hpp:86
corelinux::Assertion
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
corelinux::Synchronized
Synchronized is a mixin which allows class objects to enable monitor functionality.
Definition: Synchronized.hpp:41
corelinux::CREATE_OR_REUSE
Will create or open.
Definition: AccessRights.hpp:67
corelinux::Memory
Memory is high speed transient storage managed by the operating system, for both itself and user proc...
Definition: Memory.hpp:100
corelinux::Memory::operator=
MemoryRef operator=(MemoryCref)
Assignment operator prohibited.
Definition: Memory.cpp:146
corelinux::Memory::~Memory
virtual ~Memory(void)
Virtual Destructor.
Definition: Memory.cpp:91

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