nidas  v1.2-1520
Classes | Namespaces | Macros | Typedefs | Functions | Variables
Sample.h File Reference
#include "SampleLengthException.h"
#include <nidas/util/ThreadSupport.h>
#include <nidas/util/MutexCount.h>
#include <nidas/util/time_constants.h>
#include <nidas/linux/types.h>
#include <climits>
#include <iostream>
#include <cstring>
#include <cmath>
#include "sample_type_traits.h"
#include "SamplePool.h"

Go to the source code of this file.

Classes

class  nidas::core::SampleHeader
 The gcc buildin atomic operations are not supported on arm, and one must use -march=i686 for them to work on 32 bit x86. More...
 
class  nidas::core::Sample
 Interface to a data sample. More...
 
class  nidas::core::SampleT< DataT >
 A typed Sample, with data of type DataT. More...
 

Namespaces

 nidas
 Root namespace for the NCAR In-Situ Data Acquisition Software.
 
 nidas::core
 The essential core classes of nidas.
 

Macros

#define GET_SAMPLE_TYPE(tid)   ((tid) >> 26)
 macros to get and set fields of the tid member of a Sample. More...
 
#define SET_SAMPLE_TYPE(tid, val)   (((tid) & 0x03ffffff) | ((unsigned int)(val) << 26))
 
#define GET_FULL_ID(tid)   ((tid) & 0x03ffffff)
 
#define SET_FULL_ID(tid, val)   (((tid) & 0xfc000000) | ((val) & 0x03ffffff))
 
#define GET_DSM_ID(tid)   (((tid) & 0x03ff0000) >> 16)
 
#define SET_DSM_ID(tid, val)   (((tid) & 0xfc00ffff) | (((unsigned int)(val) & 0x3ff) << 16))
 
#define GET_SPS_ID(tid)   ((tid) & 0xffff)
 
#define GET_SHORT_ID(tid)   ((tid) & 0xffff)
 
#define SET_SPS_ID(tid, val)   (((tid) & 0xffff0000) | ((val) & 0xffff))
 
#define SET_SHORT_ID(tid, val)   (((tid) & 0xffff0000) | ((val) & 0xffff))
 
#define MUTEX_PROTECT_REF_COUNTS
 Whether to use mutexes to make sure the reference count increments and decrement-and-test operations are atomic. More...
 

Typedefs

typedef long long nidas::core::dsm_time_t
 Posix time in microseconds, the number of non-leap microseconds since 1970 Jan 1 00:00 UTC. More...
 
typedef unsigned int nidas::core::dsm_sample_id_t
 

Functions

Samplenidas::core::getSample (sampleType type, unsigned int len)
 A convienence method for getting a sample of an enumerated type from a pool. More...
 
template<class T >
SampleT< T > * nidas::core::getSample (unsigned int len)
 A convenience function for getting a typed sample from a pool. More...
 

Variables

const float nidas::core::floatNAN = nanf("")
 Value of a float NAN for general use. More...
 
const double nidas::core::doubleNAN = nan("")
 

Macro Definition Documentation

#define GET_DSM_ID (   tid)    (((tid) & 0x03ff0000) >> 16)

Referenced by nidas::dynld::StatisticsProcessor::addRequestedSampleTag(), nidas::dynld::isff::GOESOutput::addRequestedSampleTag(), nidas::core::SampleClock::addSampleDate(), nidas::core::DSMSensor::addSampleTag(), nidas::core::TimetagAdjuster::adjust(), nidas::dynld::StatisticsCruncher::attach(), PacketReader::checkPacket(), SampleCounter::collectMetadata(), nidas::core::SamplePipeline::connect(), nidas::core::NearestResamplerAtRate::connect(), nidas::dynld::raf::CVIProcessor::connectSource(), nidas::core::NearestResampler::ctorCommon(), nidas::core::NearestResamplerAtRate::ctorCommon(), nidas::core::Site::findSensor(), nidas::core::NidasApp::formatId(), nidas::core::SampleTag::fromDOMElement(), SampleCounter::generateStreamId(), nidas::core::SampleHeader::getDSMId(), nidas::core::SampleTag::getDSMId(), nidas::core::DSMSensor::getDSMId(), nidas::core::Project::getUniqueSampleId(), nidas::dynld::ParoSci_202BG_P::init(), nidas::dynld::ParoSci_202BG_T::init(), nidas::core::BadSampleFilter::invalidSampleHeader(), nidas::core::TimetagAdjuster::log(), nidas::core::SampleMatcher::match(), nidas::core::SampleTracer::msg(), nidas::core::operator<<(), DataStats::printReport(), nidas::dynld::isff::Wind2D::process(), nidas::dynld::isff::WisardMote::process(), nidas::dynld::AsciiOutput::receive(), DumpClient::receive(), nidas::core::NearestResampler::receive(), nidas::core::SampleSorter::receive(), nidas::core::NearestResamplerAtRate::receive(), MergeVerifier::reportBackward(), MergeVerifier::reportDuplicate(), MergeVerifier::reportMissing(), SensorExtract::run(), nidas::core::SampleSorter::run(), nidas::dynld::raf::SyncRecordSource::selectVariablesFromSensor(), nidas::dynld::isff::Wind2D::validateSscanfs(), nidas::dynld::WxtSensor::wxtValidateSscanfs(), and nidas::dynld::raf::SyncRecordSource::~SyncRecordSource().

#define GET_FULL_ID (   tid)    ((tid) & 0x03ffffff)
#define GET_SAMPLE_TYPE (   tid)    ((tid) >> 26)

macros to get and set fields of the tid member of a Sample.

The 32 bit unsigned int tid is made of two fields: 26 least significant bits containing the FULL_ID 6 most significant bits containing a SAMPLE_TYPE enumeration (0-63) The FULL_ID field is further split into a DSM id and sensor-plus-sample (SPS) id: 10 most significant bits containing the DSM_ID (0-1023) 16 least significant bits containing the SPS_ID (0-65535)

Referenced by nidas::core::SampleHeader::getType().

#define GET_SHORT_ID (   tid)    ((tid) & 0xffff)
#define GET_SPS_ID (   tid)    ((tid) & 0xffff)
#define MUTEX_PROTECT_REF_COUNTS

Whether to use mutexes to make sure the reference count increments and decrement-and-test operations are atomic.

#define SET_DSM_ID (   tid,
  val 
)    (((tid) & 0xfc00ffff) | (((unsigned int)(val) & 0x3ff) << 16))
#define SET_FULL_ID (   tid,
  val 
)    (((tid) & 0xfc000000) | ((val) & 0x03ffffff))
#define SET_SAMPLE_TYPE (   tid,
  val 
)    (((tid) & 0x03ffffff) | ((unsigned int)(val) << 26))
#define SET_SHORT_ID (   tid,
  val 
)    (((tid) & 0xffff0000) | ((val) & 0xffff))
#define SET_SPS_ID (   tid,
  val 
)    (((tid) & 0xffff0000) | ((val) & 0xffff))