43#define USE_INTERP_RESULT 1
45#define _SDS_INCLUDE_ 1
62#define SDS_VERSION 100
82#define SDS_C_MAXCODE SDS_UI64
96#define SDS_C_NAMELEN 16
98#define SDS_C_MAXARRAYDIMS 7
100#define SDS_WATCH_EVENT_FREE 0
101#define SDS_WATCH_EVENT_DELETE 1
102#define SDS_WATCH_EVENT_READFREE 2
103#define SDS_WATCH_EVENT_NEW 3
104#define SDS_WATCH_EVENT_COPY 4
105#define SDS_WATCH_EVENT_INSERT 5
106#define SDS_WATCH_EVENT_INSERT_CELL 6
107#define SDS_WATCH_EVENT_EXTRACT 7
108#define SDS_WATCH_EVENT_RESIZE 8
109#define SDS_WATCH_EVENT_NEWID 9
111typedef long SdsIdType;
113typedef long SdsCodeType;
115typedef void (*SdsWatchRoutineType)(SdsIdType,
void *,
int reserved);
120SDSEXTERN
void SdsSetWatch(SdsIdType
id,
121 SdsWatchRoutineType watchRoutine,
124 SdsWatchRoutineType *oldWatchRoutine,
125 void ** oldClientData,
126 StatusType * SDSCONST status);
128SDSEXTERN
void SdsCreate(SDSCONST
char *name,
long nextra, SDSCONST
char *extra,
129 SdsIdType *
id, StatusType * SDSCONST status);
131SDSEXTERN
void SdsInfo(SdsIdType
id,
char *name, SdsCodeType *code,
long *ndims,
132 unsigned long* dims, StatusType * SDSCONST status);
133SDSEXTERN
void SdsGetName(SdsIdType
id,
char *name, StatusType * SDSCONST status);
134SDSEXTERN
void SdsGetCode(SdsIdType
id, SdsCodeType *code,
135 StatusType * SDSCONST status);
137SDSEXTERN
void SdsGetDims(SdsIdType
id,
long *ndims,
138 unsigned long *dims, StatusType * SDSCONST status);
140SDSEXTERN
void SdsNew(SdsIdType parent_id, SDSCONST
char *name,
long nextra,
141 SDSCONST
char *extra, SdsCodeType code,
long ndims,
142 SDSCONST
unsigned long *dims,
143 SdsIdType *
id, StatusType * SDSCONST status);
145SDSEXTERN
int SdsIsDefined(SdsIdType parent_id, StatusType * SDSCONST status);
147SDSEXTERN
void SdsIndex(SdsIdType parent_id,
long index, SdsIdType *
id, StatusType * SDSCONST status);
148SDSEXTERN
void SdsNumItems(SdsIdType
id,
long *numItems, StatusType * SDSCONST status);
150SDSEXTERN
void SdsFind(SdsIdType parent_id, SDSCONST
char *name, SdsIdType *
id, StatusType * SDSCONST status);
152SDSEXTERN
void SdsFindByPath(SdsIdType parent_id, SDSCONST
char *name, SdsIdType *
id, StatusType * SDSCONST status);
154SDSEXTERN
void SdsPointer(SdsIdType
id,
void **data,
unsigned long *length, StatusType * SDSCONST status);
156SDSEXTERN
void SdsGet(SdsIdType
id,
unsigned long length,
unsigned long offset,
157 void *data,
unsigned long *actlen, StatusType * SDSCONST status);
159SDSEXTERN
void SdsPut(SdsIdType
id,
unsigned long length,
unsigned long offset,
160 SDSCONST
void *data, StatusType * SDSCONST status);
163SDSEXTERN
void SdsCell(SdsIdType array_id,
long nindices,
164 SDSCONST
unsigned long *indices,
165 SdsIdType *
id, StatusType * SDSCONST status);
168SDSEXTERN
void SdsInsertCell(SdsIdType array_id,
long nindices,
169 SDSCONST
unsigned long *indices,
170 SdsIdType
id, StatusType * SDSCONST status);
172SDSEXTERN
void SdsDelete(SdsIdType
id, StatusType * SDSCONST status);
174SDSEXTERN
void SdsSize(SdsIdType
id,
unsigned long *bytes, StatusType * SDSCONST status);
175SDSEXTERN
void SdsExport(SdsIdType
id,
unsigned long length,
void *data, StatusType * SDSCONST status);
177SDSEXTERN
void SdsImport(SDSCONST
void *data, SdsIdType *
id,
178 StatusType * SDSCONST status);
180SDSEXTERN
void SdsAccess(
void *data, SdsIdType *
id, StatusType * SDSCONST status);
182SDSEXTERN
void SdsExtract(SdsIdType
id, StatusType * SDSCONST status);
184SDSEXTERN
void SdsInsert(SdsIdType parent_id, SdsIdType
id, StatusType * SDSCONST status);
186SDSEXTERN
void SdsCopy(SdsIdType
id, SdsIdType *copy_id, StatusType * SDSCONST status);
188SDSEXTERN
void SdsCloneId(SdsIdType
id, SdsIdType *clone_id, StatusType * SDSCONST status);
190SDSEXTERN
void SdsResize(SdsIdType
id,
long ndims, SDSCONST
unsigned long *dims,
191 StatusType * SDSCONST status);
193SDSEXTERN
void SdsRename(SdsIdType
id, SDSCONST
char* name, StatusType * SDSCONST status);
195SDSEXTERN
void SdsGetExtra(SdsIdType
id,
long length,
char* extra,
unsigned long *actlen,
196StatusType * SDSCONST status);
197SDSEXTERN
void SdsGetExtraLen(SdsIdType
id,
198 unsigned long *length, StatusType * SDSCONST status);
200SDSEXTERN
void SdsPutExtra(SdsIdType
id,
long length, SDSCONST
char *extra,
201 StatusType * SDSCONST status);
203SDSEXTERN
void SdsExportDefined(SdsIdType
id,
unsigned long length,
void *data, StatusType * SDSCONST status);
205SDSEXTERN
void SdsSizeDefined(SdsIdType
id,
unsigned long *bytes, StatusType * SDSCONST status);
207SDSEXTERN
void SdsIsExternal(SdsIdType
id,
int *external, StatusType * SDSCONST status);
209SDSEXTERN
void SdsGetExternInfo(SdsIdType
id,
void **data, StatusType * SDSCONST status);
211SDSEXTERN
void SdsListInUse();
218#if defined(_SDS_UTIL_BUILD) || defined (_SDS_BUILD)
219SDSEXTERN
void Sds__MarkFree(SdsIdType
id);
221SDSEXTERN
void Sds__Free(SdsIdType
id, StatusType * SDSCONST status);
223SDSEXTERN
void Sds___WatchEvent(SdsIdType
id,
int eventFlag,
const char * sourceFunc);
235SDSEXTERN INT64 SdsSetI64(
long high,
unsigned long low);
237SDSEXTERN UINT64 SdsSetUI64(
unsigned long high,
unsigned long low);
239SDSEXTERN
void SdsGetI64(INT64 i64,
long *high,
unsigned long *low);
241SDSEXTERN
void SdsGetUI64(UINT64 i64,
unsigned long *high,
unsigned long *low);
243SDSEXTERN
double SdsGetI64toD(INT64 i64);
245SDSEXTERN
double SdsGetUI64toD(UINT64 i64);
250SDSEXTERN
void SdsGetIdInfo( INT32 * pnum, INT32 * pasize, INT32 * puids );
252SDSEXTERN
void SdsFreeIdAndCheck(
const char *mes, SdsIdType
id, StatusType *status);
254SDSEXTERN
unsigned Sds___GetIdBlockSize();
255SDSEXTERN
void Sds___GetIdUsage(
int size,
unsigned char *array, StatusType *status);
260#define __SDS_NATIVE__INT64 1
262#define __SDS_NATIVE__INT64 0
265#define __SDS_LONG__64 1
267#define __SDS_LONG__64 0
270extern void Sds___CheckBuild(
int bigend,
int long_64,
int native_64, StatusType *status);
271#define SdsCheckBuild(_status_) Sds___CheckBuild(SDS_BIGEND, __SDS_LONG__64, __SDS_NATIVE__INT64, (_status_));
277SDSEXTERN
void SdsList(SdsIdType
id, StatusType * SDSCONST status);
278SDSEXTERN
void SdsListTo(FILE *to, SdsIdType
id, StatusType * SDSCONST status);
280SDSEXTERN
void SdsWrite(SdsIdType
id, SDSCONST
char *filename, StatusType * SDSCONST status);
282SDSEXTERN
void SdsFreeId(SdsIdType
id, StatusType * SDSCONST status);
284SDSEXTERN
void SdsFlush(SdsIdType
id, StatusType * SDSCONST status);
286SDSEXTERN
void SdsRead(SDSCONST
char *filename, SdsIdType *
id, StatusType * SDSCONST status);
288SDSEXTERN
void SdsFillArray(SdsIdType array_id, SdsIdType elem_id,
289 StatusType * SDSCONST status);
292SDSEXTERN
void SdsReadFree(SdsIdType
id, StatusType * SDSCONST status);
293SDSEXTERN SDSCONST
char *SdsTypeToStr(SdsCodeType code,
int mode);
294SDSEXTERN
void SdsFindByName( SdsIdType parent_id,
295 SDSCONST
char * name,
298 StatusType * SDSCONST status );
301SDSEXTERN SDSCONST
char * SdsErrorCodeString(StatusType error);
310 INT32 _init_current_array_size;
311 INT32 _init_unused_ids;
319SDSEXTERN
void SdsCheckInit(
SdsCheckType *chkData, StatusType *status);
320SDSEXTERN
void SdsCheck(
const char *mes,
SdsCheckType *chkData,
327#define SDS_COMP_MESS_ERROR 1
328#define SDS_COMP_MESS_WARN 2
333SDSEXTERN
void SdsCompiler(SDSCONST
char *
string,
int messages,
int intaslong, SdsIdType *
id, StatusType *status);
338#if defined(SDS_CHECK_FREE)||defined(SDS_CHECK_FREE_W)
340#ifdef SDS_CHECK_FREE_W
341#warning "Checking SdsFree operations"
346#define SdsFreeId(_id_, _status) \
348 if (*(_status) == STATUS__OK) \
350 SdsFreeIdAndCheck("", (_id_), (_status)); \
351 if (*(_status) == SDS__CHK_FREE) \
353 fprintf(stderr, " At file %s, line %d\n", __FILE__, __LINE__); \
354 fprintf(stderr, " This warning was enabled by SDS_CHECK_FREE or SDS_CHECK_FREE_W macro\n"); \
355 *(_status) = STATUS__OK; \
408#ifdef DRAMA_ALLOW_CPP_STDLIB
452 unsigned long elements;
459 void CheckIndexAndData(
unsigned long index)
const {
462 throw new NoDataException(
"Index %d, Code %d, elements %d - data is invalid");
464 if (index >= elements)
466 throw new InvalidIndexException(
"Index %d, Code %d, elements %d - index is invalid");
480 void ** Data() {
return (
void **)&data; }
488 void SetElements(
unsigned long nelem) {
507 SdsCodeType
Code()
const {
return code; }
510 unsigned long Size()
const {
return elements; }
525 CheckIndexAndData(index);
542 CheckIndexAndData(index);
776#if defined(SDS_CHECK_FREE)||defined(SDS_CHECK_FREE_W)
777#define SDS__CHECK_ARG(_arg_) _arg_
779#define SDS__CHECK_ARG(_arg_)
783 void CleanUp(
const char * SDS__CHECK_ARG(from_where)) {
788 if ((
id)&&(flags.free))
791 if ((flags.del)&&(flags.readfree))
793 StatusType ignore = STATUS__OK;
794 SdsReadFree(
id,&ignore);
799 StatusType ignore = STATUS__OK;
800 SdsDelete(
id,&ignore);
803 StatusType ignore = STATUS__OK;
804#if defined(SDS_CHECK_FREE)||defined(SDS_CHECK_FREE_W)
805 SdsFreeIdAndCheck(
"",
id, &ignore);
806 if (ignore != STATUS__OK)
808 fprintf(stderr,
"SDS FreeId failure in C++ cleanup(), called from \"%s\" for id %d\n", from_where,(
int)
id);
809 fprintf(stderr,
" Status Code:%s\n", SdsErrorCodeString(ignore));
810 fprintf(stderr,
" SdsId object address is %p\n", (
void *)(
this));
811 fprintf(stderr,
" Sorry - don't have more exact location information\n");
812 fprintf(stderr,
" This warning was enabled by SDS_CHECK_FREE or SDS_CHECK_FREE_W macro\n");
815 SdsFreeId(
id,&ignore);
825#ifdef DRAMA_ALLOW_CPP_STDLIB
830 const SdsCodeType code,
832 unsigned long *
const dims,
833 StatusType *
const status) {
835 if (*status != STATUS__OK)
return;
836 char name[SDS_C_NAMELEN];
842 Info(name, &tcode, &tndims, dims, status);
853 *status = SDS__NOTARR;
858 *status = SDS__INVDIMS;
867 void CheckArrayTypeSingleDim(
868 const SdsCodeType code,
869 unsigned long *
const nitems,
870 StatusType *
const status) {
872 unsigned long dims[SDS_C_MAXARRAYDIMS];
873 CheckArrayType(code, 1, dims, status);
874 if (*status != STATUS__OK)
return;
909 SdsId(
const SdsIdType item = 0,
const bool free=
false,
910 const bool del =
false,
const bool readfree =
false) :
914 flags.readfree = readfree;
935 SdsId(
void *
const data, StatusType *
const status,
936 const bool import =
false) :
939 flags.readfree =
false;
942 SdsImport(data,&
id,status);
947 SdsAccess(data,&
id,status);
967 SdsId(
const void *
const data, StatusType *
const status) : id(0) {
969 flags.readfree =
false;
971 SdsImport(data,&
id,status);
986 SdsId(
const char *
const filename, StatusType *
const status) :
990 flags.readfree =
true;
991 SdsRead(filename,&
id,status);
1009 const SdsCodeType code,
1010 StatusType *
const status,
const long nextra = 0,
1011 const char *
const extra = 0) :
1015 flags.readfree =
false;
1016 SdsNew(parent_id.id,name,nextra,extra,code,0,0,&
id,status);
1029 SdsId(
const char *
const name,
const SdsCodeType code,
1030 StatusType *
const status,
const long nextra = 0,
1031 const char *
const extra = 0) :
1035 flags.readfree =
false;
1036 SdsNew(0,name,nextra,extra,code,0,0,&
id,status);
1056 const SdsCodeType code,
1057 const long ndims,
const unsigned long *dims,
1058 StatusType *
const status,
const long nextra = 0,
1059 const char *
const extra = 0) :
1063 flags.readfree =
false;
1064 SdsNew(parent_id.id,name,nextra,extra,code,ndims,dims,&
id,status);
1082 SdsId(
const char *
const name,
const SdsCodeType code,
1083 const long ndims,
const unsigned long *dims,
1084 StatusType *
const status,
const long nextra = 0,
1085 const char *
const extra = 0) :
1089 flags.readfree =
false;
1090 SdsNew(0,name,nextra,extra,code,ndims,dims,&
id,status);
1107 const unsigned long *
const indicies, StatusType *
const status) :
1111 flags.readfree =
false;
1112 SdsCell(array_id.id, nindicies, indicies, &
id,status);
1130 flags.readfree =
false;
1131 SdsCopy(source.id, &
id, status);
1146 StatusType *
const status) :
1150 flags.readfree =
false;
1151 SdsFind(source.id,name,&
id,status);
1168 SdsId(
const SdsId& source,
const long index, StatusType *
const status):
1172 flags.readfree =
false;
1173 SdsIndex(source.id,index,&
id,status);
1194 CleanUp(
"SdsId destructor");
1228 void Outlive() { flags.free =
false; flags.del =
false;
1229 flags.readfree =
false; }
1252 virtual void Delete(StatusType *
const status) {
1253 SdsDelete(
id,status);
1254 if (*status == STATUS__OK)
1259 SdsFreeId(
id, status);
1260 if (*status == STATUS__OK)
1292 StatusType *
const status) {
1293 SdsExport(
id,length,data,status);
1316 StatusType *
const status) {
1317 SdsExportDefined(
id,length,data,status);
1332 SdsExtract(
id,status);
1335 if (*status == STATUS__OK)
1339 flags.readfree =
false;
1356 SdsFlush(
id,status);
1380 virtual void Get(
const unsigned long length,
1382 StatusType *
const status,
1383 unsigned long *actlen = 0,
1384 const unsigned long offset=0)
const
1386 unsigned long myactlen;
1387 if (!actlen) actlen = &myactlen;
1388 SdsGet(
id,length,offset,data,actlen,status);
1408 StatusType *
const status,
1409 unsigned long *actlen = 0)
const
1411 unsigned long myactlen;
1412 if (!actlen) actlen = &myactlen;
1413 SdsGetExtra(
id,length,extra,actlen,status);
1436 SdsCodeType *
const code,
1438 unsigned long *
const dims,
1439 StatusType *
const status)
const {
1440 SdsInfo(
id,name,code,ndims,dims,status);
1459 StatusType *
const status)
const {
1462 unsigned long dims[SDS_C_MAXARRAYDIMS];
1463 SdsInfo(
id,name,&code,&ndims,dims,status);
1480 void Code(SdsCodeType *
const code,
1481 StatusType *
const status)
const {
1482 char name[SDS_C_NAMELEN];
1484 unsigned long dims[SDS_C_MAXARRAYDIMS];
1485 SdsInfo(
id,name,code,&ndims,dims,status);
1506 void Dims(
long *
const ndims,
unsigned long *
const dims,
1507 StatusType *
const status)
const {
1508 char name[SDS_C_NAMELEN];
1510 SdsInfo(
id,name,&code,ndims,dims,status);
1523 SdsInsert(
id,to_insert.id,status);
1526 if (*status == STATUS__OK)
1527 to_insert.flags.del =
false;
1544 const unsigned long *
const dims,
1545 StatusType *
const status) {
1546 SdsInsertCell(
id,ndims,dims,to_insert.id,status);
1549 if (*status == STATUS__OK)
1550 to_insert.flags.del =
false;
1565 SdsFillArray(
id,elem.id,status);
1592 void Pointer(
void **data, StatusType *
const status,
1593 unsigned long * length = 0) {
1594 unsigned long mylength;
1595 if (!length) length = &mylength;
1596 SdsPointer(
id,data,length,status);
1619 virtual void Put(
const unsigned long length,
1621 StatusType *
const status,
1622 const unsigned long offset=0)
1624 SdsPut(
id,length,offset,data,status);
1641 const char *
const extra,
1642 StatusType *
const status)
1644 SdsPutExtra(
id,nextra,extra,status);
1656 StatusType *
const status) {
1657 SdsRename(
id,name,status);
1682 void Resize(
const long ndims,
const unsigned long *dims,
1683 StatusType *
const status) {
1684 SdsResize(
id,ndims,dims,status);
1694 void Size(
unsigned long *
const bytes,
1695 StatusType *
const status)
const {
1696 SdsSize(
id,bytes,status);
1708 StatusType *
const status)
const {
1709 SdsSizeDefined(
id,bytes,status);
1717 void List(StatusType *
const status)
const {
1726 void List(FILE *to, StatusType *
const status)
const {
1727 SdsListTo(to,
id,status);
1742 StatusType *
const status)
const {
1743 SdsWrite(
id,filename,status);
1759 StatusType *
const status)
const {
1760 SdsIsExternal(
id, external, status);
1774 StatusType *
const status)
const {
1775 SdsGetExternInfo(
id, data, status);
1789 operator SdsIdType(
void)
const {
return id; }
1800# if (!defined(CPP_NOBOOL)) && (!defined(BORLAND)) && (!defined(__SUNPRO_CC))
1801 operator bool(
void)
const {
return (
id != 0); }
1831 SdsIdType
COut(
const bool outlives,
bool *
const free = 0,
1832 bool *
const del= 0,
bool *
const readfree = 0) {
1838 *readfree = flags.readfree;
1840 flags.free = flags.del = flags.readfree =
false;
1873 void COut(
const bool outlives, SdsIdType *item,
bool *
const free = 0,
1874 bool *
const del= 0,
bool *
const readfree = 0) {
1875 *item = COut(outlives,free,del,readfree);
1905 const char *
const name,
1906 StatusType *
const status) {
1907 CleanUp(
"SdsId::Find");
1911 flags.readfree =
false;
1912 SdsFind(source.id,name,&
id,status);
1933 if (
this != &source)
1935 CleanUp(
"SdsId::ShallowCopy 1");
1943 flags.free = source.flags.free;
1944 flags.del = source.flags.del;
1945 flags.readfree = source.flags.readfree;
1947 source.flags.free = source.flags.del =
1948 source.flags.readfree =
false;
1952 flags.free = flags.del = flags.readfree =
false;
1970 if (
this != &source)
1972 CleanUp(
"SdsId::DeepCopy 1");
1974 SdsCopy(source.id,&
id,status);
1977 flags.readfree =
false;
1990 SdsIsExternal(
id, &external, status);
1997 SdsCopy(
id,&newId,status);
1999 if (*status == STATUS__OK)
2005 CleanUp(
"SdsId::DeepCopy 2");
2009 flags.readfree =
false;
2038 const bool del =
false,
const bool readfree =
false)
2040 CleanUp(
"SdsId::ShallowCopy 2");
2043 flags.readfree = readfree;
2053 void DeepCopy (
const SdsIdType source, StatusType *status)
2055 CleanUp(
"SdsId::DeepCopy 3");
2057 SdsCopy(source,&
id,status);
2060 flags.readfree =
false;
2062#ifdef DRAMA_ALLOW_CPP_STDLIB
2102 StatusType *
const status) {
2104 unsigned long dims[SDS_C_MAXARRAYDIMS];
2105 CheckArrayTypeSingleDim(data->
Code(), dims, status);
2106 if (*status != STATUS__OK)
return;
2107 data->SetElements(dims[0]);
2109 Pointer(data->Data(), status);
2152 const unsigned long expitems,
2154 StatusType *
const status) {
2156 unsigned long dims[SDS_C_MAXARRAYDIMS];
2157 CheckArrayTypeSingleDim(data->
Code(), dims, status);
2158 if (*status != STATUS__OK)
return;
2159 if (dims[0] != expitems)
2161 *status = SDS__INVDIMS;
2164 data->SetElements(dims[0]);
2165 Pointer(data->Data(), status);
2212 unsigned long dims[],
2213 StatusType *
const status) {
2215 if ((ndims < 1)||(ndims > 7))
2217 *status = SDS__INVDIMS;
2220 CheckArrayType(data->
Code(), ndims, dims, status);
2221 if (*status != STATUS__OK)
return;
2226 unsigned long elements = dims[0];
2227 for (
long i = 1; i < ndims ; ++i)
2229 elements *= dims[i];
2231 data->SetElements(elements);
2235 Pointer(data->Data(), status);
2287 unsigned long dims[],
2288 StatusType *
const status) {
2294 Dims(ndims, dims, status);
2298 ArrayAccess(data, *ndims, dims, status);
2308SDSEXTERN
const SdsId SdsNull;
2310#ifdef DRAMA_ALLOW_CPP_STDLIB
2326 std::string _function;
2329 std::vector<unsigned char> _idUseOnEntry;
2330 static unsigned _checkNum;
2356 SdsIDChecker(
int line,
const char *file,
const char *function,
bool listChanges =
false,
bool enable=
true);
2363 _chkData.allow = leaksAllowedCount;
2391 void print(
const char *reason)
const;
2393 void printChanges()
const;
2408#define SDS_CHECK_IDS(_function_) SdsIDChecker _sds_id_checker(__LINE__, __FILE__, (_function_))
2419#define SdsMalloc(_size) (void *)malloc(_size)
2420#define SdsFree(_where) (void)free((void *)(_where))
std::string const & GetDetails() const
Return reason why the exception was thrown.
Definition sds.h:447
InvalidIndexException(const char *why)
InvalidIndexException Constructor.
Definition sds.h:443
This class is thrown by the SdsArrayAccessHelper index operator when it is found the index is invalid...
Definition sds.h:436
std::string const & GetDetails() const
Return reason why the exception was thrown.
Definition sds.h:429
NoDataException(const char *why)
NoDataException Constructor.
Definition sds.h:425
This class is thrown by the SdsArraAccessHelper index operator when it is found there is no data to a...
Definition sds.h:418
SdsCodeType Code() const
Return the SDS type code of the item being accessed.
Definition sds.h:507
T const & operator[](const unsigned long index) const
SDS array subscript operator (const version)
Definition sds.h:524
const T * DataAddressRO() const
Access the data directly - read only.
Definition sds.h:560
unsigned long Size() const
Return the number of elements in the array.
Definition sds.h:510
T * DataAddressRW()
Access the data directly.
Definition sds.h:551
T & operator[](const unsigned long index)
SDS array subscript operator (non-const version)
Definition sds.h:541
SdsArrayAccessHelper(SdsCodeType c)
Constructor - only available to sub-classes.
Definition sds.h:501
Helper class for access to an SDS Scaler Array.
Definition sds.h:410
This is the SdsArrayAccessHelper class Instantiated for access to SDS_BYTE type items.
Definition sds.h:598
This is the SdsArrayAccessHelper class Instantiated for access to SDS_CHAR type items.
Definition sds.h:574
This is the SdsArrayAccessHelper class Instantiationed for access ot SDS_DOUBLE type items.
Definition sds.h:688
This is the SdsArrayAccessHelper class Instantiated for access ot SDS_FLOAT type items.
Definition sds.h:699
This is the SdsArrayAccessHelper class Instantiationed for access ot SDS_INT type items.
Definition sds.h:639
This is the SdsArrayAccessHelper class Instantiationed for access ot SDS_I64 type items.
Definition sds.h:664
This is the SdsArrayAccessHelper class Instantiationed for access ot SDS_SHORT type items.
Definition sds.h:624
This is the SdsArrayAccessHelper class Instantiationed for access ot SDS_UINT type items.
Definition sds.h:651
This is the SdsArrayAccessHelper class Instantiationed for access ot SDS_UI64 type items.
Definition sds.h:676
This is the SdsArrayAccessHelper class Instantiated for access to SDS_UBYTE type items.
Definition sds.h:586
This is the SdsArrayAccessHelper class Instantiated for access to SDS_USHORT type items.
Definition sds.h:612
void SetLeakCount(int leaksAllowedCount)
Set leak allowance count.
Definition sds.h:2362
virtual ~SdsIDChecker()
SdsCheck destructor.
SdsIDChecker(int line, const char *file, const char *function, bool listChanges=false, bool enable=true)
Construct an SdsChecker object.
void DecrLeakCount()
Decrement leak allowance count.
Definition sds.h:2374
int getLeakAllowance()
Get leak count.
Definition sds.h:2381
void IncrLeakCount()
Increment leak allowance count.
Definition sds.h:2369
A class to check for SDS leaks.
Definition sds.h:2321
SdsId(const char *const filename, StatusType *const status)
Constructor which creates an SDS Id after reading a structure from a file.
Definition sds.h:986
SdsId(const void *const data, StatusType *const status)
Constructor that imports a previously exported SDS structure from a const byte stream.
Definition sds.h:967
void Resize(const long ndims, const unsigned long *dims, StatusType *const status)
Change the dimensions of an SDS array.
Definition sds.h:1682
void DeepCopy(const SdsId &source, StatusType *const status)
Replace the item refered to by this object by a deep copy of source.
Definition sds.h:1968
void ArrayAccess(SdsArrayAccessHelper< T > *const data, long ndims, unsigned long dims[], StatusType *const status)
Access the data of an SDS array.
Definition sds.h:2209
void ExportDefined(const unsigned long length, void *const data, StatusType *const status)
Export the SDS structure into a buffer, defining any undefined data.
Definition sds.h:1314
void ArrayAccess(SdsArrayAccessHelper< T > *const data, long *ndims, unsigned long dims[], StatusType *const status)
Access the data of an SDS array.
Definition sds.h:2284
virtual ~SdsId()
SdsId Destructor.
Definition sds.h:1193
void ShallowCopy(const SdsIdType source, const bool free=false, const bool del=false, const bool readfree=false)
Shallow copy from SdsIdType.
Definition sds.h:2037
virtual void Get(const unsigned long length, void *const data, StatusType *const status, unsigned long *actlen=0, const unsigned long offset=0) const
Get data from an SDS item.
Definition sds.h:1380
SdsId(const SdsId &source, StatusType *const status)
SdsId Copy constructor.
Definition sds.h:1126
void Write(const char *const filename, StatusType *const status) const
Write the contents of the structure to a file.
Definition sds.h:1741
void List(FILE *to, StatusType *const status) const
List the contents of the structure to a C file.
Definition sds.h:1726
SdsId(const SdsId &source, const char *const name, StatusType *const status)
Constructor which returns a reference to a named item.
Definition sds.h:1145
void SetDelete()
Indicate the underlying SDS structure should be deleted when the SdsId object is destroyed.
Definition sds.h:1209
void IsExternal(int *const external, StatusType *const status) const
Determine if the SDS structure is external.
Definition sds.h:1758
void GetName(char *const name, StatusType *const status) const
Return the name of the SDS item.
Definition sds.h:1458
void ArrayAccess(const unsigned long expitems, SdsArrayAccessHelper< T > *const data, StatusType *const status)
Access the data of a single dimensional SDS array.
Definition sds.h:2151
void SetFree()
Indicate the underlying SDS item should be free-ed when the SdsId object is destroyed.
Definition sds.h:1203
void Info(char *const name, SdsCodeType *const code, long *const ndims, unsigned long *const dims, StatusType *const status) const
Return information about an SDS item.
Definition sds.h:1435
void DeepCopy(const SdsIdType source, StatusType *status)
Replace the item refered to by this object by a deep copy of source.
Definition sds.h:2053
void GetExternInfo(void **data, StatusType *const status) const
Return the address of an external item.
Definition sds.h:1773
void Extract(StatusType *const status)
Extract the SDS structure from its parent.
Definition sds.h:1331
SdsId(const SdsId &parent_id, const char *const name, const SdsCodeType code, const long ndims, const unsigned long *dims, StatusType *const status, const long nextra=0, const char *const extra=0)
Constructor which creates a new array child item.
Definition sds.h:1055
void PutExtra(const long nextra, const char *const extra, StatusType *const status)
Put extra data into an SDS item.
Definition sds.h:1640
void Export(const unsigned long length, void *const data, StatusType *const status)
Export the SDS structure into a buffer.
Definition sds.h:1290
void ShallowCopy(SdsId &source, const bool outlives=true)
Shallow copy from SdsId.
Definition sds.h:1932
void Insert(SdsId &to_insert, const long ndims, const unsigned long *const dims, StatusType *const status)
Insert an SDS object into this object, which is a structured array.
Definition sds.h:1543
void FillArray(const SdsId &elem, StatusType *const status)
Fill out the contents of this object, which is a structured array.
Definition sds.h:1564
void Insert(SdsId &to_insert, StatusType *const status)
Insert an SDS object into this object.
Definition sds.h:1522
void SizeDefined(unsigned long *const bytes, StatusType *const status) const
Return the size of an SDS structure, as required for exporting defined.
Definition sds.h:1707
void ClearDelete()
Indicate the underlying SDS structure should NOT be deleted when the SdsId object is desroyed.
Definition sds.h:1219
SdsId(const SdsId &array_id, const long nindicies, const unsigned long *const indicies, StatusType *const status)
Constructor that returns a cell of an existing array id.
Definition sds.h:1106
virtual void Put(const unsigned long length, void *const data, StatusType *const status, const unsigned long offset=0)
Put data into an SDS item.
Definition sds.h:1619
void Pointer(void **data, StatusType *const status, unsigned long *length=0)
Object a pointer to the data area of a primitive SDS item.
Definition sds.h:1592
SdsId(void *const data, StatusType *const status, const bool import=false)
Constructor that accesses an exported SDS structure in a byte stream.
Definition sds.h:935
SdsId(const char *const name, const SdsCodeType code, const long ndims, const unsigned long *dims, StatusType *const status, const long nextra=0, const char *const extra=0)
Constructor which creates a new array top-level item.
Definition sds.h:1082
void List(StatusType *const status) const
List the contents of the structure to standard output.
Definition sds.h:1717
void GetExtra(const unsigned long length, char *const extra, StatusType *const status, unsigned long *actlen=0) const
Get extra data from an SDS item.
Definition sds.h:1406
void Find(const SdsId &source, const char *const name, StatusType *const status)
Find an SDS object and make available in the current SdsId object.
Definition sds.h:1904
void Rename(const char *const name, StatusType *const status)
Rename the SDS item.
Definition sds.h:1655
SdsId(const SdsId &parent_id, const char *const name, const SdsCodeType code, StatusType *const status, const long nextra=0, const char *const extra=0)
Constructor which creates a new (non-array) child item.
Definition sds.h:1008
void Outlive()
Force the actual SDS ID to outlive the SdsId variable.
Definition sds.h:1228
void Flush(StatusType *const status)
Flush data modified by pointer.
Definition sds.h:1355
SdsIdType COut(const bool outlives, bool *const free=0, bool *const del=0, bool *const readfree=0)
Return this item as an SdsIdType for return to C code.
Definition sds.h:1831
SdsId(const char *const name, const SdsCodeType code, StatusType *const status, const long nextra=0, const char *const extra=0)
Constructor which creates a new (non-array) top-level item.
Definition sds.h:1029
SdsId(const SdsId &source, const long index, StatusType *const status)
Constructor which returns an id to a structured item indexed by position.
Definition sds.h:1168
void COut(const bool outlives, SdsIdType *item, bool *const free=0, bool *const del=0, bool *const readfree=0)
Return this item as an SdsIdType for return to C code.
Definition sds.h:1873
void Dims(long *const ndims, unsigned long *const dims, StatusType *const status) const
Return the dimensions of the SDS item.
Definition sds.h:1506
void Size(unsigned long *const bytes, StatusType *const status) const
Return the size of an SDS structure, as required for exporting.
Definition sds.h:1694
virtual void Delete(StatusType *const status)
Delete the SDS item.
Definition sds.h:1252
void Code(SdsCodeType *const code, StatusType *const status) const
Return the code of the SDS item.
Definition sds.h:1480
SdsId(const SdsIdType item=0, const bool free=false, const bool del=false, const bool readfree=false)
Construct an SdsId item from an existing C language SDS id.
Definition sds.h:909
void ArrayAccess(SdsArrayAccessHelper< T > *const data, StatusType *const status)
Access the data of a single dimensional SDS array item.
Definition sds.h:2100
A C++ Interface to the handling SDS structures.
Definition sds.h:761