nidas  v1.2-1520
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
DumpClient Class Reference
Inheritance diagram for DumpClient:
Inheritance graph
[legend]

Public Types

enum  format {
  DEFAULT, ASCII, HEX_FMT, SIGNED_SHORT,
  UNSIGNED_SHORT, FLOAT, IRIG, INT32,
  ASCII_7, NAKED, ASCII, BINARY1,
  BINARY2
}
 
enum  format {
  DEFAULT, ASCII, HEX_FMT, SIGNED_SHORT,
  UNSIGNED_SHORT, FLOAT, IRIG, INT32,
  ASCII_7, NAKED, ASCII, BINARY1,
  BINARY2
}
 
typedef enum DumpClient::format format_t
 
typedef enum DumpClient::format format_t
 

Public Member Functions

 DumpClient (const SampleMatcher &, format_t, ostream &)
 
virtual ~DumpClient ()
 
void flush () throw ()
 Ask that this SampleClient send out any buffered Samples that it may be holding. More...
 
bool receive (const Sample *samp) throw ()
 Method called to pass a sample to this client. More...
 
void printHeader ()
 
DumpClient::format_t typeToFormat (sampleType t)
 
void setWarningTime (float w)
 
void setShowDeltaT (bool show)
 
void setShowLen (bool show)
 
void setTimeFormat (const std::string &fmt)
 
void setCSV (bool enable)
 
void setSensors (list< DSMSensor * > &sensors)
 
 DumpClient (format_t, ostream &, int asciiPrecision)
 
virtual ~DumpClient ()
 
void flush () throw ()
 Ask that this SampleClient send out any buffered Samples that it may be holding. More...
 
bool receive (const Sample *samp) throw ()
 Method called to pass a sample to this client. More...
 
void printHeader (vector< const Variable * > vars)
 
void setStartTime (const n_u::UTime &val)
 
void setEndTime (const n_u::UTime &val)
 
void setDOS (bool val)
 
bool getDOS () const
 
bool finished () const
 

Private Member Functions

int getWidth (const std::string &name)
 
std::ostream & setfield (std::ostream &out, const std::string &name, int width=0)
 Setup the ostream for the given field, depending on the field separator and field width. More...
 
void dumpNaked (const Sample *samp)
 
 DumpClient (const DumpClient &)
 
DumpClientoperator= (const DumpClient &)
 

Private Attributes

SampleMatcher _samples
 
format_t format
 
ostream & ostr
 
const n_u::EndianConverterfromLittle
 
dsm_time_t prev_tt
 
float warntime
 
bool showdeltat
 
bool showlen
 
string timeformat
 
bool csv
 
vector< string > vnames
 
map< string, int > widths
 Map a column name to a width. More...
 
format_t _format
 
ostream & _ostr
 
n_u::UTime _startTime
 
n_u::UTime _endTime
 
bool _checkStart
 
bool _checkEnd
 
bool _dosOut
 
int _asciiPrecision
 
bool _finished
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
DEFAULT 
ASCII 
HEX_FMT 
SIGNED_SHORT 
UNSIGNED_SHORT 
FLOAT 
IRIG 
INT32 
ASCII_7 
NAKED 
ASCII 
BINARY1 
BINARY2 
Enumerator
DEFAULT 
ASCII 
HEX_FMT 
SIGNED_SHORT 
UNSIGNED_SHORT 
FLOAT 
IRIG 
INT32 
ASCII_7 
NAKED 
ASCII 
BINARY1 
BINARY2 

Constructor & Destructor Documentation

DumpClient::DumpClient ( const SampleMatcher matcher,
format_t  fmt,
ostream &  outstr 
)
virtual DumpClient::~DumpClient ( )
inlinevirtual
DumpClient::DumpClient ( const DumpClient )
private
DumpClient::DumpClient ( format_t  fmt,
ostream &  outstr,
int  asciiPrecision 
)
virtual DumpClient::~DumpClient ( )
inlinevirtual

Member Function Documentation

void DumpClient::dumpNaked ( const Sample samp)
private
bool DumpClient::finished ( ) const
inline

Referenced by DataPrep::run().

void DumpClient::flush ( )
throw (
)
inlinevirtual

Ask that this SampleClient send out any buffered Samples that it may be holding.

Implements nidas::core::SampleClient.

void DumpClient::flush ( )
throw (
)
inlinevirtual

Ask that this SampleClient send out any buffered Samples that it may be holding.

Implements nidas::core::SampleClient.

bool DumpClient::getDOS ( ) const
inline
int DumpClient::getWidth ( const std::string &  name)
inlineprivate

Referenced by printHeader(), and setfield().

DumpClient& DumpClient::operator= ( const DumpClient )
private
void DumpClient::printHeader ( vector< const Variable * >  vars)
void DumpClient::printHeader ( )
bool DumpClient::receive ( const Sample s)
throw (
)
virtual

Method called to pass a sample to this client.

This method is typically called by a SampleSource for each of its SampleClients when it has a sample ready. Returns true: success false: sample rejected. This is meant to signal a warning-type situation - like a socket not being available temporarily. True errors will be thrown as an IOException.

Implements nidas::core::SampleClient.

bool DumpClient::receive ( const Sample s)
throw (
)
virtual

Method called to pass a sample to this client.

This method is typically called by a SampleSource for each of its SampleClients when it has a sample ready. Returns true: success false: sample rejected. This is meant to signal a warning-type situation - like a socket not being available temporarily. True errors will be thrown as an IOException.

Implements nidas::core::SampleClient.

References nidas::util::addBackslashSequences(), nidas::core::DOUBLE_ST, nidas::core::FLOAT_ST, nidas::util::UTime::format(), nidas::core::NidasApp::formatSampleId(), GET_DSM_ID, and USECS_PER_SEC.

void DumpClient::setCSV ( bool  enable)
inline
void DumpClient::setDOS ( bool  val)
inline

Referenced by DataPrep::run().

void DumpClient::setEndTime ( const n_u::UTime val)
inline

Referenced by DataPrep::run().

std::ostream & DumpClient::setfield ( std::ostream &  out,
const std::string &  name,
int  width = 0 
)
private

Setup the ostream for the given field, depending on the field separator and field width.

References csv, and getWidth().

Referenced by printHeader().

void DumpClient::setSensors ( list< DSMSensor * > &  sensors)
void DumpClient::setShowDeltaT ( bool  show)
inline
void DumpClient::setShowLen ( bool  show)
inline
void DumpClient::setStartTime ( const n_u::UTime val)
inline

Referenced by DataPrep::run().

void DumpClient::setTimeFormat ( const std::string &  fmt)
inline
void DumpClient::setWarningTime ( float  w)
inline

Referenced by DataDump::run().

DumpClient::format_t DumpClient::typeToFormat ( sampleType  t)

Member Data Documentation

int DumpClient::_asciiPrecision
private
bool DumpClient::_checkEnd
private
bool DumpClient::_checkStart
private
bool DumpClient::_dosOut
private

Referenced by printHeader().

n_u::UTime DumpClient::_endTime
private
bool DumpClient::_finished
private
format_t DumpClient::_format
private
ostream& DumpClient::_ostr
private
SampleMatcher DumpClient::_samples
private

Referenced by printHeader(), and setSensors().

n_u::UTime DumpClient::_startTime
private
bool DumpClient::csv
private

Referenced by printHeader(), and setfield().

const n_u::EndianConverter* DumpClient::fromLittle
private
ostream& DumpClient::ostr
private

Referenced by dumpNaked(), and printHeader().

dsm_time_t DumpClient::prev_tt
private
bool DumpClient::showdeltat
private

Referenced by printHeader().

bool DumpClient::showlen
private

Referenced by printHeader().

string DumpClient::timeformat
private
vector<string> DumpClient::vnames
private

Referenced by printHeader(), and setSensors().

float DumpClient::warntime
private
map<string, int> DumpClient::widths
private

Map a column name to a width.

Referenced by printHeader().


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