IODA Bundle
odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER > Class Template Reference

#include <WriterDispatchingIterator.h>

Collaboration diagram for odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >:
[legend]

Public Member Functions

 WriterDispatchingIterator (OWNER &owner, int maxOpenFiles, bool append=false)
 
 ~WriterDispatchingIterator ()
 
int open ()
 
double * data ()
 
double & data (size_t i)
 
int setColumn (size_t index, std::string name, api::ColumnType type)
 
int setBitfieldColumn (size_t index, std::string name, api::ColumnType type, eckit::sql::BitfieldDef b)
 
void missingValue (size_t i, double)
 
template<typename T >
unsigned long pass1 (T &, const T &)
 
template<typename T >
void verify (T &, const T &)
 
unsigned long gatherStats (const double *values, unsigned long count)
 
int close ()
 
api::ColumnType columnType (size_t index)
 
const std::string & columnName (size_t index) const
 
const std::string & codecName (size_t index) const
 
double columnMissingValue (size_t index)
 
const core::MetaDatacolumns () const
 
const core::MetaDatacolumns (const core::MetaData &md)
 
OWNER & owner ()
 
void property (std::string key, std::string value)
 
std::string property (std::string)
 
std::vector< eckit::PathName > outputFiles ()
 
TemplateParameterstemplateParameters ()
 
size_t rowDataSizeDoubles () const
 
size_t dataOffset (size_t i) const
 The offset of a given column in the doubles[] data array. More...
 
void writeHeader ()
 
int writeRow (const double *values, unsigned long count)
 
unsigned long pass1 (T &it, const T &end)
 
void verify (T &it, const T &end)
 

Protected Member Functions

bool next ()
 
WRITE_ITERATOR & dispatch (const double *values, unsigned long count)
 Find iterator data should be dispatched to. More...
 
int dispatchIndex (const double *values, unsigned long count)
 
int createIterator (const Values &dispatchedValues, const std::string &fileName)
 
std::string generateFileName (const double *values, unsigned long count)
 

Protected Attributes

OWNER & owner_
 
Writer< WRITE_ITERATOR > iteratorsOwner_
 
core::MetaData columns_
 
double * lastValues_
 
double * nextRow_
 
size_t * columnOffsets_
 
unsigned long long nrows_
 
std::string outputFileTemplate_
 
core::Properties properties_
 
std::vector< int > dispatchedIndexes_
 
Values2IteratorIndex values2iteratorIndex_
 
std::vector< unsigned long long > lastDispatch_
 
std::vector< std::string > iteratorIndex2fileName_
 
Values lastDispatchedValues_
 
int lastIndex_
 
bool initialized_
 
bool append_
 

Private Types

typedef std::vector< double > Values
 
typedef std::map< Values, int > Values2IteratorIndex
 
typedef std::vector< WRITE_ITERATOR * > Iterators
 

Private Member Functions

 WriterDispatchingIterator (const WriterDispatchingIterator &)
 
WriterDispatchingIteratoroperator= (const WriterDispatchingIterator &)
 
void parseTemplateParameters ()
 

Private Attributes

int refCount_
 
Iterators iterators_
 
std::vector< eckit::PathName > files_
 
TemplateParameters templateParameters_
 
int maxOpenFiles_
 
std::map< std::string, int > filesCreated_
 

Friends

class IteratorProxy< WriterDispatchingIterator< WRITE_ITERATOR, DispatchingWriter >, DispatchingWriter >
 

Detailed Description

template<typename WRITE_ITERATOR, typename OWNER>
class odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >

Definition at line 36 of file WriterDispatchingIterator.h.

Member Typedef Documentation

◆ Iterators

template<typename WRITE_ITERATOR , typename OWNER >
typedef std::vector<WRITE_ITERATOR *> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::Iterators
private

Definition at line 40 of file WriterDispatchingIterator.h.

◆ Values

template<typename WRITE_ITERATOR , typename OWNER >
typedef std::vector<double> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::Values
private

Definition at line 38 of file WriterDispatchingIterator.h.

◆ Values2IteratorIndex

template<typename WRITE_ITERATOR , typename OWNER >
typedef std::map<Values,int> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::Values2IteratorIndex
private

Definition at line 39 of file WriterDispatchingIterator.h.

Constructor & Destructor Documentation

◆ WriterDispatchingIterator() [1/2]

template<typename WRITE_ITERATOR , typename OWNER >
odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::WriterDispatchingIterator ( OWNER &  owner,
int  maxOpenFiles,
bool  append = false 
)

Definition at line 47 of file WriterDispatchingIterator.cc.

◆ ~WriterDispatchingIterator()

template<typename WRITE_ITERATOR , typename OWNER >
odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::~WriterDispatchingIterator

Definition at line 255 of file WriterDispatchingIterator.cc.

◆ WriterDispatchingIterator() [2/2]

template<typename WRITE_ITERATOR , typename OWNER >
odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::WriterDispatchingIterator ( const WriterDispatchingIterator< WRITE_ITERATOR, OWNER > &  )
private

Member Function Documentation

◆ close()

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::close

Definition at line 547 of file WriterDispatchingIterator.cc.

Here is the caller graph for this function:

◆ codecName()

template<typename WRITE_ITERATOR , typename OWNER >
const std::string& odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::codecName ( size_t  index) const

◆ columnMissingValue()

template<typename WRITE_ITERATOR , typename OWNER >
double odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::columnMissingValue ( size_t  index)

◆ columnName()

template<typename WRITE_ITERATOR , typename OWNER >
const std::string& odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::columnName ( size_t  index) const

◆ columns() [1/2]

template<typename WRITE_ITERATOR , typename OWNER >
const core::MetaData& odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::columns ( ) const
inline

Definition at line 66 of file WriterDispatchingIterator.h.

◆ columns() [2/2]

template<typename WRITE_ITERATOR , typename OWNER >
const MetaData & odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::columns ( const core::MetaData md)

Definition at line 407 of file WriterDispatchingIterator.cc.

◆ columnType()

template<typename WRITE_ITERATOR , typename OWNER >
api::ColumnType odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::columnType ( size_t  index)

◆ createIterator()

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::createIterator ( const Values dispatchedValues,
const std::string &  fileName 
)
protected

Definition at line 167 of file WriterDispatchingIterator.cc.

◆ data() [1/2]

template<typename WRITE_ITERATOR , typename OWNER >
double * odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::data

Definition at line 322 of file WriterDispatchingIterator.cc.

Here is the caller graph for this function:

◆ data() [2/2]

template<typename WRITE_ITERATOR , typename OWNER >
double & odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::data ( size_t  i)

Definition at line 325 of file WriterDispatchingIterator.cc.

Here is the caller graph for this function:

◆ dataOffset()

template<typename WRITE_ITERATOR , typename OWNER >
size_t odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::dataOffset ( size_t  i) const
inline

The offset of a given column in the doubles[] data array.

Definition at line 81 of file WriterDispatchingIterator.h.

◆ dispatch()

template<typename WRITE_ITERATOR , typename OWNER >
WRITE_ITERATOR & odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::dispatch ( const double *  values,
unsigned long  count 
)
protected

Find iterator data should be dispatched to.

Definition at line 140 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ dispatchIndex()

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::dispatchIndex ( const double *  values,
unsigned long  count 
)
protected

Definition at line 146 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ gatherStats()

template<typename WRITE_ITERATOR , typename OWNER >
unsigned long odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::gatherStats ( const double *  values,
unsigned long  count 
)

Definition at line 266 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ generateFileName()

template<typename WRITE_ITERATOR , typename OWNER >
std::string odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::generateFileName ( const double *  values,
unsigned long  count 
)
protected

Definition at line 100 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ missingValue()

template<typename WRITE_ITERATOR , typename OWNER >
void odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::missingValue ( size_t  i,
double  missingValue 
)

Definition at line 414 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ next()

template<typename WRITE_ITERATOR , typename OWNER >
bool odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::next
protected

Definition at line 299 of file WriterDispatchingIterator.cc.

◆ open()

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::open

Definition at line 356 of file WriterDispatchingIterator.cc.

◆ operator=()

template<typename WRITE_ITERATOR , typename OWNER >
WriterDispatchingIterator& odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::operator= ( const WriterDispatchingIterator< WRITE_ITERATOR, OWNER > &  )
private

◆ outputFiles()

template<typename WRITE_ITERATOR , typename OWNER >
std::vector< eckit::PathName > odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::outputFiles

Definition at line 246 of file WriterDispatchingIterator.cc.

◆ owner()

template<typename WRITE_ITERATOR , typename OWNER >
OWNER& odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::owner ( )
inline

Definition at line 69 of file WriterDispatchingIterator.h.

◆ parseTemplateParameters()

template<typename WRITE_ITERATOR , typename OWNER >
void odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::parseTemplateParameters
private

Definition at line 305 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ pass1() [1/2]

template<typename WRITE_ITERATOR , typename OWNER >
template<typename T >
unsigned long odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::pass1 ( T &  ,
const T &   
)

◆ pass1() [2/2]

unsigned long odc::WriterDispatchingIterator< WriterBufferingIterator, DispatchingWriter >::pass1 ( T &  it,
const T &  end 
)

Definition at line 425 of file WriterDispatchingIterator.cc.

◆ property() [1/2]

template<typename WRITE_ITERATOR , typename OWNER >
void odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::property ( std::string  key,
std::string  value 
)

Definition at line 537 of file WriterDispatchingIterator.cc.

◆ property() [2/2]

template<typename WRITE_ITERATOR , typename OWNER >
std::string odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::property ( std::string  key)

Definition at line 544 of file WriterDispatchingIterator.cc.

◆ rowDataSizeDoubles()

template<typename WRITE_ITERATOR , typename OWNER >
size_t odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::rowDataSizeDoubles

Definition at line 330 of file WriterDispatchingIterator.cc.

◆ setBitfieldColumn()

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::setBitfieldColumn ( size_t  index,
std::string  name,
api::ColumnType  type,
eckit::sql::BitfieldDef  b 
)

Definition at line 86 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ setColumn()

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::setColumn ( size_t  index,
std::string  name,
api::ColumnType  type 
)

Definition at line 74 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ templateParameters()

template<typename WRITE_ITERATOR , typename OWNER >
TemplateParameters& odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::templateParameters ( )
inline

Definition at line 76 of file WriterDispatchingIterator.h.

◆ verify() [1/2]

template<typename WRITE_ITERATOR , typename OWNER >
template<typename T >
void odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::verify ( T &  ,
const T &   
)

◆ verify() [2/2]

void odc::WriterDispatchingIterator< WriterBufferingIterator, DispatchingWriter >::verify ( T &  it,
const T &  end 
)

Definition at line 471 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ writeHeader()

template<typename WRITE_ITERATOR , typename OWNER >
void odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::writeHeader

Definition at line 272 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

◆ writeRow()

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::writeRow ( const double *  values,
unsigned long  count 
)

Definition at line 341 of file WriterDispatchingIterator.cc.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ IteratorProxy< WriterDispatchingIterator< WRITE_ITERATOR, DispatchingWriter >, DispatchingWriter >

template<typename WRITE_ITERATOR , typename OWNER >
friend class IteratorProxy< WriterDispatchingIterator< WRITE_ITERATOR, DispatchingWriter >, DispatchingWriter >
friend

Definition at line 134 of file WriterDispatchingIterator.h.

Member Data Documentation

◆ append_

template<typename WRITE_ITERATOR , typename OWNER >
bool odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::append_
protected

Definition at line 117 of file WriterDispatchingIterator.h.

◆ columnOffsets_

template<typename WRITE_ITERATOR , typename OWNER >
size_t* odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::columnOffsets_
protected

Definition at line 103 of file WriterDispatchingIterator.h.

◆ columns_

template<typename WRITE_ITERATOR , typename OWNER >
core::MetaData odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::columns_
protected

Definition at line 100 of file WriterDispatchingIterator.h.

◆ dispatchedIndexes_

template<typename WRITE_ITERATOR , typename OWNER >
std::vector<int> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::dispatchedIndexes_
protected

Definition at line 109 of file WriterDispatchingIterator.h.

◆ files_

template<typename WRITE_ITERATOR , typename OWNER >
std::vector<eckit::PathName> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::files_
private

Definition at line 129 of file WriterDispatchingIterator.h.

◆ filesCreated_

template<typename WRITE_ITERATOR , typename OWNER >
std::map<std::string,int> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::filesCreated_
private

Definition at line 134 of file WriterDispatchingIterator.h.

◆ initialized_

template<typename WRITE_ITERATOR , typename OWNER >
bool odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::initialized_
protected

Definition at line 116 of file WriterDispatchingIterator.h.

◆ iteratorIndex2fileName_

template<typename WRITE_ITERATOR , typename OWNER >
std::vector<std::string> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::iteratorIndex2fileName_
protected

Definition at line 112 of file WriterDispatchingIterator.h.

◆ iterators_

template<typename WRITE_ITERATOR , typename OWNER >
Iterators odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::iterators_
private

Definition at line 128 of file WriterDispatchingIterator.h.

◆ iteratorsOwner_

template<typename WRITE_ITERATOR , typename OWNER >
Writer<WRITE_ITERATOR> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::iteratorsOwner_
protected

Definition at line 99 of file WriterDispatchingIterator.h.

◆ lastDispatch_

template<typename WRITE_ITERATOR , typename OWNER >
std::vector<unsigned long long> odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::lastDispatch_
protected

Definition at line 111 of file WriterDispatchingIterator.h.

◆ lastDispatchedValues_

template<typename WRITE_ITERATOR , typename OWNER >
Values odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::lastDispatchedValues_
protected

Definition at line 114 of file WriterDispatchingIterator.h.

◆ lastIndex_

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::lastIndex_
protected

Definition at line 115 of file WriterDispatchingIterator.h.

◆ lastValues_

template<typename WRITE_ITERATOR , typename OWNER >
double* odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::lastValues_
protected

Definition at line 101 of file WriterDispatchingIterator.h.

◆ maxOpenFiles_

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::maxOpenFiles_
private

Definition at line 132 of file WriterDispatchingIterator.h.

◆ nextRow_

template<typename WRITE_ITERATOR , typename OWNER >
double* odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::nextRow_
protected

Definition at line 102 of file WriterDispatchingIterator.h.

◆ nrows_

template<typename WRITE_ITERATOR , typename OWNER >
unsigned long long odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::nrows_
protected

Definition at line 104 of file WriterDispatchingIterator.h.

◆ outputFileTemplate_

template<typename WRITE_ITERATOR , typename OWNER >
std::string odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::outputFileTemplate_
protected

Definition at line 105 of file WriterDispatchingIterator.h.

◆ owner_

template<typename WRITE_ITERATOR , typename OWNER >
OWNER& odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::owner_
protected

Definition at line 98 of file WriterDispatchingIterator.h.

◆ properties_

template<typename WRITE_ITERATOR , typename OWNER >
core::Properties odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::properties_
protected

Definition at line 107 of file WriterDispatchingIterator.h.

◆ refCount_

template<typename WRITE_ITERATOR , typename OWNER >
int odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::refCount_
private

Definition at line 126 of file WriterDispatchingIterator.h.

◆ templateParameters_

template<typename WRITE_ITERATOR , typename OWNER >
TemplateParameters odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::templateParameters_
private

Definition at line 131 of file WriterDispatchingIterator.h.

◆ values2iteratorIndex_

template<typename WRITE_ITERATOR , typename OWNER >
Values2IteratorIndex odc::WriterDispatchingIterator< WRITE_ITERATOR, OWNER >::values2iteratorIndex_
protected

Definition at line 110 of file WriterDispatchingIterator.h.


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