Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
ListMemBuf< T_t, MAX, idx_t > Class Template Reference#include <ListMemBuf.h>
Inheritance diagram for ListMemBuf< T_t, MAX, idx_t >: ![]() Detailed Descriptiontemplate<class T_t, unsigned int MAX, class idx_t = unsigned short>
Provides some degree of dynamic allocation of a templated type from a buffer of set size.
|
Public Types | |
typedef T_t | T |
Allows outside access to storage type. | |
typedef idx_t | index_t |
Allows outside access to index type. | |
Public Member Functions | |
ListMemBuf () | |
constructor | |
~ListMemBuf () | |
destructor | |
index_t | size () const |
returns the current number of objects in use | |
index_t | countf () const |
for debugging, should equal size | |
index_t | countb () const |
for debugging, should equal size | |
bool | empty () const |
returns true if no objects are in use | |
T & | operator[] (unsigned int x) |
allows direct access to elements - be careful, can access 'free' elements this way | |
const T & | operator[] (unsigned int x) const |
allows direct access to elements - be careful, can access 'free' elements this way | |
index_t | begin () const |
returns index of first used entry | |
T & | front () |
returns reference to first used entry | |
const T & | front () const |
returns const reference to first used entry | |
index_t | end () const |
returns the one-past-end index | |
T & | back () |
returns reference to last used entry | |
const T & | back () const |
returns const reference to last used entry | |
index_t | new_front () |
pushes a 'blank' entry on the front of the used list | |
index_t | push_front (const T &data) |
pushes an entry on the front of the used chain and assigns data to it | |
void | pop_front () |
pops the front of the used chain | |
void | pop_front (T &ret) |
pops the front of the chain into ret | |
index_t | new_back () |
pushes a 'blank' entry on the back of the used list | |
index_t | push_back (const T &data) |
pushes an entry on the back of the used chain and assigns data to it | |
void | pop_back () |
pops the last of the used chain | |
void | pop_back (T &ret) |
pops the last of the used chain into ret | |
index_t | new_before (index_t x) |
inserts a 'blank' entry before element x in the used chain | |
index_t | push_before (index_t x, const T &data) |
inserts a 'blank' entry before element x in the used chain and assigns data to it | |
index_t | new_after (index_t x) |
inserts a 'blank' entry after element x in the used chain | |
index_t | push_after (index_t x, const T &data) |
inserts a 'blank' entry after element x in the used chain and assigns data to it | |
void | erase (index_t x) |
removes element x from the used chain | |
void | clear () |
frees all used entries | |
void | swap (index_t a, index_t b) |
swaps the two entries' position in the list | |
index_t | next (index_t x) const |
returns the next used element following x | |
index_t | prev (index_t x) const |
returns the preceeding used element following x | |
Static Public Member Functions | |
static index_t | getMaxCapacity () |
returns the maximum number of objects which can be used at any given time | |
Static Public Attributes | |
static const unsigned int | MAX_ENTRIES = MAX |
Allows outside access to number of entries. | |
Protected Member Functions | |
index_t | pop_free () |
removes an element from the front of the free list, returns its index | |
void | push_free (index_t x) |
pushes x onto the back of the free list | |
Protected Attributes | |
entry_t | entries [MAX_ENTRIES] |
the main block of data | |
index_t | activeBegin |
beginning of used chain | |
index_t | activeBack |
end of used chain | |
index_t | freeBegin |
beginning of free chain | |
index_t | freeBack |
end of free chain | |
index_t | cursize |
current number of used elements | |
Classes | |
struct | entry_t |
holds data about an entry in the free/used lists More... |
|
Allows outside access to index type.
Definition at line 31 of file ListMemBuf.h. |
|
Allows outside access to storage type.
Definition at line 27 of file ListMemBuf.h. |
|
constructor
Definition at line 95 of file ListMemBuf.h. |
|
destructor
Definition at line 106 of file ListMemBuf.h. |
|
returns const reference to last used entry
Definition at line 48 of file ListMemBuf.h. |
|
returns reference to last used entry
Definition at line 47 of file ListMemBuf.h. Referenced by MotionSequenceMC< MAXMOVE >::clear(), WaypointEngine< MAX_WAY >::fixArc(), WaypointEngine< MAX_WAY >::LoadBuffer(), ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::pop_back(), and SoundManager::selectChannels(). |
|
|
frees all used entries
Definition at line 219 of file ListMemBuf.h. Referenced by MotionSequenceMC< MAXMOVE >::clear(), MotionManager::getOutputs(), WaypointEngine< MAX_WAY >::LoadBuffer(), and ListMemBuf< T_t, MAX, idx_t >::~ListMemBuf(). |
|
for debugging, should equal size
Definition at line 121 of file ListMemBuf.h. |
|
for debugging, should equal size
Definition at line 112 of file ListMemBuf.h. |
|
returns true if no objects are in use
Definition at line 37 of file ListMemBuf.h. Referenced by SoundManager::StopPlay(), MotionManager::updatePIDs(), MotionManager::~MotionManager(), and SoundManager::~SoundManager(). |
|
|
removes element x from the used chain
Definition at line 203 of file ListMemBuf.h. Referenced by SoundManager::endPlay(), MotionSequenceMC< MAXMOVE >::eraseKeyFrame(), SoundManager::PausePlay(), MotionManager::push_free(), MotionManager::setPID(), SoundManager::StopPlay(), and SoundManager::~SoundManager(). |
|
returns const reference to first used entry
Definition at line 44 of file ListMemBuf.h. |
|
returns reference to first used entry
Definition at line 43 of file ListMemBuf.h. Referenced by WaypointEngine< MAX_WAY >::go(), ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::pop_front(), WaypointEngine< MAX_WAY >::SaveBuffer(), and MotionManager::updatePIDs(). |
|
returns the maximum number of objects which can be used at any given time
Definition at line 33 of file ListMemBuf.h. Referenced by MotionSequenceMC< MAXMOVE >::getMaxFrames(). |
|
inserts a 'blank' entry after element x in the used chain
Definition at line 63 of file ListMemBuf.h. Referenced by ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::push_after(). |
|
pushes a 'blank' entry on the back of the used list
Definition at line 146 of file ListMemBuf.h. Referenced by MotionSequenceMC< MAXMOVE >::clear(), ListMemBuf< T_t, MAX, idx_t >::new_before(), and ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::push_back(). |
|
inserts a 'blank' entry before element x in the used chain
Definition at line 162 of file ListMemBuf.h. Referenced by ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::new_after(), and ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::push_before(). |
|
pushes a 'blank' entry on the front of the used list
Definition at line 130 of file ListMemBuf.h. Referenced by SoundManager::ChainBuffer(), SoundManager::ChainFile(), SoundManager::LoadBuffer(), ListMemBuf< T_t, MAX, idx_t >::new_before(), MotionSequenceMC< MAXMOVE >::newKeyFrame(), MotionManager::pop_free(), and ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::push_front(). |
|
|
allows direct access to elements - be careful, can access 'free' elements this way
Definition at line 40 of file ListMemBuf.h. |
|
allows direct access to elements - be careful, can access 'free' elements this way
Definition at line 39 of file ListMemBuf.h. Referenced by ListMemBuf< T_t, MAX, idx_t >::clear(), ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::push_after(), ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::push_back(), ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::push_before(), ListMemBuf< T_t, MAX, idx_t >::push_free(), and ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::push_front(). |
|
pops the last of the used chain into ret
Definition at line 58 of file ListMemBuf.h. |
|
pops the last of the used chain
Definition at line 191 of file ListMemBuf.h. Referenced by ListMemBuf< T_t, MAX, idx_t >::erase(), and ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::pop_back(). |
|
removes an element from the front of the free list, returns its index free list is a queue... pop front, push back - hopefully more robust with multi-threads is purposely sloppy with unused links, a little faster Definition at line 316 of file ListMemBuf.h. Referenced by ListMemBuf< T_t, MAX, idx_t >::new_back(), ListMemBuf< T_t, MAX, idx_t >::new_before(), and ListMemBuf< T_t, MAX, idx_t >::new_front(). |
|
pops the front of the chain into ret
Definition at line 53 of file ListMemBuf.h. |
|
pops the front of the used chain
Definition at line 179 of file ListMemBuf.h. Referenced by SoundManager::ChainBuffer(), SoundManager::ChainFile(), ListMemBuf< T_t, MAX, idx_t >::erase(), ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::pop_front(), and MotionManager::updatePIDs(). |
|
returns the preceeding used element following x
Definition at line 72 of file ListMemBuf.h. Referenced by ListMemBuf< T_t, MAX, idx_t >::countb(), WaypointEngine< MAX_WAY >::fixArc(), SoundManager::selectChannels(), MotionSequenceMC< MAXMOVE >::setRange(), and SoundManager::StopPlay(). |
|
inserts a 'blank' entry after element x in the used chain and assigns data to it
Definition at line 64 of file ListMemBuf.h. |
|
pushes an entry on the back of the used chain and assigns data to it
Definition at line 56 of file ListMemBuf.h. Referenced by WaypointEngine< MAX_WAY >::addAbsoluteWaypoint(), WaypointEngine< MAX_WAY >::addEgocentricWaypoint(), WaypointEngine< MAX_WAY >::addOffsetWaypoint(), and MotionManager::setPID(). |
|
inserts a 'blank' entry before element x in the used chain and assigns data to it
Definition at line 61 of file ListMemBuf.h. |
|
pushes x onto the back of the free list
Definition at line 332 of file ListMemBuf.h. Referenced by ListMemBuf< T_t, MAX, idx_t >::erase(), ListMemBuf< T_t, MAX, idx_t >::pop_back(), and ListMemBuf< T_t, MAX, idx_t >::pop_front(). |
|
pushes an entry on the front of the used chain and assigns data to it
Definition at line 51 of file ListMemBuf.h. Referenced by SoundManager::ResumePlay(), and MotionManager::setOutput(). |
|
returns the current number of objects in use
Definition at line 34 of file ListMemBuf.h. Referenced by SoundManager::CopyTo(), WaypointEngine< MAX_WAY >::getBinSize(), SoundManager::GetNumPlaying(), MotionSequenceMC< MAXMOVE >::getUsedFrames(), MotionManager::InitAccess(), SoundManager::PlayBuffer(), SoundManager::PlayFile(), SoundManager::selectChannels(), WaypointEngine< MAX_WAY >::setTargetWaypoint(), and MotionManager::size(). |
|
swaps the two entries' position in the list
Definition at line 235 of file ListMemBuf.h. Referenced by MotionManager::getOutputs(). |
|
|
|
current number of used elements
Definition at line 91 of file ListMemBuf.h. Referenced by ListMemBuf< T_t, MAX, idx_t >::clear(), ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::empty(), ListMemBuf< T_t, MAX, idx_t >::pop_free(), ListMemBuf< T_t, MAX, idx_t >::push_free(), and ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::size(). |
|
|
end of free chain
Definition at line 90 of file ListMemBuf.h. Referenced by ListMemBuf< T_t, MAX, idx_t >::clear(), ListMemBuf< T_t, MAX, idx_t >::ListMemBuf(), ListMemBuf< T_t, MAX, idx_t >::pop_free(), and ListMemBuf< T_t, MAX, idx_t >::push_free(). |
|
beginning of free chain
Definition at line 89 of file ListMemBuf.h. Referenced by ListMemBuf< T_t, MAX, idx_t >::clear(), ListMemBuf< T_t, MAX, idx_t >::ListMemBuf(), ListMemBuf< T_t, MAX, idx_t >::pop_free(), and ListMemBuf< T_t, MAX, idx_t >::push_free(). |
|
Allows outside access to number of entries.
Definition at line 29 of file ListMemBuf.h. Referenced by ListMemBuf< CommandEntry, MAX_MOTIONS, MC_ID >::getMaxCapacity(), ListMemBuf< T_t, MAX, idx_t >::ListMemBuf(), SoundManager::PlayBuffer(), and SoundManager::PlayFile(). |
Tekkotsu v2.4.1 |
Generated Tue Aug 16 16:35:04 2005 by Doxygen 1.4.4 |