Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

Memory.hpp

00001 #if !defined(__MEMORY_HPP) 00002 #define __MEMORY_HPP 00003 00004 /* 00005 CoreLinux++ 00006 Copyright (C) 1999,2000 CoreLinux Consortium 00007 00008 The CoreLinux++ Library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Library General Public License as 00010 published by the Free Software Foundation; either version 2 of the 00011 License, or (at your option) any later version. 00012 00013 The CoreLinux++ Library Library is distributed in the hope that it will 00014 be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public 00019 License along with the GNU C Library; see the file COPYING.LIB. If not, 00020 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. 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 // Constructors and destructor 00107 // 00108 00110 00111 Memory( void ) throw( Assertion ); 00112 00114 00115 virtual ~Memory( void ); 00116 00117 // 00118 // Operator overloads 00119 // 00120 00121 // 00122 // Accessors 00123 // 00124 00125 // 00126 // Mutators 00127 // 00128 00129 // 00130 // Factory Methods 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 Common rcs information do not modify 00221 $Author: prudhomm $ 00222 $Revision: 1.5 $ 00223 $Date: 2000/08/31 22:52:20 $ 00224 $Locker: $ 00225 */ 00226

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