21 #ifndef _descriptor_h_
22 #define _descriptor_h_
41 typedef enum DescriptorType {
42 Unknown=0, PLANE=14001, PACKET=14002, STREAM=14003, VARIABLE=1500,
80 typedef struct das_descriptor {
83 const struct das_descriptor* parent;
110 void DasDesc_freeProps(
DasDesc* pThis);
234 DasDesc* pThis,
const char* sType,
const char* sName,
const char* sVal
237 const char* DasDesc_get(
const DasDesc* pThis,
const char * propertyName );
262 DasDesc* pThis,
const char* sName,
const char* sVal
269 DasDesc* pThis,
const char* sName,
const char* sFmt, ...
343 DasDesc* pThis,
const char * propertyName,
int nitems,
double *value
395 DasDesc* pThis,
const char* sName,
char* sMin,
char* sMax,
404 DasDesc* pThis,
const char * propertyName,
int nitems,
float *value
DasErrCode DasDesc_set(DasDesc *pThis, const char *sType, const char *sName, const char *sVal)
Generic property setter.
bool DasDesc_remove(DasDesc *pThis, const char *propretyName)
Remove a property from a descriptor, if preset.
size_t DasDesc_length(const DasDesc *pThis)
Get the number of properties in a descriptor.
desc_type_t
enumeration of Descriptor types, used internally for type checking.
Definition: descriptor.h:41
DasErrCode DasDesc_getStrRng(DasDesc *pThis, const char *sName, char *sMin, char *sMax, das_units *pUnits, size_t uLen)
Get a property of type DatumRange with unconverted strings.
bool DasDesc_getBool(DasDesc *pThis, const char *sPropName)
Get a property boolean value.
int DasErrCode
return code type 0 indicates success, negative integer indicates failure
Definition: util.h:117
Little buffer class to handle accumulating string data.
Definition: buffer.h:49
#define DAS_XML_MAXPROPS
limit of number of properties per descriptor.
Definition: util.h:379
DasErrCode DasDesc_setDouble(DasDesc *pThis, const char *propertyName, double value)
Set property of type double.
double * DasDesc_getDoubleAry(DasDesc *pThis, const char *propertyName, int *nitems)
Get the values of an array property.
const char * DasDesc_getTypeByIdx(const DasDesc *pThis, size_t uIdx)
Get a data type of a property by an index.
Base structure for Stream Header Items.
Definition: descriptor.h:80
bool DasDesc_has(const DasDesc *pThis, const char *propertyName)
Determine if a property is present in a Descriptor or it's ancestors.
const DasDesc * DasDesc_parent(DasDesc *pThis)
The the parent of a Descriptor.
DasErrCode DasDesc_encode(DasDesc *pThis, DasBuf *pBuf, const char *sIndent)
Encode a generic set of properties to a buffer.
double DasDesc_getDatum(DasDesc *pThis, const char *sPropName, das_units units)
Get the a numeric property in the specified units.
void DasDesc_copyIn(DasDesc *pThis, const DasDesc *source)
Deepcopy properties into a descriptor.
DasErrCode DasDesc_setDoubleArray(DasDesc *pThis, const char *propertyName, int nitems, double *value)
Set the property of type double array.
const char * DasDesc_getNameByIdx(const DasDesc *pThis, size_t uIdx)
Get a property name by an index.
Defines units used for items in the stream, most notably time units that reference an epoch and a ste...
DasErrCode DasDesc_setStr(DasDesc *pThis, const char *sName, const char *sVal)
SetProperty methods add properties to any Descriptor (stream,packet,plane).
bool DasDesc_equals(const DasDesc *pOne, const DasDesc *pTwo)
Check to see if two descriptors contain the same properties Note, the order of the properties may be ...
Utility to assist with encode and decode operations.
DasErrCode DasDesc_setDatum(DasDesc *pThis, const char *sName, double rVal, das_units units)
Set property of type Datum (double, UnitType pair)
DasErrCode DasDesc_vSetStr(DasDesc *pThis, const char *sName, const char *sFmt,...)
Set a string property in the manner of sprintf.
DasErrCode DasDesc_setInt(DasDesc *pThis, const char *sName, int nVal)
Set the property of type int.
const char * DasDesc_getStr(const DasDesc *pThis, const char *propertyName)
read the property of type String named propertyName.
const char * DasDesc_getValByIdx(const DasDesc *pThis, size_t uIdx)
Get a property value by an index.
double DasDesc_getDouble(const DasDesc *pThis, const char *propertyName)
Read the property of type double named propertyName.
int DasDesc_getInt(const DasDesc *pThis, const char *propertyName)
Get a property integer value.
DasErrCode DasDesc_setFloatAry(DasDesc *pThis, const char *propertyName, int nitems, float *value)
Set the property of type float array.
const char * das_units
Enumeration of unit types, that correspond to physical unit types.
Definition: units.h:135
DasErrCode DasDesc_setDatumRng(DasDesc *pThis, const char *sName, double beg, double end, das_units units)
Set property of type DatumRange (double, double, UnitType triple)
DasErrCode DasDesc_setBool(DasDesc *pThis, const char *sPropName, bool bVal)
Set a boolean property Encodes the value as either the string "true" or the string "false"...