00001
#if !defined(__MEMORY_HPP)
00002
#define __MEMORY_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#if !defined(__COMMON_HPP)
00025
#include <Common.hpp>
00026
#endif
00027
00028
#if !defined(__SYNCHRONIZED_HPP)
00029
#include <Synchronized.hpp>
00030
#endif
00031
00032
#if !defined(__SINGLETON_HPP)
00033
#include <Singleton.hpp>
00034
#endif
00035
00036
#if !defined(__STORAGEEXCEPTION_HPP)
00037
#include <StorageException.hpp>
00038
#endif
00039
00040
#if !defined(__MEMORYSTORAGE_HPP)
00041
#include <MemoryStorage.hpp>
00042
#endif
00043
00044
#if !defined(__MAP_HPP)
00045
#include <Map.hpp>
00046
#endif
00047
00048
00049
00050
namespace corelinux
00051 {
00052
00053 CORELINUX_MAP
00054 (
00055 MemoryStoragePtr, CharCptr, std::less<MemoryStoragePtr>, MemoryMap
00056 );
00057
00058
00059 DECLARE_CLASS( Memory );
00060
00062
00063 DECLARE_TYPE(
Singleton<Memory>,
MemoryManager );
00064
00100 class Memory :
public Synchronized
00101 {
00102
00103
public:
00104
00105
00106
00107
00108
00110
00111
Memory(
void )
throw(
Assertion );
00112
00114
00115
virtual ~Memory(
void );
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00142
static MemoryStoragePtr
createStorage
00143 (
00144 Size aByteSize,
00145 Int Rights =
OWNER_ALL
00146 )
throw(
StorageException );
00147
00158
static MemoryStoragePtr
createStorage
00159 (
00160
MemoryIdentifierCref aIdentifier,
00161 Size aByteSize,
00162
CreateDisposition disp =
CREATE_OR_REUSE,
00163 Int Rights =
OWNER_ALL,
00164
AddressingConstraint addressing =
READ_WRITE
00165 );
00166
00177
static MemoryStoragePtr
createStorage
00178 (
00179 CharCptr aName,
00180 Size aByteSize,
00181
CreateDisposition disp =
CREATE_OR_REUSE,
00182 Int Rights =
OWNER_ALL ,
00183
AddressingConstraint addressing =
READ_WRITE
00184 );
00185
00191
static void destroyStorage( MemoryStoragePtr );
00192
00193
protected:
00195
00196
Memory(
MemoryCref )
throw(
Assertion );
00197
00199
00200
MemoryRef operator=(
MemoryCref )
throw(
Assertion );
00201
00203
00204
bool operator==(
MemoryCref )
const;
00205
00206
protected:
00208
00209
static MemoryManager theMemoryManager;
00210
00211
private:
00212
00213
static MemoryMap theMemoryStorageMap;
00214 };
00215 }
00216
00217
#endif // if !defined(__MEMORY_HPP)
00218
00219
00220
00221
00222
00223
00224
00225
00226