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

simth::SignalSequenceStorage< Val, Attr, Cont > Class Template Reference

This class implements a sequence, including all memory allocation for storage of that sequence. More...

#include <signals.h>

Inheritance diagram for simth::SignalSequenceStorage< Val, Attr, Cont >:

simth::SignalSequence< Val, Attr, Cont > simth::SignalSequenceBase< Val, Attr, Cont, SignalSequenceStorage< Val, Attr, Cont >, SignalSequenceAccess< Val, Attr, Cont > > 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 Val value_type
typedef Attr attributes_type
typedef Cont container_type

Public Member Functions

 SignalSequenceStorage ()
 SignalSequenceStorage (size_t size, const value_type &val=value_type())
 SignalSequenceStorage (const SignalSequence< value_type, attributes_type, container_type > &seq)
virtual ~SignalSequenceStorage ()
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 Val, class Attr, class Cont>
class simth::SignalSequenceStorage< Val, Attr, Cont >

This class implements a sequence, including all memory allocation for storage of that sequence.

Note:
Why do we need such a complex structure for the Signal classes? Please read the comment in signals.h for an explanation.
This class behaves similar to a vector of the standard template library (STL). You can easily obtain a shallow copy (reference copy) to this sequence by creating a SignalSequence object with this SignalSequenceStorage as constructor argument.

This class is used as a class to implement signal sequences. A signal sequence is any class that can be used as template argument of interfaces. Two interfaces that are connected use these sequences to exchange information (e.g. a bit sequence) between each other.

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.

Note: This class is new (since March 2003). Previously, the functionality of all SignalSequenceAccess and SignalSequenceStorage was combined into one class with two different 'modes of operation'. Eventually we agreed into clearly state that we are dealing with two different concepts here.


Member Typedef Documentation

template<class Val, class Attr, class Cont>
typedef Cont::iterator simth::SignalSequenceStorage< Val, Attr, Cont >::iterator
 

Reimplemented from simth::SignalSequence< Val, Attr, Cont >.

template<class Val, class Attr, class Cont>
typedef Cont::const_iterator simth::SignalSequenceStorage< Val, Attr, Cont >::const_iterator
 

Reimplemented from simth::SignalSequence< Val, Attr, Cont >.

template<class Val, class Attr, class Cont>
typedef Cont::reference simth::SignalSequenceStorage< Val, Attr, Cont >::reference
 

Reimplemented from simth::SignalSequence< Val, Attr, Cont >.

template<class Val, class Attr, class Cont>
typedef Cont::const_reference simth::SignalSequenceStorage< Val, Attr, Cont >::const_reference
 

Reimplemented from simth::SignalSequence< Val, Attr, Cont >.

template<class Val, class Attr, class Cont>
typedef Val simth::SignalSequenceStorage< Val, Attr, Cont >::value_type
 

Reimplemented from simth::SignalSequence< Val, Attr, Cont >.

template<class Val, class Attr, class Cont>
typedef Attr simth::SignalSequenceStorage< Val, Attr, Cont >::attributes_type
 

Reimplemented from simth::SignalSequence< Val, Attr, Cont >.

template<class Val, class Attr, class Cont>
typedef Cont simth::SignalSequenceStorage< Val, Attr, Cont >::container_type
 

Reimplemented from simth::SignalSequence< Val, Attr, Cont >.


Constructor & Destructor Documentation

template<class T, class A, class Cont>
simth::SignalSequenceStorage< T, A, Cont >::SignalSequenceStorage  ) 
 

Creates an empty sequence.

template<class T, class A, class Cont>
simth::SignalSequenceStorage< T, A, Cont >::SignalSequenceStorage 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 T, class A, class Cont>
simth::SignalSequenceStorage< T, A, Cont >::SignalSequenceStorage const SignalSequence< 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 T, class A, class Cont>
simth::SignalSequenceStorage< T, A, Cont >::~SignalSequenceStorage  )  [virtual]
 

Destructor


Member Function Documentation

template<class Val, class Attr, class Cont>
size_t simth::SignalSequenceStorage< Val, Attr, Cont >::capacity  )  const [inline]
 

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

Reimplemented from simth::SignalSequenceBase< Val, Attr, Cont, SignalSequenceStorage< Val, Attr, Cont >, SignalSequenceAccess< Val, Attr, Cont > >.

template<class T, class A, class Cont>
void simth::SignalSequenceStorage< T, A, 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< Val, Attr, Cont, SignalSequenceStorage< Val, Attr, Cont >, SignalSequenceAccess< Val, Attr, Cont > >.

template<class T, class A, class Cont>
A & simth::SignalSequenceStorage< T, A, 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< Val, Attr, Cont, SignalSequenceStorage< Val, Attr, Cont >, SignalSequenceAccess< Val, Attr, Cont > >.

template<class Val, class Attr, class Cont>
const attributes_type& simth::SignalSequenceStorage< Val, 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< Val, Attr, Cont, SignalSequenceStorage< Val, Attr, Cont >, SignalSequenceAccess< Val, Attr, Cont > >.

template<class Val, class Attr, class Cont>
void simth::SignalSequenceStorage< Val, 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 Val, class Attr, class Cont>
void simth::SignalSequenceStorage< Val, Attr, Cont >::unlock  )  [inline]
 

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

template<class Val, class Attr, class Cont>
bool simth::SignalSequenceStorage< Val, Attr, Cont >::isLocked  )  const [inline]
 

Returns true if the attributes are locked, otherwise false.


Generated on Mon Apr 24 21:19:20 2006 for simthetic by  doxygen 1.4.1