Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
RCRegion Class Referenceprovides compatability with the OPEN-R type of the same name More...
Detailed Descriptionprovides compatability with the OPEN-R type of the same name Definition at line 61 of file RCRegion.h.
Member Typedef Documentation
a map from the shared memory key type to the actual region structure Definition at line 148 of file RCRegion.h. Member Enumeration DocumentationDifferent methods of handling regions with conflicting keys.
Definition at line 171 of file RCRegion.h. Constructor & Destructor Documentation
constructor (OPEN-R compatability) Definition at line 102 of file RCRegion.h. Referenced by attach().
constructor, name isn't used for sysv-style shared memory (not OPEN-R compatable) could hash the name to generate key...? Definition at line 107 of file RCRegion.h.
this protected constructor is used for attaching regions previously created by another process (see attach()) Definition at line 186 of file RCRegion.h.
prevents stack allocation -- needs to be heap allocated and reference counted Definition at line 278 of file RCRegion.cc.
don't call Member Function Documentation
does housekeeping to mark the region as attached and the same number of references in the new process as well Definition at line 199 of file RCRegion.cc.
adds a reference from the current process Definition at line 77 of file RCRegion.cc. Referenced by init(), BehaviorBase::MonitorMotion::monitor(), SharedObjectBase::operator=(), SoundManager::ProcessMsg(), MotionManager::processMsg(), and SharedObjectBase::SharedObjectBase().
adds a reference which is held by another shared memory region Definition at line 170 of file RCRegion.cc. Referenced by MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage().
requests that a specified RCRegion be loaded into the current process's memory space Definition at line 65 of file RCRegion.cc. Referenced by MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::markRead(), RegionRegistry< MAX_REGIONS, NAME_LEN >::operator[](), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::peekMessage(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::readMessage(), RegionRegistry< MAX_REGIONS, NAME_LEN >::registerRegion(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReceiver(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage(), and MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::~MessageQueue().
Increments the attached region iterator in a thread-safe way -- only use this if you previously passed 'true' to begin(), or are decrementing from end(). If you are using an iterator obtained without thread-safety, just increment it normally -- don't switch to this or it will screw up reference counting. If you insist on switching back and forth between thread-safe advance (this function) and normal iterator advancing, you will need to add a reference to the current iterator's region before calling this. When you're done, either advance off the end, or manually call RemoveReference() on the iterator's final region Definition at line 269 of file RCRegion.cc.
Returns an iterator to the beginning of the attached regions mapping -- it->first is the key, it->second is the RCRegion*. If you need thread-safety (i.e. another thread may attach/detach while you are iterating), pass true, and be sure to use attachedAdvance() to increment the iterator! This doesn't prevent other threads from attaching/detaching regions, it only prevents detaching the one you're on. When you're done with a thread-safe iterator, either attachedAdvance() it off the end, or manually call RemoveReference() on the iterator's final region Definition at line 258 of file RCRegion.cc.
Returns an iterator to the end of the attached regions -- it->first is the key, it->second is the RCRegion*. If you need thread-safety (i.e. another thread may attach/detach while you are iterating), be sure to use attachedAdvance() to decrement the iterator! This doesn't prevent other threads from attaching/detaching regions, it only prevents detaching the one you're on. Definition at line 266 of file RCRegion.cc.
the pointer to the shared memory region Definition at line 130 of file RCRegion.h. Referenced by IPCEventTranslator::bufferRequest(), SharedObjectBase::data(), SoundManager::loadBuffer(), SoundManager::play(), IPCEventTranslator::post(), SoundManager::ProcessMsg(), MotionManager::processMsg(), SoundManager::release(), SoundManager::resumePlay(), and SharedObject< UPennWalkMC >::SharedObject().
returns the size of the region to be allocated, given the size requested by the client Definition at line 286 of file RCRegion.cc. Referenced by init(), and RemoveReference().
try to unload all regions in a clean manner Definition at line 220 of file RCRegion.cc.
returns conflictStrategy Definition at line 178 of file RCRegion.h.
returns multiprocess Definition at line 181 of file RCRegion.h.
return the next region serial number -- doesn't actually increment it though, repeated calls will return the same value until the value is actually used Definition at line 133 of file RCRegion.h.
intializes and returns staticLock Definition at line 295 of file RCRegion.cc. Referenced by aboutToFork(), AddReference(), AddSharedReference(), attach(), attachedAdvance(), attachedBegin(), faultShutdown(), init(), RemoveReference(), RemoveSharedReference(), and ~RCRegion().
returns the identifier of this region Definition at line 134 of file RCRegion.h. Referenced by MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage(), and SharedObject< UPennWalkMC >::SharedObject().
initializes the region's information, either creating a new shared memory region or attempting to connect to a pre-existing one Definition at line 303 of file RCRegion.cc. Referenced by RCRegion().
returns the number of regions which are currently attached in the process Definition at line 153 of file RCRegion.h.
number of references to the region from the current process (in the ProcessID threadgroup sense, not necessarily system-process) Definition at line 137 of file RCRegion.h.
number of total references to this region, total of all processes Definition at line 136 of file RCRegion.h. Referenced by SharedObject< UPennWalkMC >::removeRef().
removes a reference from the current process Definition at line 88 of file RCRegion.cc. Referenced by SoundManager::loadBuffer(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::markRead(), SoundManager::play(), IPCEventTranslator::post(), BehaviorBase::MonitorMotion::processEvent(), SoundManager::ProcessMsg(), MessageReceiver::processNextMessage(), SoundManager::release(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReceiver(), SharedObject< UPennWalkMC >::removeRef(), SoundManager::resumePlay(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::~MessageQueue(), and BehaviorBase::MonitorMotion::~MonitorMotion().
removes a reference which is held by another shared memory region Definition at line 180 of file RCRegion.cc. Referenced by MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::markRead(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::readMessage(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::removeReceiver(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage(), and MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::~MessageQueue().
sets conflictStrategy Definition at line 177 of file RCRegion.h.
sets multiprocess Definition at line 180 of file RCRegion.h.
sets the next key to be used for automatic assignment to new regions Definition at line 132 of file RCRegion.h.
the size of the shared memory region Definition at line 131 of file RCRegion.h. Referenced by SharedObject< UPennWalkMC >::SharedObject(). Member Data Documentation
the alignment multiple of the extra space at the end of the region Definition at line 193 of file RCRegion.h. Referenced by calcRealSize().
a mapping of key values to RCRegion pointers of the attached region Definition at line 231 of file RCRegion.h. Referenced by aboutToFork(), attach(), attachedAdvance(), attachedBegin(), attachedEnd(), faultShutdown(), init(), NumberOfAttach(), RemoveReference(), and ~RCRegion().
pointer to the region's user data Definition at line 234 of file RCRegion.h. Referenced by Base(), init(), RemoveReference(), and ~RCRegion().
controls what to do about creating a region with a conflicting key (i.e. another region already exists with the same key) Definition at line 222 of file RCRegion.h. Referenced by getConflictResolution(), init(), and setConflictResolution().
the amount of space to leave at the end of the region for housekeeping (reference counts) Definition at line 195 of file RCRegion.h. Referenced by calcRealSize(), and init().
key values for the region, namely the system key type (either an integer or string depending on TEKKOTSU_SHM_STYLE) and the size of the region Definition at line 233 of file RCRegion.h. Referenced by ID().
set to true if we are shutting down because of an error, and trying to unload shared regions to avoid leaking beyond program scope Definition at line 224 of file RCRegion.h. Referenced by faultShutdown(), and RemoveReference().
set to false if the different "processes" are just threads (and thus the last process reference shouldn't actually trigger unlinking a region Definition at line 226 of file RCRegion.h. Referenced by getMultiprocess(), RemoveReference(), and setMultiprocess().
serial number of next key -- starts at 1024 for TEKKOTSU_SHM_STYLE==SYSV_SHM, 0 for POSIX_SHM Definition at line 230 of file RCRegion.h. Referenced by getNextKey(), init(), RCRegion(), and setNextKey().
pointer to the per-process reference counts (stored within the shared region!) Definition at line 235 of file RCRegion.h. Referenced by AddReference(), AddSharedReference(), init(), NumberOfLocalReference(), NumberOfReference(), RemoveReference(), RemoveSharedReference(), and ~RCRegion().
a lock over all static RCRegion members for the current process, must be obtained before changing reference counts or attaching/detaching regions Definition at line 228 of file RCRegion.h. Referenced by aboutToFork(), getStaticLock(), and RemoveReference(). The documentation for this class was generated from the following files: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:15 2016 by Doxygen 1.6.3 |