#include <WritingRegion.hxx>
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 ®ion) |
void | CenterEvenRegions () |
As a precondition all the regions must be even (in order to center them correctly). | |
ProperStream & | Stream () |
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 () |
Region * | ProducerRegion () |
void | ClearData () |
Initializes all the data contained inside the region ( to the Token's default constructor). | |
Token & | GetLastWrittenData (int offset=0) |
Definition at line 34 of file WritingRegion.hxx.
typedef ReadingRegion< WritingRegion<Token,DataStructure> > CLAM::WritingRegion< Token, DataStructure >::ProperReadingRegion |
Definition at line 39 of file WritingRegion.hxx.
typedef StreamImpl< Token, DataStructure > CLAM::WritingRegion< Token, DataStructure >::ProperStream |
Definition at line 37 of file WritingRegion.hxx.
typedef Token CLAM::WritingRegion< Token, DataStructure >::ProperToken |
Definition at line 38 of file WritingRegion.hxx.
CLAM::WritingRegion< Token, DataStructure >::WritingRegion | ( | ) | [inline] |
Definition at line 111 of file WritingRegion.hxx.
References CLAM::Region::Size().
CLAM::WritingRegion< Token, DataStructure >::~WritingRegion | ( | ) | [inline, virtual] |
Definition at line 117 of file WritingRegion.hxx.
References CLAM::WritingRegion< Token, DataStructure >::BeginReaders(), and CLAM::WritingRegion< Token, DataStructure >::EndReaders().
Region::ReadingRegionsIterator CLAM::WritingRegion< Token, DataStructure >::BeginReaders | ( | ) | [inline, virtual] |
Implements CLAM::Region.
Definition at line 126 of file WritingRegion.hxx.
Referenced by CLAM::WritingRegion< Token, DataStructure >::~WritingRegion().
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().
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().
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().
Region::ReadingRegionsIterator CLAM::WritingRegion< Token, DataStructure >::EndReaders | ( | ) | [inline, virtual] |
Implements CLAM::Region.
Definition at line 132 of file WritingRegion.hxx.
Referenced by CLAM::WritingRegion< Token, DataStructure >::~WritingRegion().
bool CLAM::WritingRegion< Token, DataStructure >::FulfilsInvariant | ( | ) | [inline] |
Definition at line 276 of file WritingRegion.hxx.
References CLAM::Region::Pos(), and CLAM::Region::Size().
Referenced by CLAM::WritingRegion< Token, DataStructure >::CanProduce().
Token & CLAM::WritingRegion< Token, DataStructure >::GetLastWrittenData | ( | int | offset = 0 |
) | [inline] |
Definition at line 318 of file WritingRegion.hxx.
References CLAM::Region::BeginDistance().
Referenced by CLAM::OutPort< Token >::GetLastWrittenData().
void CLAM::WritingRegion< Token, DataStructure >::LinkRegions | ( | ProperReadingRegion & | reader | ) | [inline] |
Definition at line 138 of file WritingRegion.hxx.
References CLAM::ReadingRegion< WritingRegion >::LinkAndNotifySizeToStream(), CLAM::ReadingRegion< WritingRegion >::LinkProducerRegion(), and CLAM::WritingRegion< Token, DataStructure >::Stream().
Referenced by CLAM::InPort< Token >::AttachRegionToOutPort().
int CLAM::WritingRegion< Token, DataStructure >::LogicalStreamSize | ( | ) | [inline] |
Definition at line 286 of file WritingRegion.hxx.
Token & CLAM::WritingRegion< Token, DataStructure >::operator[] | ( | int | offset | ) | [inline] |
Definition at line 264 of file WritingRegion.hxx.
References CLAM::Region::BeginDistance(), CLAM_DEBUG_ASSERT, and CLAM::Region::Size().
void CLAM::WritingRegion< Token, DataStructure >::Produce | ( | ) | [inline] |
Definition at line 255 of file WritingRegion.hxx.
References CLAM::WritingRegion< Token, DataStructure >::CanProduce(), CLAM_DEBUG_ASSERT, CLAM::Region::Hop(), and CLAM::Region::Pos().
Referenced by CLAM::WritingRegion< Token, DataStructure >::CenterEvenRegions(), and CLAM::OutPort< Token >::Produce().
Region * CLAM::WritingRegion< Token, DataStructure >::ProducerRegion | ( | ) | [inline, virtual] |
Implements CLAM::Region.
Definition at line 292 of file WritingRegion.hxx.
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().
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().
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().