libdas2
das2 core C utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Functions
packet.h File Reference
#include <das2/plane.h>

Go to the source code of this file.

Data Structures

struct  PktDesc
 Holds information for a single packet type in a Das2 stream. More...
 

Macros

#define MAXPLANES   100
 maximum planes allowed in a packet
 

Functions

void del_PktDesc (PktDesc *pThis)
 Free a packet descriptor and all it's contained objects. More...
 
bool PktDesc_equalFormat (const PktDesc *pPd1, const PktDesc *pPd2)
 Check for packet descriptor format equality. More...
 
int PktDesc_getPlaneIdx (PktDesc *pThis, PlaneDesc *pPlane)
 Get the plane number within this packet description. More...
 
PlaneDescPktDesc_getPlaneByName (PktDesc *pThis, const char *name)
 Get a Plane Descriptor for the plane with the name name. More...
 
PlaneDescPktDesc_getPlaneByType (PktDesc *pThis, plane_type_t ptype, int iRelIndex)
 Get the Ith plane of a given type. More...
 

Function Documentation

void del_PktDesc ( PktDesc pThis)

Free a packet descriptor and all it's contained objects.

Parameters
pThisThe packet descriptor to free, the caller should set the pointer to NULL after this call.
bool PktDesc_equalFormat ( const PktDesc pPd1,
const PktDesc pPd2 
)

Check for packet descriptor format equality.

This function checks to see if two packet descriptors define the same data note that the StreamDesc parent of each need not be the same, nor are the descriptors required to have the same current data values.

Parameters
pPd1
pPd2
Returns
true if both packet descriptors provide the same definition, false otherwise
int PktDesc_getPlaneIdx ( PktDesc pThis,
PlaneDesc pPlane 
)

Get the plane number within this packet description.

Parameters
pThisthe packet descriptor to query
pPlanea pointer to the plane who's index is required
Returns
a number from 0 to 99 if successful or -1 if the plane pointed to by pPlane is not part of this packet description
PlaneDesc* PktDesc_getPlaneByName ( PktDesc pThis,
const char *  name 
)

Get a Plane Descriptor for the plane with the name name.

Returns
A pointer to the plane, or NULL if no plane with the given name is present in the packet descriptor
PlaneDesc* PktDesc_getPlaneByType ( PktDesc pThis,
plane_type_t  ptype,
int  iRelIndex 
)

Get the Ith plane of a given type.

Parameters
pThisThe packet descriptor to query
ptypeThe plane type, one X, Y, Z, YScan
iRelIndexThe number of the plane of a given type to find. The lowest index will be 0 for a given type.
Returns
A pointer to the plane, or NULL if there are not at least iRelIndex + 1 planes of the given type in the packet