22 #ifndef _das_packet_h_
23 #define _das_packet_h_
138 typedef struct packet_descriptor {
DasErrCode PktDesc_decodeData(PktDesc *pThis, DasBuf *pBuf)
Decode 1 packet's worth of data from a buffer.
Describes a data plane within a packet type.
Definition: plane.h:119
int DasErrCode
return code type 0 indicates success, negative integer indicates failure
Definition: util.h:117
PlaneDesc * PktDesc_getPlaneByType(PktDesc *pThis, plane_type_t ptype, int iRelIndex)
Get the Ith plane of a given type.
DasErrCode PktDesc_encode(const PktDesc *pThis, DasBuf *pBuf)
Serialize a packet descriptor as XML data.
plane_type_t PktDesc_getPlaneType(const PktDesc *pThis, int iPlane)
Determine the type of plane by index.
DasErrCode PktDesc_encodeData(const PktDesc *pThis, DasBuf *pBuf)
Serialize a packet's current data In addition to holding the format information for Das2 Stream packe...
Holds information for a single packet type in a Das2 stream.
Definition: packet.h:138
Header for Plane Descriptor Objects.
PktDesc * new_PktDesc(void)
Creates a packet descriptor with the default settings.
DasErrCode PktDesc_copyPlanes(PktDesc *pThis, const PktDesc *pOther)
Copy in all planes from another a packet descriptor.
size_t PktDesc_recBytes(const PktDesc *pThis)
Get the size of data records defined by a packet descriptor.
Little buffer class to handle accumulating string data.
Definition: buffer.h:49
size_t PktDesc_getNPlanes(const PktDesc *pThis)
Get the number of planes in this type of packet.
int PktDesc_getPlaneIdx(PktDesc *pThis, PlaneDesc *pPlane)
Get the plane number within this packet description.
bool PktDesc_equalFormat(const PktDesc *pPd1, const PktDesc *pPd2)
Check for packet descriptor format equality.
PktDesc * new_PktDesc_xml(DasBuf *pBuf, DasDesc *pParent, int nPktId)
Create a PktDesc from XML data.
Base structure for Stream Header Items.
Definition: descriptor.h:80
DasErrCode PktDesc_setValues(PktDesc *pThis, size_t uPlane, const double *pVals)
Convenience function for setting an array of values in a plane This is just a shortcut for: ...
int PktDesc_addPlane(PktDesc *pThis, PlaneDesc *pPlane)
Add a plane to a packet.
PlaneDesc * PktDesc_getXPlane(PktDesc *pThis)
returns the PlaneDescriptor for the 1st X Tag plane.
DasErrCode PktDesc_setValue(PktDesc *pThis, size_t uPlane, size_t uItem, double val)
Convenience function for setting a single value in a plane This is just a shortcut for: ...
int PktDesc_getPlaneIdxByName(PktDesc *pThis, const char *name, plane_type_t planeType)
returns the plane number for the named plane.
void PktDesc_setGroup(PktDesc *pThis, const char *sGroup)
Set the data group for this packet.
int PktDesc_getPlaneIdxByType(const PktDesc *pThis, plane_type_t ptype, int iRelIndex)
Gets the Nth plane of a given type.
size_t PktDesc_getNPlanesOfType(const PktDesc *pThis, plane_type_t pt)
Get the number of planes of a particular type in a packet.
bool PktDesc_validate(PktDesc *pThis)
Check to see if a legal plane layout is present.
PlaneDesc * PktDesc_getPlane(PktDesc *pThis, int iplane)
returns the PlaneDescriptor for plane number iplane This can be used to query properties of the plane...
plane_type_t
An enumeration of packet data plane types.
Definition: plane.h:58
void del_PktDesc(PktDesc *pThis)
Free a packet descriptor and all it's contained objects.
int PktDesc_getId(const PktDesc *pThis)
Get the packet ID for this packet.
#define MAXPLANES
maximum planes allowed in a packet
Definition: packet.h:32
PlaneDesc * PktDesc_getPlaneByName(PktDesc *pThis, const char *name)
Get a Plane Descriptor for the plane with the name name.
void * pUser
User data pointer.
Definition: packet.h:161
const char * PktDesc_getGroup(const PktDesc *pThis)
Get the data group for this packet.