EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Types | Public Member Functions | List of all members
CtrlInfo Class Reference

Meta-information for values: Units, limits, etc . More...

#include <CtrlInfo.h>

Public Types

enum  Type { Invalid = 0, Numeric = 1, Enumerated = 2 }
 Type defines the type of value. More...
 

Public Member Functions

 CtrlInfo ()
 Constructor.
 
 CtrlInfo (const CtrlInfo &rhs)
 Copy constructor.
 
CtrlInfooperator= (const CtrlInfo &rhs)
 Copy operator.
 
bool operator== (const CtrlInfo &rhs) const
 'Equal to' operator
 
bool operator!= (const CtrlInfo &rhs) const
 'Not equal to' operator
 
Type getType () const
 Get the Type for this CtrlInfo.
 
int32_t getPrecision () const
 Returns precision.
 
const char * getUnits () const
 Returns units.
 
float getDisplayHigh () const
 Returns display high.
 
float getDisplayLow () const
 Returns display low.
 
float getHighAlarm () const
 Returns high alarm.
 
float getHighWarning () const
 Returns high warning.
 
float getLowWarning () const
 Returns low warning.
 
float getLowAlarm () const
 Returns low alarm.
 
void setNumeric (int32_t prec, const std::string &units, float disp_low, float disp_high, float low_alarm, float low_warn, float high_warn, float high_alarm)
 Initialize a Numeric CtrlInfo (sets Type to Numeric and then sets fields)
 
void setEnumerated (size_t num_states, char *strings[])
 Initialize an Enumerated CtrlInfo.
 
void allocEnumerated (size_t num_states, size_t string_len)
 Alternative to setEnumerated: Call with total string length, including all the '\0's !
 
void setEnumeratedString (size_t state, const char *string)
 Must be called after allocEnumerated() AND must be called in sequence, i.e. More...
 
void calcEnumeratedSize ()
 After allocEnumerated() and a sequence of setEnumeratedString () calls, this method recalcs the total size and checks if the buffer is sufficient (Debug version only)
 
void formatDouble (double value, std::string &result) const
 Format a double value according to precision

 
size_t getNumStates () const
 Enumerated: state string.
 
void getState (size_t state, std::string &result) const
 Get given state as text (also handles undefined states)
 
bool parseState (const char *text, const char **next, size_t &state) const
 Like strtod, strtol: try to parse, position 'next' on character following the recognized state text.
 
void show (FILE *f) const
 Read a CtrlInfo from a binary data file. More...
 
size_t getSize () const
 Returns size.
 
const MemoryBuffer
< CtrlInfoData > & 
getMemoryBuffer () const
 Return a const memory buffer.
 
MemoryBuffer< CtrlInfoData > & getMemoryBuffer ()
 Return a const memory buffer.
 

Detailed Description

Meta-information for values: Units, limits, etc .

A value is archived with control information. Several values might share the same control information for efficiency. The control information is variable in size because it holds units or state strings.

Member Enumeration Documentation

Type defines the type of value.

Enumerator
Invalid 

Undefined.

Numeric 

A numeric CtrlInfo: Limits, units, ...

Enumerated 

An enumerated CtrlInfo: Strings.

Member Function Documentation

void CtrlInfo::setEnumeratedString ( size_t  state,
const char *  string 
)

Must be called after allocEnumerated() AND must be called in sequence, i.e.

setEnumeratedString (0, .. setEnumeratedString (1, ..

void CtrlInfo::show ( FILE *  f) const

Read a CtrlInfo from a binary data file.

Exceptions
GenericExeptionon error. Write a CtrlInfo to a binary data file
GenericExeptionon error. Prints data

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