Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mimo::MSequenceStorage< elemT, Attr, Cont > Class Template Reference

Implementation of a sequence. More...

#include <matrixseq.h>

Inheritance diagram for mimo::MSequenceStorage< elemT, Attr, Cont >:

Inheritance graph
[legend]
List of all members.

Public Types

typedef Cont::iterator iterator
typedef Cont::const_iterator const_iterator
typedef Cont::reference reference
typedef Cont::const_reference const_reference
typedef elemT value_type
typedef Attr attributes_type
typedef Cont container_type

Public Member Functions

 MSequenceStorage ()
 MSequenceStorage (size_t size, const value_type &val=value_type())
 MSequenceStorage (const MSequence< value_type, attributes_type, container_type > &seq)
virtual ~MSequenceStorage ()
size_t capacity () const
virtual void resize (size_t i)
attributes_typewAttributes ()
const attributes_typerAttributes () const
void lock ()
void unlock ()
bool isLocked () const

Detailed Description

template<class elemT, class Attr, class Cont>
class mimo::MSequenceStorage< elemT, Attr, Cont >

Implementation of a sequence.

This class behaves similar to a vector of the standard template library (STL) *and* it allocates storage.

Characteristics: Resizing is possible into both larger and smaller size. Note: After resizing, all other iterators and shallow copies will become invalid. If there are other shallow copies around, they need to do seek() before they can be used again.


Member Typedef Documentation

template<class elemT, class Attr, class Cont>
typedef Cont::iterator mimo::MSequenceStorage< elemT, Attr, Cont >::iterator
 

Reimplemented from mimo::MSequence< elemT, Attr, Cont >.

template<class elemT, class Attr, class Cont>
typedef Cont::const_iterator mimo::MSequenceStorage< elemT, Attr, Cont >::const_iterator
 

Reimplemented from mimo::MSequence< elemT, Attr, Cont >.

template<class elemT, class Attr, class Cont>
typedef Cont::reference mimo::MSequenceStorage< elemT, Attr, Cont >::reference
 

Reimplemented from mimo::MSequence< elemT, Attr, Cont >.

template<class elemT, class Attr, class Cont>
typedef Cont::const_reference mimo::MSequenceStorage< elemT, Attr, Cont >::const_reference
 

Reimplemented from mimo::MSequence< elemT, Attr, Cont >.

template<class elemT, class Attr, class Cont>
typedef elemT mimo::MSequenceStorage< elemT, Attr, Cont >::value_type
 

Reimplemented from mimo::MSequence< elemT, Attr, Cont >.

template<class elemT, class Attr, class Cont>
typedef Attr mimo::MSequenceStorage< elemT, Attr, Cont >::attributes_type
 

Reimplemented from mimo::MSequence< elemT, Attr, Cont >.

template<class elemT, class Attr, class Cont>
typedef Cont mimo::MSequenceStorage< elemT, Attr, Cont >::container_type
 

Reimplemented from mimo::MSequence< elemT, Attr, Cont >.


Constructor & Destructor Documentation

template<class elemT, class Attr, class Cont>
mimo::MSequenceStorage< elemT, Attr, Cont >::MSequenceStorage  ) 
 

Creates an empty sequence.

template<class elemT, class Attr, class Cont>
mimo::MSequenceStorage< elemT, Attr, Cont >::MSequenceStorage size_t  size,
const value_type val = value_type()
 

Creates a new sequence with a specific length. Probably an expensive operation.

Parameters:
size length of created sequence
val initial value of the created elements

template<class elemT, class Attr, class Cont>
mimo::MSequenceStorage< elemT, Attr, Cont >::MSequenceStorage const MSequence< value_type, attributes_type, container_type > &  seq  ) 
 

Creates a new sequence as a deep copy of an already existing sequence. Watch out -- this is probably a very expensive operation.

template<class elemT, class Attr, class Cont>
virtual mimo::MSequenceStorage< elemT, Attr, Cont >::~MSequenceStorage  )  [virtual]
 

Destructor


Member Function Documentation

template<class elemT, class Attr, class Cont>
size_t mimo::MSequenceStorage< elemT, Attr, Cont >::capacity  )  const [inline]
 

Returns the number of currently allocated elements in the storage of this sequence.

Reimplemented from simth::SignalSequenceBase< elemT, Attr, Cont, MSequenceStorage< elemT, Attr, Cont >, MSequenceAccess< elemT, Attr, Cont > >.

template<class elemT, class Attr, class Cont>
virtual void mimo::MSequenceStorage< elemT, Attr, Cont >::resize size_t  i  )  [virtual]
 

Resize this sequence.

WATCH OUT: After resizing, iterators and shallow copies to this sequence might have become invalid. You must take care that no other shallow copy keeps around old pointers/iterators. Those will be invalid if the sequence has been truncated, or if the sequence has grown larger and thus moved to a different place in memory.

Reimplemented from simth::SignalSequenceBase< elemT, Attr, Cont, MSequenceStorage< elemT, Attr, Cont >, MSequenceAccess< elemT, Attr, Cont > >.

template<class elemT, class Attr, class Cont>
attributes_type& mimo::MSequenceStorage< elemT, Attr, Cont >::wAttributes  ) 
 

Returns a reference to the attributes class of the sequence. Use this pointer obtain write access. If this object holds a lock on the attributes, this function will throw an Error.

(If you only need read access to the class use the function rAttributes().)

Reimplemented from simth::SignalSequenceBase< elemT, Attr, Cont, MSequenceStorage< elemT, Attr, Cont >, MSequenceAccess< elemT, Attr, Cont > >.

template<class elemT, class Attr, class Cont>
const attributes_type& mimo::MSequenceStorage< elemT, Attr, Cont >::rAttributes  )  const [inline]
 

Returns a constant reference to the attributes class of the sequence. Use this pointer obtain read only access. (If you need write acces to the class use the function wAttributes().

Reimplemented from simth::SignalSequenceBase< elemT, Attr, Cont, MSequenceStorage< elemT, Attr, Cont >, MSequenceAccess< elemT, Attr, Cont > >.

template<class elemT, class Attr, class Cont>
void mimo::MSequenceStorage< elemT, Attr, Cont >::lock  )  [inline]
 

Locks write access to the attributes, i.e. if calling wAttributes() while the attributes are locked, a std::runtime_error is thrown. To unlock the attributes use the function unlockAttributes().

template<class elemT, class Attr, class Cont>
void mimo::MSequenceStorage< elemT, Attr, Cont >::unlock  )  [inline]
 

Unlocks write acces to the attributes again. After calling this, calling wAttributes() is allowed again.

template<class elemT, class Attr, class Cont>
bool mimo::MSequenceStorage< elemT, Attr, Cont >::isLocked  )  const [inline]
 

Returns true if the attributes are locked, otherwise false.


Generated on Tue Aug 9 14:43:40 2005 for mimolib by  doxygen 1.4.1