CLAM::WritingRegion< Token, DataStructure > Class Template Reference

#include <WritingRegion.hxx>

List of all members.

Public Types

typedef StreamImpl< Token,
DataStructure > 
ProperStream
typedef Token ProperToken
typedef ReadingRegion
< WritingRegion< Token,
DataStructure > > 
ProperReadingRegion

Public Member Functions

 WritingRegion ()
virtual ~WritingRegion ()
Region::ReadingRegionsIterator BeginReaders ()
Region::ReadingRegionsIterator EndReaders ()
void LinkRegions (ProperReadingRegion &reader)
void RemoveRegion (Region &region)
void CenterEvenRegions ()
 As a precondition all the regions must be even (in order to center them correctly).
ProperStreamStream ()
 returns the underlying stream.
int RearmostReadingPos ()
 when no linked reading region is found it returns the writing pos thus eviting overlap condition
bool CanProduce ()
 Checks that after moving the writing-region no overlap occur with reading regions.
void Produce ()
Token & operator[] (int offset)
bool FulfilsInvariant ()
int LogicalStreamSize ()
RegionProducerRegion ()
void ClearData ()
 Initializes all the data contained inside the region ( to the Token's default constructor).
Token & GetLastWrittenData (int offset=0)

Detailed Description

template<typename Token, template< class > class DataStructure = PhantomBuffer>
class CLAM::WritingRegion< Token, DataStructure >

Definition at line 34 of file WritingRegion.hxx.


Member Typedef Documentation

template<typename Token, template< class > class DataStructure = PhantomBuffer>
typedef ReadingRegion< WritingRegion<Token,DataStructure> > CLAM::WritingRegion< Token, DataStructure >::ProperReadingRegion

Definition at line 39 of file WritingRegion.hxx.

template<typename Token, template< class > class DataStructure = PhantomBuffer>
typedef StreamImpl< Token, DataStructure > CLAM::WritingRegion< Token, DataStructure >::ProperStream

Definition at line 37 of file WritingRegion.hxx.

template<typename Token, template< class > class DataStructure = PhantomBuffer>
typedef Token CLAM::WritingRegion< Token, DataStructure >::ProperToken

Definition at line 38 of file WritingRegion.hxx.


Constructor & Destructor Documentation

template<typename Token , template< class > class DataStructure>
CLAM::WritingRegion< Token, DataStructure >::WritingRegion (  )  [inline]

Definition at line 111 of file WritingRegion.hxx.

References CLAM::Region::Size().

template<typename Token , template< class > class DataStructure>
CLAM::WritingRegion< Token, DataStructure >::~WritingRegion (  )  [inline, virtual]

Member Function Documentation

template<typename Token , template< class > class DataStructure>
Region::ReadingRegionsIterator CLAM::WritingRegion< Token, DataStructure >::BeginReaders (  )  [inline, virtual]
template<typename Token , template< class > class DataStructure>
bool CLAM::WritingRegion< Token, DataStructure >::CanProduce (  )  [inline]

Checks that after moving the writing-region no overlap occur with reading regions.

This could happen since this is a circular buffer. Returns true if no overlapping occur so it can produce.

Definition at line 248 of file WritingRegion.hxx.

References CLAM_DEBUG_ASSERT, CLAM::WritingRegion< Token, DataStructure >::FulfilsInvariant(), CLAM::Region::Pos(), CLAM::WritingRegion< Token, DataStructure >::RearmostReadingPos(), and CLAM::Region::Size().

Referenced by CLAM::OutPort< Token >::CanProduce(), and CLAM::WritingRegion< Token, DataStructure >::Produce().

template<typename Token , template< class > class DataStructure>
void CLAM::WritingRegion< Token, DataStructure >::CenterEvenRegions (  )  [inline]

As a precondition all the regions must be even (in order to center them correctly).

Otherways the method gives an assertion

Definition at line 194 of file WritingRegion.hxx.

References CLAM::Region::BeginDistance(), CLAM::WritingRegion< Token, DataStructure >::ClearData(), CLAM::Region::Hop(), CLAM::Region::Pos(), CLAM::WritingRegion< Token, DataStructure >::Produce(), and CLAM::Region::Size().

Referenced by CLAM::OutPort< Token >::CenterEvenRegions().

template<typename Token , template< class > class DataStructure>
void CLAM::WritingRegion< Token, DataStructure >::ClearData (  )  [inline]

Initializes all the data contained inside the region ( to the Token's default constructor).

Definition at line 175 of file WritingRegion.hxx.

References CLAM::Region::Size().

Referenced by CLAM::WritingRegion< Token, DataStructure >::CenterEvenRegions().

template<typename Token , template< class > class DataStructure>
Region::ReadingRegionsIterator CLAM::WritingRegion< Token, DataStructure >::EndReaders (  )  [inline, virtual]
template<typename Token , template< class > class DataStructure>
bool CLAM::WritingRegion< Token, DataStructure >::FulfilsInvariant (  )  [inline]
template<typename Token , template< class > class DataStructure>
Token & CLAM::WritingRegion< Token, DataStructure >::GetLastWrittenData ( int  offset = 0  )  [inline]
template<typename Token , template< class > class DataStructure>
void CLAM::WritingRegion< Token, DataStructure >::LinkRegions ( ProperReadingRegion reader  )  [inline]
template<typename Token , template< class > class DataStructure>
int CLAM::WritingRegion< Token, DataStructure >::LogicalStreamSize (  )  [inline]

Definition at line 286 of file WritingRegion.hxx.

template<typename Token , template< class > class DataStructure>
Token & CLAM::WritingRegion< Token, DataStructure >::operator[] ( int  offset  )  [inline]
template<typename Token , template< class > class DataStructure>
void CLAM::WritingRegion< Token, DataStructure >::Produce (  )  [inline]
template<typename Token , template< class > class DataStructure>
Region * CLAM::WritingRegion< Token, DataStructure >::ProducerRegion (  )  [inline, virtual]

Implements CLAM::Region.

Definition at line 292 of file WritingRegion.hxx.

template<typename Token , template< class > class DataStructure>
int CLAM::WritingRegion< Token, DataStructure >::RearmostReadingPos (  )  [inline]

when no linked reading region is found it returns the writing pos thus eviting overlap condition

Definition at line 237 of file WritingRegion.hxx.

References CLAM::Region::Pos().

Referenced by CLAM::WritingRegion< Token, DataStructure >::CanProduce().

template<typename Token , template< class > class DataStructure>
void CLAM::WritingRegion< Token, DataStructure >::RemoveRegion ( Region region  )  [inline, virtual]

Reimplemented from CLAM::Region.

Definition at line 222 of file WritingRegion.hxx.

References CLAM_ASSERT, CLAM::Region::ProducerRegion(), and CLAM::Region::RemoveProducer().

template<typename Token , template< class > class DataStructure>
WritingRegion< Token, DataStructure >::ProperStream & CLAM::WritingRegion< Token, DataStructure >::Stream (  )  [inline]

returns the underlying stream.

Useful for testing.

Definition at line 231 of file WritingRegion.hxx.

Referenced by CLAM::WritingRegion< Token, DataStructure >::LinkRegions().


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.3