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
156typedef struct dataset {
183 DasDim* aDims[DASDS_LOC_DIM_SZ];
189 DasAry* aArrays[DASDS_LOC_ARY_SZ];
216 int aItems[DASDS_LOC_ENC_SZ];
268 const char* sId,
const char* sGroupId,
int nRank
373#define DasDs_mutable(P) P->_mutable
456#define DasDs_group(P) ((const char*)(P)->sGroupId)
464#define DasDs_id(P) ((const char*)(P)->sId)
483#define DasDs_rank(P) ((P)->nRank)
514#define DasDs_numAry(P) ((P)->uArrays)
523#define DasDs_getAry(P, I) ((P)->lArrays[(I)])
598#define DasDs_numCodecs( pThis ) ( (pThis)->uCodecs )
607#define DasDs_getCodec( pThis, I ) ( &( (pThis)->lCodecs[(I)] ) )
626 const DasDs* pThis,
const char* sAryId,
int* pItems
634#define DasDs_pktItems( P, I ) ( (P)->lItems[(I)] )
681 DasDs* pThis,
const char* sAryId,
const char* sSemantic,
682 const char* sEncType,
int nItemBytes,
int nNumItems,
bool bRead
729 DasDs* pThis,
const char* sAryId,
const char* sSemantic,
730 const char* sEncType,
int nItemTerm, ubyte uTerm,
int nNumItems,
760 DasDs* pThis,
const char* sAryId,
const DasCodec* pOther,
int nNumItems,
899 DasDs* pThis,
enum dim_type dType,
const char* sDim,
const char* sId
936 DasDs* pThis,
const char* sDim,
enum dim_type dmt
947 DasDs* pThis,
size_t idx,
enum dim_type vt
Encoding/Decoding arrays to and from buffers.
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:184
Dynamic recursive ragged arrays.
Definition array.h:271
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:133
Das Datasets.
Definition dataset.h:156
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.
DAS_API DasDim * DasDs_makeDim(DasDs *pThis, enum dim_type dType, const char *sDim, const char *sId)
Make a new dimension within 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 char * DasDs_toStr(const DasDs *pThis, char *sBuf, int nLen)
Print a string representation of this dataset.
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.
DAS_API DasDim * DasDs_getDimById(DasDs *pThis, const char *sId)
Get a dimension by string id.
DAS_API DasErrCode DasDs_addAry(DasDs *pThis, DasAry *pAry)
Add an array to the dataset, stealing it's reference.
DAS_API DasDim * DasDs_getDim(DasDs *pThis, const char *sDim, enum dim_type dmt)
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.
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.
void * pUser
User data pointer.
Definition dataset.h:229
#define DAS_MAX_ID_BUFSZ
The size of an char buffer large enough to hold valid object IDs.
Definition util.h:349