/usr/include/corelinux/Memory.hpp is in libcorelinux-dev 0.4.32-7.4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | #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 the memory manager as a singleton for Memory
DECLARE_TYPE( Singleton<Memory>, MemoryManager );
/**
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:<p>
<ul>
<LI>Read only<br>
Memory marked with this attribute restrict processes to read only
operations performed on the memory storage region. Attempts to write
anything to this area will result in a system exception.
<p>
<LI>Read/Write<br>
Marked as Read/Write, processes have the ability to store and
retrieve from the memory storage region. This is the most common
form of access.
<p>
<LI>Executable<br>
This marks a memory region in the memory storage region as
executable. This provides a convenient way for user processes to
load dynamic program blocks for execution. By definition, memory in
a region marked executable is readable and writeable.
</ul>
*/
class Memory : public Synchronized
{
public:
//
// Constructors and destructor
//
/// Default constructor
Memory( void ) throw( Assertion );
/// Virtual Destructor
virtual ~Memory( void );
//
// Operator overloads
//
//
// Accessors
//
//
// Mutators
//
//
// Factory Methods
//
/**
Default create method, creates a private block of
read write shared memory of size aByteSize, sharing
attributes default to owner.
@param Size number of bytes to allocate
@param Int rights specificed
@return MemoryStorage pointer
*/
static MemoryStoragePtr createStorage
(
Size aByteSize,
Int Rights = OWNER_ALL
) throw( StorageException );
/**
Create method, creates or opens a specifically
identified block of shared memory of size aByteSize,
sharing attributes default to owner.
@param MemoryIdentifier reference to identifier.
@param Size number of bytes to allocate
@param Int rights specificed
@return MemoryStorage pointer
*/
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.
@param string name of shared memory storage.
@param Size number of bytes to allocate
@param Int rights specificed
@return MemoryStorage pointer
*/
static MemoryStoragePtr createStorage
(
CharCptr aName,
Size aByteSize,
CreateDisposition disp = CREATE_OR_REUSE,
Int Rights = OWNER_ALL ,
AddressingConstraint addressing = READ_WRITE
);
/**
Destroy a previously allocated storage block
@param MemoryStorage pointer to storage object
*/
static void destroyStorage( MemoryStoragePtr );
protected:
/// Copy constructor prohibited
Memory( MemoryCref ) throw( Assertion );
/// Assignment operator prohibited
MemoryRef operator=( MemoryCref ) throw( Assertion );
/// Equality always returns false
bool operator==( MemoryCref ) const;
protected:
/// The singleton instance of Memory for synchronization
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: $
*/
|