DataDumper Class Reference

#include <DataDumper.h>

Collaboration diagram for DataDumper:
Collaboration graph
[legend]

List of all members.

Classes

class  iosave

Public Member Functions

 DataDumper (const TableInfo &aInfo)
 DataDumper (const TableInfo &aInfo, StringMap &aConstraints)
 ~DataDumper ()
 Destructor.
void dumpAsBinary (TableData< Numeric > &aData, const std::string &aFileName)
 Dump the merged data into a binary file for later ingest.
template<typename DataType >
void dumpAsCsv (TableData< DataType > &aData, std::ostream &aOut)
template<typename DataType >
void addDefaultRow (TableData< DataType > &aData, FitsFile &fcat)
 Dump the merged data into a binary file for later ingest.
bool isDetection (std::string name)

Private Member Functions

template<typename DataType >
bool isUnique (TableData< DataType > &aData, unsigned aRow)
void formatOut (Numeric value, const std::string &format, std::ostream &os) const
void formatOut (Metadata value, const std::string &format, std::ostream &os) const

Private Attributes

TableInfo mInfo
 The schema info.
std::list< int > mColConstList
 List of column numbers corresponding to data constraints.
std::map< std::string, int > mKeyCount
 The number of occurences for different "keys".

Detailed Description

Class to handle the procedures for dumping the contents of a data table into a CSV file. This allows the use of constraint attributes. Only one occurence of a unique combination of the list of contraints will be output.


Constructor & Destructor Documentation

DataDumper::DataDumper ( const TableInfo aInfo  ) 

Constructor initialises the object taking a schema as input with no constraints

DataDumper::DataDumper ( const TableInfo aInfo,
StringMap aConstraints 
)

Constructor initialises the object taking a schema as input with a list of constraint attributes given in the map

References TableInfo::getAttNo(), mColConstList, and mInfo.

DataDumper::~DataDumper (  ) 

Destructor.


Member Function Documentation

template<typename DataType >
void DataDumper::addDefaultRow ( TableData< DataType > &  aData,
FitsFile fcat 
) [inline]
void DataDumper::dumpAsBinary ( TableData< Numeric > &  aData,
const std::string &  aFileName 
)

Dump the merged data into a binary file for later ingest.

Referenced by extractSources().

template<typename DataType >
void DataDumper::dumpAsCsv ( TableData< DataType > &  aData,
std::ostream &  aOut 
) [inline]

Dump the contents of the input data to the output stream as comma separated variables

References TableData< DataType >::at(), formatOut(), TableInfo::getFormat(), isUnique(), mInfo, mKeyCount, TableData< DataType >::qNumCols(), and TableData< DataType >::qNumRows().

Referenced by extractMetadata(), and extractSources().

void DataDumper::formatOut ( Metadata  value,
const std::string &  format,
std::ostream &  os 
) const [private]

Send the 'Metadata' value to the output stream, in ASCII format appropriate to the given SQL format type

void DataDumper::formatOut ( Numeric  value,
const std::string &  format,
std::ostream &  os 
) const [private]

Send the 'Numeric' value to the output stream, in ASCII format appropriate to the given SQL format type

Referenced by dumpAsCsv().

bool DataDumper::isDetection ( std::string  name  ) 
template<typename DataType >
bool DataDumper::isUnique ( TableData< DataType > &  aData,
unsigned  aRow 
) [inline, private]

Member Data Documentation

std::list<int> DataDumper::mColConstList [private]

List of column numbers corresponding to data constraints.

Referenced by DataDumper(), and isUnique().

The schema info.

Referenced by addDefaultRow(), DataDumper(), and dumpAsCsv().

std::map<std::string, int> DataDumper::mKeyCount [private]

The number of occurences for different "keys".

Referenced by dumpAsCsv(), and isUnique().


The documentation for this class was generated from the following files:
Generated on Mon Oct 4 10:39:25 2010 for WfcamSrc by  doxygen 1.6.3