21#ifndef _das_dataset_h_
22#define _das_dataset_h_
24#include <das3/dimension.h>
101#define DASDS_LOC_ENC_SZ 6
113#define DASDS_LOC_ARY_SZ 32
114#define DASDS_LOC_DIM_SZ 32
117#define DASDS_PLOT_SZ 24
159typedef struct dataset {
184 char sPlot[DASDS_PLOT_SZ];
192 DasDim* aDims[DASDS_LOC_DIM_SZ];
198 DasAry* aArrays[DASDS_LOC_ARY_SZ];
225 int aItems[DASDS_LOC_ENC_SZ];
282 const char* sId,
const char* sGroupId,
int nRank
387#define DasDs_mutable(P) P->_mutable
470#define DasDs_group(P) ((const char*)(P)->sGroupId)
482#define DasDs_id(P) ((const char*)(P)->sId)
496#define DasDs_getPlot(P) ((const char*)(P)->sPlot)
526#define DasDs_rank(P) ((P)->nRank)
557#define DasDs_numAry(P) ((P)->uArrays)
566#define DasDs_getAry(P, I) ((P)->lArrays[(I)])
641#define DasDs_numCodecs( pThis ) ( (pThis)->uCodecs )
650#define DasDs_getCodec( pThis, I ) ( &( (pThis)->lCodecs[(I)] ) )
668 const DasDs* pThis,
const char* sAryId,
int* pItems
676#define DasDs_pktItems( P, I ) ( (P)->lItems[(I)] )
723 DasDs* pThis,
const char* sAryId,
const char* sSemantic,
724 const char* sEncType,
int nItemBytes,
int nNumItems,
bool bRead
771 DasDs* pThis,
const char* sAryId,
const char* sSemantic,
772 const char* sEncType,
int nItemTerm, ubyte uTerm,
int nNumItems,
802 DasDs* pThis,
const char* sAryId,
const DasCodec* pOther,
int nNumItems,
941 DasDs* pThis,
enum dim_type dType,
const char* sDim,
const char* sId
978 DasDs* pThis,
const char* sDim,
enum dim_type dmt
989 DasDs* pThis,
size_t idx,
enum dim_type vt
Encoding/Decoding arrays to and from buffers.
DAS_API bool DasDs_cubicCoords(const DasDs *pThis, const DasDim **pCoords)
Get coordinate dimensions that satisfy the cubic dataset condition.
DAS_API DasDs * DasDs_copy(const DasDs *pThis)
Copy a dataset object.
DAS_API size_t DasDs_memIndexed(const DasDs *pThis)
The apparent memory usage of all arrays in the dataset.
#define VARIDX_MAX
Max index count for the model.
Definition generator.h:55
int DasErrCode
return code type 0 indicates success, negative integer indicates failure
Definition defs.h:189
Dynamic recursive ragged arrays.
Definition array.h:243
DAS_API size_t DasDs_clearRagged0(DasDs *pThis)
Clear any arrays that are ragged in index 0.
Buffer class to handle accumulating byte streams.
Definition buffer.h:47
Reading and writing array data to buffers.
Definition codec.h:45
Base structure for Stream Header Items.
Definition descriptor.h:74
Das Physical Dimensions.
Definition dimension.h:131
Das Datasets.
Definition dataset.h:159
DAS_API DasErrCode DasDs_encodeHdr(DasDs *pThis, DasBuf *pBuf)
Encode the dataset header as a das3 <dataset> XML element.
DAS_API size_t DasDs_numDims(const DasDs *pThis, enum dim_type dmt)
Get the number of physical dimensions in this dataset.
DAS_API DasErrCode DasDs_replaceAry(DasDs *pThis, const char *sOldId, DasAry *pNew)
Swap a storage array in a dataset for a replacement.
#define DasDs_addAry(D, A)
Add an array to the dataset, stealing it's reference.
DAS_API int DasDs_info(const DasDs *pThis, char *sBuf, size_t uLen)
Print a multi-line description of this dataset.
DAS_API DasCodec * DasDs_addStringCodec(DasDs *pThis, const char *sAryId, const char *sSemantic, const char *sEncType, int nItemTerm, ubyte uTerm, int nNumItems, bool bRead)
Define a packet data encoder for a fixed number of variable length items in each packet.
DAS_API DasCodec * DasDs_getCodecFor(const DasDs *pThis, const char *sAryId, int *pItems)
Get the codec for a named array.
DAS_API DasDs * new_DasDs(const char *sId, const char *sGroupId, int nRank)
Create a new dataset object.
DAS_API size_t DasDs_memUsed(const DasDs *pThis)
Get the currently used memory of all arrays in the dataset.
DAS_API void del_DasDs(DasDs *pThis)
Delete a Data object, cleaning up it's memory.
DAS_API size_t DasDs_memOwned(const DasDs *pThis)
Get the currently allocated memory of all arrays in the dataset.
DAS_API int DasDs_recBytes(const DasDs *pThis)
Get the number of bytes in each record of this dataset when serialized.
DAS_API void DasDs_setMutable(DasDs *pThis, bool bChangeAllowed)
Lock/Unlock the dataset for changes.
#define DasDs_makeDim(D, T, S)
Make a new dimension within this dataset.
DAS_API DasDim * DasDs_getDimById(DasDs *pThis, const char *sId)
Get a dimension by string id.
#define DasDs_getDim
Get a dimension by it's basic kind.
DAS_API DasCodec * DasDs_addFixedCodec(DasDs *pThis, const char *sAryId, const char *sSemantic, const char *sEncType, int nItemBytes, int nNumItems, bool bRead)
Define a packet data encoded/decoder for fixed length items and arrays.
DAS_API DasErrCode DasDs_decodeData(DasDs *pThis, DasBuf *pBuf)
Decode one packet's worth of data into dataset memory.
DAS_API DasErrCode DasDs_encodeData(DasDs *pThis, DasBuf *pBuf, ptrdiff_t iIdx0)
Encode one record's worth of data from dataset memory.
DAS_API int DasDs_shape(const DasDs *pThis, ptrdiff_t *pShape)
Return current valid ranges for whole data set iteration.
#define DasDs_toStr(P, B, N)
Print a one line summary of this dataset.
DAS_API DasDim * DasDs_getDimByIdx(DasDs *pThis, size_t idx, enum dim_type vt)
Get a dimension by index.
DAS_API DasDs * new_DasDs_xml(DasBuf *pBuf, DasDesc *pParent, int nPktId)
Parse a das3 <dataset> XML element into a new dataset object.
DAS_API DasAry * DasDs_getAryById(DasDs *pThis, const char *sAryId)
Get a dataset array given it's identifier.
DAS_API DasErrCode DasDs_addDim(DasDs *pThis, DasDim *pDim)
Add a physical dimension to the dataset.
DAS_API ptrdiff_t DasDs_lengthIn(const DasDs *pThis, int nIdx, ptrdiff_t *pLoc)
Return the current max value index value + 1 for any partial index.
DAS_API DasCodec * DasDs_addCodecFrom(DasDs *pThis, const char *sAryId, const DasCodec *pOther, int nNumItems, bool bRead)
Add a new codec that initialized via some other codec.
DAS_API DasErrCode DasDs_setPlot(DasDs *pThis, const char *sPlot)
Set the plot type hint for a dataset.
void * pUser
User data pointer.
Definition dataset.h:238
#define DAS_MAX_ID_BUFSZ
The size of an char buffer large enough to hold valid object IDs.
Definition util.h:348