OC Updated for version 2.0
|
#include <stdlib.h>
#include <stdio.h>
Go to the source code of this file.
Definition in file oc.h.
Obtain the data instance corresponding to the container of a specied instance object.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data instance of interest |
[out] | containerp | A pointer into which the container instance is stored. |
OC_NOERR | The procedure executed normally. |
OC_EINVAL | The data object has no container (=> it is a Dataset instance). |
OtherError | One of the arguments (link, etc.) was invalid. |
Return the dds node that is the "template" for this data instance.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
[out] | nodep | A pointer into which the ddsnode is stored. |
OC_NOERR | The procedure executed normally. |
OtherError | One of the arguments (link, etc.) was invalid. |
OCerror oc_data_free | ( | OClink | , |
OCdatanode | data | ||
) |
Data Management
Obtain the datanode root associated with a DataDDS tree.
[in] | link | The link through which the server is accessed. |
[in] | ddsroot | The DataDDS tree root. |
[out] | datarootp | A pointer into which the datanode root is stored. |
OC_NOERR | The procedure executed normally. |
OtherError | One of the arguments (link, etc.) was invalid. |
Obtain the data instance corresponding to the array field of a Grid container instance. Equivalent to oc_data_ithfield(link,grid,0,arraydata).
[in] | link | The link through which the server is accessed. |
[in] | grid | The grid container instance of interest. |
[out] | arraydatap | A pointer into which the grid array instance is stored. |
OC_NOERR | The procedure executed normally. |
OtherError | One of the arguments (link, etc.) was invalid. |
Definition at line 888 of file oc.c.
References oc_data_ithfield().
Obtain the data instance corresponding to the ith map field of a Grid container instance. Equivalent to oc_data_ithfield(link,grid-container,index+1,mapdata). Note that Map indices start at zero.
[in] | link | The link through which the server is accessed. |
[in] | grid | The grid container instance of interest. |
[in] | index | The map index of the map to return. |
[out] | mapdatap | A pointer into which the grid map instance is stored. |
OC_NOERR | The procedure executed normally. |
OtherError | One of the arguments (link, etc.) was invalid. |
Definition at line 909 of file oc.c.
References oc_data_ithfield().
Return the value one (1) if the specified data instance is indexable. Indexable means that the data instance is a dimensioned Structure or it is a Sequence (but not a record in a Sequence).
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
one(1) | if the specified data instance is indexable. |
zero(0) | otherwise. |
int oc_data_indexed | ( | OClink | link, |
OCdatanode | datanode | ||
) |
Return the value one (1) if the specified data instance was obtained by applying either the procedure oc_data_ithelement or oc_data_ithrecord. This means that the operation oc_data_position() will succeed when applied to this data instance.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
one(1) | if the specified data instance has an index. |
zero(0) | otherwise. |
OCerror oc_data_ithelement | ( | OCobject | link, |
OCobject | datanode, | ||
size_t * | indices, | ||
OCobject * | elementp | ||
) |
Return the data of a dimensioned Structure corresponding to the element instance specified by the indices argument.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
[in] | indices | A vector of indices specifying the element instance to return. This vector must be allocated and free'd by the caller. |
[out] | elementp | A pointer into which the element instance is stored. |
OC_NOERR | The procedure executed normally. |
OC_EBADTYPE | The data instance was not of type OC_Structure or was a scalar. |
OC_EINDEX | The indices specified an illegal element. |
OtherError | One of the arguments (link, etc.) was invalid. |
Obtain the data instance corresponding to the i'th field of a data node instance that itself is a container instance.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The container data node instance of interest. |
[in] | index | The index (starting at zero) of the field instance to return. |
[out] | fieldp | A pointer into which the i'th field instance is stored. |
OC_NOERR | The procedure executed normally. |
OC_EINDEX | The index was greater than the number of fields. |
OtherError | One of the arguments (link, etc.) was invalid. |
Definition at line 856 of file oc.c.
References OC_EINVAL, OC_NOERR, OCDEREF, and OCVERIFY.
Referenced by oc_data_gridarray(), and oc_data_gridmap().
Return the i'th record instance of a Sequence data instance.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
[in] | index | The record instance to return. |
[out] | recordp | A pointer into which the record instance is stored. |
OC_NOERR | The procedure executed normally. |
OC_EBADTYPE | The data instance was not of type OC_Sequence |
OC_EINDEX | The indices is larger than the number of records of the Sequence. |
OtherError | One of the arguments (link, etc.) was invalid. |
Return the OCtype of the ddsnode that is the "template" for this data instance. This is a convenience function since it can be obtained using a combination of other API procedures.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
[out] | typep | A pointer into which the OCtype value is stored. |
OC_NOERR | The procedure executed normally. |
OtherError | One of the arguments (link, etc.) was invalid. |
Return the i'th record instance of a Sequence data instance. Return the indices for this data instance; Assumes the data was obtained using oc_data_ithelement or oc_data_ithrecord.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
[out] | indices | A vector into which the indices of the data instance are stored. If the data instance is a record, then only indices[0] is used. |
OC_NOERR | The procedure executed normally. |
OC_EBADTYPE | The data instance was not of type OC_Sequence or it was not a dimensioned instance of OC_Structure. |
OtherError | One of the arguments (link, etc.) was invalid. |
OCerror oc_data_read | ( | OCobject | link, |
OCobject | datanode, | ||
size_t * | start, | ||
size_t * | edges, | ||
size_t | memsize, | ||
void * | memory | ||
) |
This procedure does the work of actually extracting data from a leaf instance of a data tree and storing it into memory for use by the calling code. The data instance must be referencing either a scalar primitive value or an array of primitive values. That is, its oc_data_octype() value must be OCatomic. If the variable is a scalar, then the index and count vectors will be ignored.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
[in] | start | A vector of indices specifying the starting element to return. |
[in] | edges | A vector of indices specifying the count in each dimension of the number of elements to return. |
[in] | memsize | The size (in bytes) of the memory argument. |
[out] | memory | User allocated memory into which the extracted data is to be stored. The caller is responsible for allocating and free'ing this argument. |
OC_NOERR | The procedure executed normally. |
OC_EINVAL | The memsize argument is too small to hold the specified data. |
OC_EINVALCOORDS | The start and/or edges argument is outside the range of legal indices. |
OC_EDATADDS | The data retrieved from the server was malformed and the read request cannot be completed. |
OtherError | One of the arguments (link, etc.) was invalid. |
Definition at line 1246 of file oc.c.
References OC_EDATADDS, OC_EINVAL, OC_EINVALCOORDS, OC_NOERR, OCDEREF, and OCVERIFY.
Return the number of records associated with a Sequence data object. Be warned that applying this procedure to a record data instance (as opposed to an instance representing a whole Sequence) will return an error. More succinctly, the data object's OCtype must be of type OC_Sequence and oc_data_indexable() must be true.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data node instance of interest. |
[out] | countp | A pointer into which the record count is stored. |
OC_NOERR | The procedure executed normally. |
OC_EBADTYPE | The data instance was not of type OC_Sequence or it was a record data instance. |
OtherError | One of the arguments (link, etc.) was invalid. |
Obtain the data instance corresponding to the root of the tree of which the specified instance object is a part.
[in] | link | The link through which the server is accessed. |
[in] | datanode | The data instance of interest |
[out] | rootp | A pointer into which the root instance is stored. |
OC_NOERR | The procedure executed normally. |
OtherError | One of the arguments (link, etc.) was invalid. |
long oc_get_lastmodified_data | ( | OClink | ) |
Node Interconnection Management
As a rule, the attributes of an object are accessed using the oc_dds_attr procedure rather than by traversing a DAS. In order to support this, the oc_merge_das procedure annotates a DDS node with attribute values taken from a specified DAS node.
[in] | link | The link through which the server is accessed. |
[in] | dasroot | The root object of a DAS tree. |
[in] | ddsroot | The root object of a DDS (or DataDDS) tree. |
OC_NOERR | The procedure executed normally. |
OtherError | One of the arguments (link, etc.) was invalid. |