Relacs DAQ Library  0.9.8
Classes | Public Member Functions | Friends | List of all members
InList Class Reference

#include <inlist.h>

Public Member Functions

 InList (void)
 
 InList (InData &data)
 
 InList (InData *data, bool own=false)
 
 InList (const InList *il)
 
 InList (const InList &il)
 
 ~InList (void)
 
int size (void) const
 
bool empty (void) const
 
void resize (int n, int m=0, int w=0, double step=1.0)
 
void clear (void)
 
InListoperator= (const InList &il)
 
InListassign (const InList *il)
 
InListassign (void)
 
const InDataoperator[] (int i) const
 
InDataoperator[] (int i)
 
const InDatafront (void) const
 
InDatafront (void)
 
const InDataback (void) const
 
InDataback (void)
 
const InDataoperator[] (const string &ident) const
 
InDataoperator[] (const string &ident)
 
int index (const string &ident) const
 
void push (InData &data)
 
void push (const InList &traces)
 
void add (InData *data, bool own=false)
 
void add (const InData *data, bool own=false)
 
void add (const InList &traces, bool own=false)
 
void set (int index, const InData *data, bool own=false)
 
void assign (int index, const InData *data)
 
void erase (int index)
 
void update (void)
 
void updateRaw (void)
 
void updateDerived (void)
 
void clearBuffer (void)
 
void sortByChannel (void)
 
void sortByDeviceChannel (void)
 
double currentTime (void) const
 
double currentTimeRaw (void) const
 
void setDevice (int device)
 
void setReference (InData::RefType ref)
 
void setUnipolar (bool unipolar)
 
void setStartSource (int startsource)
 
void setDelay (double delay)
 
void setPriority (bool priority=true)
 
void setSampleRate (double rate)
 
void setSampleInterval (double step)
 
void setContinuous (bool continuous=true)
 
void setScale (double scale)
 
void setUnit (const string &unit)
 
void setUnit (double scale, const string &unit)
 
void setReadTime (double time)
 
void setUpdateTime (double time)
 
void clearMode (void)
 
void setMode (int flags)
 
void addMode (int flags)
 
void delMode (int flags)
 
void setSignalIndex (int index)
 
void setSignalTime (double time)
 
void setRestart (void)
 
void setRestartTime (double restarttime)
 
string errorText (void) const
 
void clearError (void)
 
void setError (long long flags)
 
void addError (long long flags)
 
void delError (long long flags)
 
void addDaqError (int de)
 
void setErrorStr (const string &strg)
 
void addErrorStr (const string &strg)
 
void setErrorStr (int errnum)
 
void addErrorStr (int errnum)
 
bool success (void) const
 
bool failed (void) const
 

Friends

ostream & operator<< (ostream &str, const InList &il)
 
bool lessChannelILE (const ILE &a, const ILE &b)
 
bool lessDeviceChannelILE (const ILE &a, const ILE &b)
 

Detailed Description

A container for InData.

Author
Jan Benda

Constructor & Destructor Documentation

InList ( void  )

Constructs an empty InList.

InList ( InData data)

Constructs an InList containing the single InData data.

See Also
push( InData& )

References InList::push().

InList ( InData data,
bool  own = false 
)

Constructs an InList containing the single pointer data. Setting own to true transfers the ownership to the InList.

See Also
add( InData* )

References InList::add().

InList ( const InList il)

Copies il to this with copying pointers to the data buffers only.

InList ( const InList il)

Copy constructor.

~InList ( void  )

Destructor.

References InList::clear().

Member Function Documentation

int size ( void  ) const
inline
bool empty ( void  ) const
inline

True if there are no InData contained in the InList.

void resize ( int  n,
int  m = 0,
int  w = 0,
double  step = 1.0 
)

Resize the InList such that it contains n InData. If n equals zero, clear() is called. If a larger size than the current size() is requested than empty InData are appended, each of capacity m, size of write buffer w, and sampling interval step seconds.

See Also
clear(), size(), empty()

References InList::clear().

Referenced by Acquire::restartRead().

void clear ( void  )
InList & operator= ( const InList il)

Assignment.

InList & assign ( const InList il)

Copies il to this with copying pointers to the data buffers only.

References InList::assign().

InList & assign ( void  )

Copies again all settings and indices from the reference InData.

Referenced by InList::assign().

const InData& operator[] ( int  i) const
inline

Returns a const reference of the i -th InData of the list.

Referenced by InList::currentTime(), InList::currentTimeRaw(), and InList::errorText().

InData& operator[] ( int  i)
inline

Returns a reference of the i -th InData of the list.

const InData & front ( void  ) const

Returns a const reference to the first InData in the list.

Referenced by InList::operator[]().

InData & front ( void  )

Returns a reference to the first InData in the list.

const InData & back ( void  ) const

Returns a const reference to the last InData in the list.

InData & back ( void  )

Returns a reference to the last InData in the list.

const InData & operator[] ( const string &  ident) const

Returns a const reference of the InData element with identifier ident.

Warning
No "range checking" is performed. If there is no InData element with identifier ident a reference to the first element is returned.

References InList::front().

InData & operator[] ( const string &  ident)

Returns a reference of the InData element with identifier ident.

Warning
No "range checking" is performed. If there is no InData element with identifier ident a reference to the first element is returned.

References InList::front().

int index ( const string &  ident) const

Return the index of the input data trace with identifier ident. If there is no trace with this identifier -1 is returned.

Referenced by InList::assign(), InList::erase(), and InList::set().

void push ( InData data)

Copy data as a new element to the end of the list.

Referenced by InList::InList().

void push ( const InList traces)

Copy each trace from traces to the end of the list.

References InList::size().

void add ( InData data,
bool  own = false 
)

Add the pointer data as a new element to the end of the list. If own is set to true then the ownership of data is transfered to the InList, i.e. the InList might delete it.

Referenced by InList::InList(), and Acquire::read().

void add ( const InData data,
bool  own = false 
)

Add the pointer data as a new element to the end of the list. If own is set to true then the ownership of data is transfered to the InList, i.e. the InList might delete it.

void add ( const InList traces,
bool  own = false 
)

Add pointers to each trace in traces to the end of the list. If own is set to true then the ownership of the traces is transfered to the InList, i.e. the InList might delete it.

References InList::size().

void set ( int  index,
const InData data,
bool  own = false 
)

Set the pointer to data as the index-th element. If own is set to true then the ownership of the traces is transferred to the InList, i.e. the InList might delete it.

References InList::index(), and InList::size().

void assign ( int  index,
const InData data 
)

Make the index-th element a copy of data with shared buffer.

References InList::index(), and InList::size().

void erase ( int  index)

Erase the InData at index index.

References InList::index(), and InList::size().

void update ( void  )

Make written data of all traces available for reading.

References InList::size().

void updateRaw ( void  )

Make written data of raw traces (source == 0) available for reading.

References InList::size().

Referenced by Acquire::getRawData().

void updateDerived ( void  )

Make written data of derived traces (source != 0 ) available for reading.

References InList::size().

void clearBuffer ( void  )

Clear buffer and reset indices of all InData traces.

References InList::size().

void sortByChannel ( void  )

Sort the input traces by increasing channel number.

References InList::lessChannelILE.

void sortByDeviceChannel ( void  )

Sort the input traces by increasing device and by increasing channel number.

References InList::lessDeviceChannelILE.

double currentTime ( void  ) const

Returns the smallest buffer time of all the InData.

References InData::currentTime(), InList::operator[](), and InList::size().

Referenced by Acquire::getRawData().

double currentTimeRaw ( void  ) const

Returns the smallest buffer time of all raw traces (source == 0).

References InData::currentTime(), InList::operator[](), and InList::size().

Referenced by Acquire::restartRead(), and Acquire::waitForData().

void setDevice ( int  device)

Set the device id of all traces to device.

References InList::size().

Referenced by Acquire::read(), Acquire::testRead(), and AnalogInput::testReadData().

void setReference ( InData::RefType  ref)

Set the reference of all input lines to ref. Possible values are Differential, Referenced, Nonreferenced. Defaults to Differential.

References InList::size().

Referenced by AnalogInput::testReadData().

void setUnipolar ( bool  unipolar)

Set the polarity of all input traces to unipolar. If unipolar is true only positive values are acquired, if it is false positive and negative values are acquired. By default acquisition is bipolar.

References InList::size().

void setStartSource ( int  startsource)

Set the source for the start trigger of the data aquisition for all traces to startsource.

References InList::size().

Referenced by AnalogInput::testReadData().

void setDelay ( double  delay)

Set delay for all traces to delay (in seconds).

References InList::size().

Referenced by AnalogInput::testReadData().

void setPriority ( bool  priority = true)

Set the priority of all input traces to priority. If priority is true then the input trace is processed even if there still is a data acquisition running. Otherwise the input trace is not processed and returns with an error.

References InList::size().

void setSampleRate ( double  rate)

Set the sampling rate of all input traces to rate Hertz

References InList::size().

Referenced by AnalogInput::testReadData().

void setSampleInterval ( double  step)

Set the sampling interval of all input traces to step seconds.

References InList::size().

void setContinuous ( bool  continuous = true)

Set continuous mode of data aquisition for all traces to continuous.

References InList::size().

Referenced by AnalogInput::testReadData().

void setScale ( double  scale)

Set the scale factor for all input traces to scale. The scale factor scale is used to scale the voltage data to a secondary unit.

See Also
setUnit()

References InList::size().

void setUnit ( const string &  unit)

Set the secondary unit for all input traces to unit.

See Also
setScale()

References InList::size().

void setUnit ( double  scale,
const string &  unit 
)

Set the specifications of a secondary unit for all input traces. The scale factor scale is used to scale the voltage data to a secondary unit unit.

See Also
setScale()

References InList::size().

void setReadTime ( double  time)

Set the maximum time the hardware driver should buffer the data before they are transferred to the AnalogInput implementation to time seconds. If time is zero or negative, the default buffer time of the driver is used for the size of the driver's buffer.

See Also
setUpdateTime()

References InList::size().

Referenced by Acquire::read(), and AnalogInput::testReadData().

void setUpdateTime ( double  time)

Set the maximum time the AnalogInput implementaion should buffer the data internally before they are converted to the secondary unit and written into the InData buffer to time seconds. If time is zero or negative, the InData::capacity() is used for the size of this buffer.

See Also
setReadTime()

References InList::size().

Referenced by Acquire::read(), and AnalogInput::testReadData().

void clearMode ( void  )

Clear all mode flags for all input traces.

See Also
setMode(), addMode(), delMode()

References InList::size().

void setMode ( int  flags)

Set mode flags for all input traces to flags.

See Also
clearMode(), addMode(), delMode()

References InList::size().

void addMode ( int  flags)

Add the bits specified by flags to the mode flags of all input traces.

See Also
clearMode(), setMode(), delMode()

References InList::size().

void delMode ( int  flags)

Clear the bits specified by flags of the mode flags of all input traces.

See Also
clearMode(), setMode(), addMode()

References InList::size().

Referenced by Acquire::activateGains(), Acquire::directWrite(), and Acquire::write().

void setSignalIndex ( int  index)

Set index of start of last signal to restart() + index in all input traces.

See Also
setSignalTime()

References InList::size().

void setSignalTime ( double  time)

Set time of start of last signal to time in all input traces.

See Also
setSignalIndex()

References InList::size().

Referenced by Acquire::waitForData().

void setRestart ( void  )

Set restart-index of all input traces to current size().

See Also
setRestartTime()

References InList::size().

Referenced by Acquire::read(), and Acquire::restartRead().

void setRestartTime ( double  restarttime)

Set Restart-index of all input traces to the element at restarttime.

See Also
setRestart()

References InList::size().

string errorText ( void  ) const
void clearError ( void  )

Clear all error flags of all input traces.

References InList::size().

Referenced by Acquire::read(), Acquire::restartRead(), AnalogInput::testRead(), and Acquire::testRead().

void setError ( long long  flags)

Set error flags of all input traces to flags.

References InList::size().

void addError ( long long  flags)

Add the bits specified by flags to the error flags of all input traces.

References InList::size().

Referenced by Acquire::read(), Acquire::testRead(), and AnalogInput::testReadData().

void delError ( long long  flags)

Clear the bits specified by flags of the error flags of all input traces.

References InList::size().

void addDaqError ( int  de)

Add error code de originating from daq board to the error flags of all input traces.

References InList::size().

void setErrorStr ( const string &  strg)

Set additional error string of all input traces to strg.

References InList::size().

void addErrorStr ( const string &  strg)

Add msg to the additional error string of all input traces.

References InList::size().

Referenced by Acquire::read().

void setErrorStr ( int  errnum)

Set additional error string of all input traces to the string describing the standard C error code errnum (from errno).

References InList::size().

void addErrorStr ( int  errnum)

Add the string describing the standard C error code errnum (from errno) to the additional error string of all input traces.

References InList::size().

bool success ( void  ) const

Returns true if all input traces are ok.

References InList::size().

Referenced by Acquire::getRawData().

bool failed ( void  ) const

Returns true if one or more input traces failed.

References InList::size().

Referenced by Acquire::getRawData(), Acquire::read(), AnalogInput::testReadData(), Acquire::waitForData(), and Acquire::waitForRead().

Friends And Related Function Documentation

ostream& operator<< ( ostream &  str,
const InList il 
)
friend

Write content of all InData variables to stream str (for debugging only).

bool lessChannelILE ( const ILE &  a,
const ILE &  b 
)
friend

Referenced by InList::sortByChannel().

bool lessDeviceChannelILE ( const ILE &  a,
const ILE &  b 
)
friend

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