Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
RegionRegistry< MAX_REGIONS, NAME_LEN > Class Template ReferenceKeeps track of currently available shared memory regions. More...
Detailed Descriptiontemplate<unsigned int MAX_REGIONS, unsigned int NAME_LEN>
|
Classes | |
struct | entry |
Holds information regarding a shared memory region available for listening. More... | |
Public Types | |
typedef registry_t::index_t | index_t |
shorthand for the index type used to reference regions | |
Public Member Functions | |
RegionRegistry () | |
constructor | |
~RegionRegistry () | |
destructor | |
index_t | findRegion (const std::string &name) const |
Searches for the region specified by name, returns end() if not found. | |
index_t | registerRegion (const std::string &name, const RCRegion *region) |
Registers a region, returns the index of the region if successful, or end() if out of space or conflicting registration is found. | |
RCRegion * | registerRegion (const std::string &name, size_t size) |
Creates and registers a new region of the specified size — if the region is already registered, the previous one is returned. | |
RCRegion * | operator[] (index_t it) const |
Access a region by index. | |
void | erase (index_t it) |
Erases the registration, but doesn't dereference the region (the registry doesn't claim references on the regions...). | |
index_t | begin () const |
provides iteration through the entries, be sure to use next(), the index_t is not a 'proper' iterator (no ++ to increment) | |
index_t | next (index_t it) const |
provides the index of the next entry | |
index_t | end () const |
one-past-end marker | |
Static Public Attributes | |
static const unsigned int | CAPACITY = MAX_REGIONS |
allows access to template parameters | |
static const unsigned int | REGION_NAME_LEN = NAME_LEN |
allows access to template parameters | |
Protected Types | |
typedef ListMemBuf< entry, MAX_REGIONS > | registry_t |
type of the collection managing the regions | |
Protected Attributes | |
MutexLock < ProcessID::NumProcesses > | lock |
makes sure we only have one registration in progress at a time | |
registry_t | avail |
collection of available memory regions |
typedef registry_t::index_t RegionRegistry< MAX_REGIONS, NAME_LEN >::index_t |
shorthand for the index type used to reference regions
Definition at line 39 of file RegionRegistry.h.
typedef ListMemBuf<entry,MAX_REGIONS> RegionRegistry< MAX_REGIONS, NAME_LEN >::registry_t [protected] |
type of the collection managing the regions
Definition at line 33 of file RegionRegistry.h.
RegionRegistry< MAX_REGIONS, NAME_LEN >::RegionRegistry | ( | ) |
constructor
Definition at line 42 of file RegionRegistry.h.
RegionRegistry< MAX_REGIONS, NAME_LEN >::~RegionRegistry | ( | ) |
destructor
Definition at line 45 of file RegionRegistry.h.
index_t RegionRegistry< MAX_REGIONS, NAME_LEN >::begin | ( | ) | const |
provides iteration through the entries, be sure to use next(), the index_t is not a 'proper' iterator (no ++ to increment)
Definition at line 105 of file RegionRegistry.h.
Referenced by RegionRegistry< MAX_REGIONS, NAME_LEN >::findRegion().
index_t RegionRegistry< MAX_REGIONS, NAME_LEN >::end | ( | ) | const |
one-past-end marker
Definition at line 107 of file RegionRegistry.h.
Referenced by RegionRegistry< MAX_REGIONS, NAME_LEN >::findRegion(), RegionRegistry< MAX_REGIONS, NAME_LEN >::operator[](), and RegionRegistry< MAX_REGIONS, NAME_LEN >::registerRegion().
void RegionRegistry< MAX_REGIONS, NAME_LEN >::erase | ( | index_t | it | ) |
Erases the registration, but doesn't dereference the region (the registry doesn't claim references on the regions...).
Definition at line 100 of file RegionRegistry.h.
index_t RegionRegistry< MAX_REGIONS, NAME_LEN >::findRegion | ( | const std::string & | name | ) | const |
Searches for the region specified by name, returns end() if not found.
Definition at line 51 of file RegionRegistry.h.
Referenced by RegionRegistry< MAX_REGIONS, NAME_LEN >::registerRegion().
index_t RegionRegistry< MAX_REGIONS, NAME_LEN >::next | ( | index_t | it | ) | const |
provides the index of the next entry
Definition at line 106 of file RegionRegistry.h.
Referenced by RegionRegistry< MAX_REGIONS, NAME_LEN >::findRegion().
RCRegion* RegionRegistry< MAX_REGIONS, NAME_LEN >::operator[] | ( | index_t | it | ) | const |
Access a region by index.
Definition at line 92 of file RegionRegistry.h.
RCRegion* RegionRegistry< MAX_REGIONS, NAME_LEN >::registerRegion | ( | const std::string & | name, | |
size_t | size | |||
) |
Creates and registers a new region of the specified size — if the region is already registered, the previous one is returned.
No checking is done on the size of the region... if it was already registered as a different size, that is ignored.
Definition at line 77 of file RegionRegistry.h.
index_t RegionRegistry< MAX_REGIONS, NAME_LEN >::registerRegion | ( | const std::string & | name, | |
const RCRegion * | region | |||
) |
Registers a region, returns the index of the region if successful, or end() if out of space or conflicting registration is found.
You can re-register the same region under the same name, it simply returns the same index again.
Definition at line 63 of file RegionRegistry.h.
registry_t RegionRegistry< MAX_REGIONS, NAME_LEN >::avail [protected] |
collection of available memory regions
Definition at line 34 of file RegionRegistry.h.
Referenced by RegionRegistry< MAX_REGIONS, NAME_LEN >::begin(), RegionRegistry< MAX_REGIONS, NAME_LEN >::end(), RegionRegistry< MAX_REGIONS, NAME_LEN >::erase(), RegionRegistry< MAX_REGIONS, NAME_LEN >::findRegion(), RegionRegistry< MAX_REGIONS, NAME_LEN >::next(), RegionRegistry< MAX_REGIONS, NAME_LEN >::operator[](), RegionRegistry< MAX_REGIONS, NAME_LEN >::registerRegion(), and RegionRegistry< MAX_REGIONS, NAME_LEN >::~RegionRegistry().
const unsigned int RegionRegistry< MAX_REGIONS, NAME_LEN >::CAPACITY = MAX_REGIONS [static] |
allows access to template parameters
Definition at line 37 of file RegionRegistry.h.
MutexLock<ProcessID::NumProcesses> RegionRegistry< MAX_REGIONS, NAME_LEN >::lock [mutable, protected] |
makes sure we only have one registration in progress at a time
Definition at line 19 of file RegionRegistry.h.
Referenced by RegionRegistry< MAX_REGIONS, NAME_LEN >::erase(), RegionRegistry< MAX_REGIONS, NAME_LEN >::findRegion(), RegionRegistry< MAX_REGIONS, NAME_LEN >::operator[](), RegionRegistry< MAX_REGIONS, NAME_LEN >::registerRegion(), and RegionRegistry< MAX_REGIONS, NAME_LEN >::~RegionRegistry().
const unsigned int RegionRegistry< MAX_REGIONS, NAME_LEN >::REGION_NAME_LEN = NAME_LEN [static] |
allows access to template parameters
Definition at line 38 of file RegionRegistry.h.
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:15 2016 by Doxygen 1.6.3 |