Helios++
Helios software for LiDAR simulations
WriteYielder< T > Class Template Reference

Abstract class representing a write yielder. It is, a yielder which can use the FMSWriteFacade to write its output. More...

#include <WriteYielder.h>

Inheritance diagram for WriteYielder< T >:
Collaboration diagram for WriteYielder< T >:

Public Member Functions

 WriteYielder (FMSWriteFacade &write, size_t bufferSize=256)
 Default constructor for the abstract write yielder. More...
 
- Public Member Functions inherited from Yielder< T >
 Yielder (std::size_t bufferSize=256)
 Default constructor for the abstract yielder. More...
 
void yield ()
 Make the yielder flush its elements so the output is performed.
 
void push (T const &elem)
 Push the element into the yielder. The element could be simply accumulated or either it could be directly written to file depending on yielder status at push time. More...
 
virtual void digest (vector< T > &copy)=0
 Abstract method that must be overridden by any concrete Yielder implementation to specify how a yield output must be handled/digested.
 
virtual vector< T > copyBuffer () const
 Make a copy of the buffer with its current state. More...
 
void setBufferSize (size_t const bufferSize)
 Set the buffer size of the yielder, effectively. More...
 
size_t getBufferSize () const
 Obtain the current buffer size of the yielder. More...
 

Protected Attributes

FMSWriteFacadewrite
 The facade for writing operations. More...
 
- Protected Attributes inherited from Yielder< T >
std::mutex mtx
 The mutex to handle concurrent push backs to the buffer vector and the yielding operation itself.
 
std::size_t bufferSize
 The number of elements that can be buffered before forcing the yield operation.
 
std::vector< T > buffer
 Where the elements are stored.
 

Detailed Description

template<typename T>
class WriteYielder< T >

Abstract class representing a write yielder. It is, a yielder which can use the FMSWriteFacade to write its output.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
TThe type of object handled by the yielder
See also
helios::filems::FMSWriteFacade

Constructor & Destructor Documentation

◆ WriteYielder()

template<typename T >
WriteYielder< T >::WriteYielder ( FMSWriteFacade write,
size_t  bufferSize = 256 
)
inline

Default constructor for the abstract write yielder.

See also
Yielder::Yielder
WriteYielder::write

Member Data Documentation

◆ write

template<typename T >
FMSWriteFacade& WriteYielder< T >::write
protected

The facade for writing operations.

See also
filems::FMSWriteFacade

The documentation for this class was generated from the following file: