AAO DRAMA C++ Interface (Old style)
DRAMA C++, Depreciated, don't use for new code
|
A C++ Interface to the handling SDS structures. More...
#include <sds.h>
Public Member Functions | |
SdsId (const char *const filename, StatusType *const status) | |
Constructor which creates an SDS Id after reading a structure from a file. | |
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. | |
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. | |
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. | |
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. | |
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. | |
SdsId (const SdsId &source, const char *const name, StatusType *const status) | |
Constructor which returns a reference to a named item. | |
SdsId (const SdsId &source, const long index, StatusType *const status) | |
Constructor which returns an id to a structured item indexed by position. | |
SdsId (const SdsId &source, StatusType *const status) | |
SdsId Copy constructor. | |
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. | |
SdsId (const void *const data, StatusType *const status) | |
Constructor that imports a previously exported SDS structure from a const byte stream. | |
SdsId (void *const data, StatusType *const status, const bool import=false) | |
Constructor that accesses an exported SDS structure in a byte stream. | |
virtual | ~SdsId () |
SdsId Destructor. | |
template<typename T > | |
void | ArrayAccess (const unsigned long expitems, SdsArrayAccessHelper< T > *const data, StatusType *const status) |
Access the data of a single dimensional SDS array. | |
template<typename T > | |
void | ArrayAccess (SdsArrayAccessHelper< T > *const data, long *ndims, unsigned long dims[], StatusType *const status) |
Access the data of an SDS array. | |
template<typename T > | |
void | ArrayAccess (SdsArrayAccessHelper< T > *const data, long ndims, unsigned long dims[], StatusType *const status) |
Access the data of an SDS array. | |
template<typename T > | |
void | ArrayAccess (SdsArrayAccessHelper< T > *const data, StatusType *const status) |
Access the data of a single dimensional SDS array item. | |
void | ClearDelete () |
Indicate the underlying SDS structure should NOT be deleted when the SdsId object is desroyed. | |
void | Code (SdsCodeType *const code, StatusType *const status) const |
Return the code of the SDS item. | |
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. | |
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. | |
void | DeepCopy (const SdsId &source, StatusType *const status) |
Replace the item refered to by this object by a deep copy of source. | |
void | DeepCopy (const SdsIdType source, StatusType *status) |
Replace the item refered to by this object by a deep copy of source. | |
virtual void | Delete (StatusType *const status) |
Delete the SDS item. | |
void | Dims (long *const ndims, unsigned long *const dims, StatusType *const status) const |
Return the dimensions of the SDS item. | |
void | Export (const unsigned long length, void *const data, StatusType *const status) |
Export the SDS structure into a buffer. | |
void | ExportDefined (const unsigned long length, void *const data, StatusType *const status) |
Export the SDS structure into a buffer, defining any undefined data. | |
void | Extract (StatusType *const status) |
Extract the SDS structure from its parent. | |
void | FillArray (const SdsId &elem, StatusType *const status) |
Fill out the contents of this object, which is a structured array. | |
void | Find (const SdsId &source, const char *const name, StatusType *const status) |
Find an SDS object and make available in the current SdsId object. | |
void | Flush (StatusType *const status) |
Flush data modified by pointer. | |
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. | |
void | GetExternInfo (void **data, StatusType *const status) const |
Return the address of an external item. | |
void | GetExtra (const unsigned long length, char *const extra, StatusType *const status, unsigned long *actlen=0) const |
Get extra data from an SDS item. | |
void | GetName (char *const name, StatusType *const status) const |
Return the name of the SDS item. | |
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. | |
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. | |
void | Insert (SdsId &to_insert, StatusType *const status) |
Insert an SDS object into this object. | |
void | IsExternal (int *const external, StatusType *const status) const |
Determine if the SDS structure is external. | |
void | List (FILE *to, StatusType *const status) const |
List the contents of the structure to a C file. | |
void | List (StatusType *const status) const |
List the contents of the structure to standard output. | |
operator bool (void) const | |
Operator which tests if an item is valid. | |
operator SdsIdType (void) const | |
Operator which returns the underlying SDS id. | |
void | Outlive () |
Force the actual SDS ID to outlive the SdsId variable. | |
void | Pointer (void **data, StatusType *const status, unsigned long *length=0) |
Object a pointer to the data area of a primitive SDS item. | |
virtual void | Put (const unsigned long length, void *const data, StatusType *const status, const unsigned long offset=0) |
Put data into an SDS item. | |
void | PutExtra (const long nextra, const char *const extra, StatusType *const status) |
Put extra data into an SDS item. | |
void | Rename (const char *const name, StatusType *const status) |
Rename the SDS item. | |
void | Resize (const long ndims, const unsigned long *dims, StatusType *const status) |
Change the dimensions of an SDS array. | |
void | SetDelete () |
Indicate the underlying SDS structure should be deleted when the SdsId object is destroyed. | |
void | SetFree () |
Indicate the underlying SDS item should be free-ed when the SdsId object is destroyed. | |
void | ShallowCopy (const SdsIdType source, const bool free=false, const bool del=false, const bool readfree=false) |
Shallow copy from SdsIdType. | |
void | ShallowCopy (SdsId &source, const bool outlives=true) |
Shallow copy from SdsId. | |
void | Size (unsigned long *const bytes, StatusType *const status) const |
Return the size of an SDS structure, as required for exporting. | |
void | SizeDefined (unsigned long *const bytes, StatusType *const status) const |
Return the size of an SDS structure, as required for exporting defined. | |
void | Write (const char *const filename, StatusType *const status) const |
Write the contents of the structure to a file. | |
A C++ Interface to the handling SDS structures.
The class SdsId provides a C++ interface to the AAO DRAMA SDS Library. See The SDS Specification for more details on SDS itself.
An assortment of constructors are provided. Some of these access components of structures, some access external items and some create new SDS structures. Each SdsId class object contains an SDS id which refers to an SDS structure, rather then a complete SDS structure and more then on SdsId can refer to the one underlying SDS structure. Additionally, details about what to do when the object goes out of scope are maintained, ensuring the the destructor cleans up correctly.
If any of the constructors fail, then the current implementation will set the inherited status argument bad rather then throwing an exception. The object is still constructed in this case but will refer to an invalid SDS id, causing any other methods to fail (by setting status bad). If the inherited status is not equal to STATUS__OK on entry to any method with an inherited status argument, then the method returns immediately.
The various methods of the class implement those SDS functions which do not return new SDS id's (SDS functions which return new SDS id's are implemented as constructors).
The destructor will normally delete the underlying SDS item and and free the SDS id, when appropriate. These operations are normally dependent on how the item was constructed, but can be changed if required (which might be required if the underlying SDS id is to be passed to a C function).
Assignment and copying of these items is prohibited by making the operators private. This is done since it is not clear what the user will expect from some operations. (for example, in a copy constructor, should the item be copied with the C routine SdsCopy() or just a new id to the same item generated. SDS does not even support the later. Also, management of the inherited status is a problem).
You can pass items to subroutines by reference or pointer to get around the copy problem. A constructor which creates a copy of an existing object can be used in the place of assignment in many cases. You can use the member functions ShallowCopy() (which just copies the Sds id itself) and DeepCopy(), to get a copy in an explicit maner in other cases.
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated on Thu Dec 12 2024 23:07:38 for AAO DRAMA C++ Interface (Old style) by 1.9.8