cfDeviceData Class Reference

List of all members.

Public Member Functions

 cfDeviceData (const std::string &line, int delayadd, bool exitUnpackError=false, bool verboseIn=false)
virtual ~cfDeviceData ()
std::string DeviceName () const
std::string DeviceFullName () const
msTimeStamp_t TimeStamp () const
bool IsScalar () const
const std::vector< double > & Values () const
bool IsSame (const cfDeviceData &other) const
const std::string Data () const
bool IsCorrupt () const

Protected Member Functions

void Unpack (int delayadd)

Protected Attributes

std::string ddata
std::string device
std::string units
msTimeStamp_t tsms
std::vector< double > values
bool unpackerr
bool exiterr
bool verbose

Detailed Description

Definition at line 242 of file cf2rr.cc.


Constructor & Destructor Documentation

cfDeviceData::cfDeviceData ( const std::string &  line,
int  delayadd,
bool  exitUnpackError = false,
bool  verboseIn = false 
) [inline]

Definition at line 244 of file cf2rr.cc.

References Unpack().

00245                                                                  : 
00246     ddata(line), tsms(0), unpackerr(false), exiterr(exitUnpackError), verbose(verboseIn) { Unpack(delayadd); }

cfDeviceData::~cfDeviceData (  )  [virtual]

Definition at line 735 of file cf2rr.cc.

00735                             {
00736   //if ( verbose ) {
00737   //  std::cerr << "~cfDeviceData() deleting " << DeviceName() << std::endl;
00738   //}
00739 }


Member Function Documentation

const std::string cfDeviceData::Data (  )  const [inline]

Definition at line 256 of file cf2rr.cc.

References ddata.

Referenced by cfEventData::AdoptDeviceData().

00256 { return ddata; }

std::string cfDeviceData::DeviceFullName (  )  const [inline]

Definition at line 250 of file cf2rr.cc.

References device.

Referenced by cfEventData::AdoptDeviceData(), cfProcessor::ReadOneFile(), and cfProcessor::SendToRotorooter().

00250 { return device; }

std::string cfDeviceData::DeviceName (  )  const

Definition at line 836 of file cf2rr.cc.

References device, and IsScalar().

00836                                          {
00837   std::string devtrim = device;
00838   if ( ! IsScalar() ) {
00839     devtrim.erase( devtrim.find_first_of(" []"), devtrim.length() );
00840   }
00841   return devtrim;
00842 }

bool cfDeviceData::IsCorrupt (  )  const [inline]

Definition at line 258 of file cf2rr.cc.

References unpackerr.

Referenced by cfProcessor::ReadOneFile().

00258 { return unpackerr; }

bool cfDeviceData::IsSame ( const cfDeviceData other  )  const

Definition at line 848 of file cf2rr.cc.

References AreDoublesSame(), device, tsms, units, and values.

00848                                                          {
00849 
00850   //if ( ddata != other.ddata ) return false;
00851   // with time offsets in the string we must instead compare unpacked values
00852   if ( device != other.device ) return false;
00853   if ( units  != other.units  ) return false;
00854   if ( tsms   != other.tsms   ) return false;
00855   size_t nv1 = values.size();
00856   size_t nv2 = other.values.size();
00857   if ( nv1    != nv2          ) return false;
00858   for (size_t i=0; i < nv1; ++i ) {
00859     // quick check for exact match
00860     if ( values[i] != other.values[i] ) {
00861       // this should do a better comparison ... are they close enough
00862       if ( ! AreDoublesSame(values[i],other.values[i]) ) return false;
00863     }
00864   }
00865 
00866   return true;
00867 }

bool cfDeviceData::IsScalar (  )  const

Definition at line 844 of file cf2rr.cc.

References device.

Referenced by DeviceName().

00844                                   {
00845   return ( device.find_first_of("[]") == std::string::npos );
00846 }

msTimeStamp_t cfDeviceData::TimeStamp (  )  const [inline]

Definition at line 251 of file cf2rr.cc.

References tsms.

Referenced by cfProcessor::SendToRotorooter().

00251 { return tsms; }

void cfDeviceData::Unpack ( int  delayadd  )  [protected]

Referenced by cfDeviceData().

const std::vector<double>& cfDeviceData::Values (  )  const [inline]

Definition at line 253 of file cf2rr.cc.

References values.

00253 { return values; }


Member Data Documentation

std::string cfDeviceData::ddata [protected]

Definition at line 263 of file cf2rr.cc.

Referenced by Data().

std::string cfDeviceData::device [protected]

Definition at line 264 of file cf2rr.cc.

Referenced by DeviceFullName(), DeviceName(), IsSame(), and IsScalar().

bool cfDeviceData::exiterr [protected]

Definition at line 270 of file cf2rr.cc.

Definition at line 266 of file cf2rr.cc.

Referenced by IsSame(), and TimeStamp().

std::string cfDeviceData::units [protected]

Definition at line 265 of file cf2rr.cc.

Referenced by IsSame().

bool cfDeviceData::unpackerr [protected]

Definition at line 269 of file cf2rr.cc.

Referenced by IsCorrupt().

std::vector<double> cfDeviceData::values [protected]

Definition at line 267 of file cf2rr.cc.

Referenced by IsSame(), and Values().

bool cfDeviceData::verbose [protected]

Definition at line 271 of file cf2rr.cc.


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

Generated on 24 Jul 2018 for loon by  doxygen 1.6.1