RawValueI Class
Lightweight wrapper class for a raw Type (dbr_time_xxx). All methods are static, they reqire the value ptr and a context hint of type/count.
This class doesn't hold the actual memory location of the value, since it might be owned by e.g. the CA client library, it also doesn't know about it's Type. ValueI provides this for a single RawValue, the archive engine maintains circular buffers of several RawValues.Interface
- Defined for future portability. All values hold status, severity, time. dbr_time_double has RISC pads but it's used here because it's most common (my opinion)
typedef dbr_time_double Type;- Allocate/free space for num samples of type/count.
static Type * allocate (DbrType type, DbrCount count, size_t num); static void free (Type *value);- Calculate size of a single value of type/count
static size_t getSize (DbrType type, DbrCount count);- Compare the value part of two RawValues, not the time stamp or status! (for full comparison, use memcmp over size given by getSize()).
Both lhs, rhs must have the same type.static bool hasSameValue (DbrType type, DbrCount count, size_t size, const Type *lhs, const Type *rhs);- Only valid for Values of same type:
static void copy (DbrType type, DbrCount count, Type *lhs, const Type *rhs);- Access to status...
static short getStat (const Type *value); static short getSevr (const Type *value); static void getStatus (const Type *value, stdString &status); static void setStatus (Type *value, short status, short severity);- and time
static const osiTime getTime (const Type *value); static void setTime (Type *value, const osiTime &stamp); static void getTime (const Type *value, stdString &time); private: friend class ValueI; static Type * allocate (size_t size); };
IndexCreated from sources with MakeDoc Perl script.