nidas v1.2.3
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.
 
bool receive (const Sample *samp) throw ()
 Method called to pass a sample to this client.
 
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.
 
bool receive (const Sample *samp) throw ()
 Method called to pass a sample to this client.
 
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.
 
void dumpNaked (const Sample *samp)
 
 DumpClient (const DumpClient &)
 
DumpClientoperator= (const DumpClient &)
 

Private Attributes

SampleMatcher _samples
 
format_t format
 
ostreamostr
 
const n_u::EndianConverterfromLittle
 
dsm_time_t prev_tt
 
float warntime
 
bool showdeltat
 
bool showlen
 
string timeformat
 
bool csv
 
vector< string > vnames
 
map< string, intwidths
 Map a column name to a width.
 
format_t _format
 
ostream_ostr
 
n_u::UTime _startTime
 
n_u::UTime _endTime
 
bool _dosOut
 
int _asciiPrecision
 
bool _finished
 

Member Typedef Documentation

◆ format_t [1/2]

◆ format_t [2/2]

Member Enumeration Documentation

◆ format [1/2]

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

◆ format [2/2]

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

Constructor & Destructor Documentation

◆ DumpClient() [1/3]

DumpClient::DumpClient ( const SampleMatcher & matcher,
format_t fmt,
ostream & outstr )

◆ ~DumpClient() [1/2]

virtual DumpClient::~DumpClient ( )
inlinevirtual

◆ DumpClient() [2/3]

DumpClient::DumpClient ( const DumpClient & )
private

◆ DumpClient() [3/3]

DumpClient::DumpClient ( format_t fmt,
ostream & outstr,
int asciiPrecision )

◆ ~DumpClient() [2/2]

virtual DumpClient::~DumpClient ( )
inlinevirtual

Member Function Documentation

◆ dumpNaked()

void DumpClient::dumpNaked ( const Sample * samp)
private

References ostr.

◆ finished()

bool DumpClient::finished ( ) const
inline

References _finished.

◆ flush() [1/2]

void DumpClient::flush ( )
throw ( )
inlinevirtual

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

Exceptions

)

Implements nidas::core::SampleClient.

◆ flush() [2/2]

void DumpClient::flush ( )
throw ( )
inlinevirtual

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

Exceptions

)

Implements nidas::core::SampleClient.

References _ostr.

◆ getDOS()

bool DumpClient::getDOS ( ) const
inline

References _dosOut.

◆ getWidth()

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

References widths.

Referenced by printHeader(), and setfield().

◆ operator=()

DumpClient & DumpClient::operator= ( const DumpClient & )
private

◆ printHeader() [1/2]

void DumpClient::printHeader ( )

◆ printHeader() [2/2]

void DumpClient::printHeader ( vector< const Variable * > vars)

◆ receive() [1/2]

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.

Exceptions

)

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, nidas::core::NidasApp::getApplicationInstance(), nidas::dynld::raf::IRIGSensor::getIRIGTime(), nidas::core::getSample(), nidas::dynld::raf::IRIGSensor::getStatusPtr(), nidas::dynld::raf::IRIGSensor::getUnixTime(), nidas::dynld::raf::IRIGSensor::shortStatusString(), and USECS_PER_SEC.

◆ receive() [2/2]

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.

Exceptions

)

Implements nidas::core::SampleClient.

◆ setCSV()

void DumpClient::setCSV ( bool enable)
inline

References csv.

◆ setDOS()

void DumpClient::setDOS ( bool val)
inline

◆ setEndTime()

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

◆ setfield()

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, nidas::core::getSample(), and getWidth().

Referenced by printHeader().

◆ setSensors()

void DumpClient::setSensors ( list< DSMSensor * > & sensors)

◆ setShowDeltaT()

void DumpClient::setShowDeltaT ( bool show)
inline

◆ setShowLen()

void DumpClient::setShowLen ( bool show)
inline

◆ setStartTime()

void DumpClient::setStartTime ( const n_u::UTime & val)
inline

◆ setTimeFormat()

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

◆ setWarningTime()

void DumpClient::setWarningTime ( float w)
inline

References warntime.

◆ typeToFormat()

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

Member Data Documentation

◆ _asciiPrecision

int DumpClient::_asciiPrecision
private

◆ _dosOut

bool DumpClient::_dosOut
private

Referenced by getDOS(), printHeader(), and setDOS().

◆ _endTime

n_u::UTime DumpClient::_endTime
private

Referenced by setEndTime().

◆ _finished

bool DumpClient::_finished
private

Referenced by finished().

◆ _format

format_t DumpClient::_format
private

◆ _ostr

ostream& DumpClient::_ostr
private

Referenced by flush().

◆ _samples

SampleMatcher DumpClient::_samples
private

Referenced by printHeader(), and setSensors().

◆ _startTime

n_u::UTime DumpClient::_startTime
private

Referenced by setStartTime().

◆ csv

bool DumpClient::csv
private

Referenced by printHeader(), setCSV(), and setfield().

◆ format

◆ fromLittle

const n_u::EndianConverter* DumpClient::fromLittle
private

◆ ostr

ostream& DumpClient::ostr
private

Referenced by dumpNaked(), and printHeader().

◆ prev_tt

dsm_time_t DumpClient::prev_tt
private

◆ showdeltat

bool DumpClient::showdeltat
private

Referenced by printHeader(), and setShowDeltaT().

◆ showlen

bool DumpClient::showlen
private

Referenced by printHeader(), and setShowLen().

◆ timeformat

string DumpClient::timeformat
private

Referenced by setTimeFormat().

◆ vnames

vector<string> DumpClient::vnames
private

Referenced by printHeader(), and setSensors().

◆ warntime

float DumpClient::warntime
private

Referenced by setWarningTime().

◆ widths

map<string, int> DumpClient::widths
private

Map a column name to a width.

Referenced by getWidth(), and printHeader().


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