DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Collapse ModelsModels
Collapse DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Search Documentation


IData Interface

GetRecordCount
GetFieldCount
GetFieldAt
GetDoubleAt
GetLongAt
GetStringAt
GetFieldType
GetFieldDescription

IData manages a data set. A data set is an array of records similar to a database table. Each record consists of fixed number of fields of different type. 

In this release the only place where IData is involved is the IntersectObject method of ILineMetr interface.

See also Cannon sample, Interface List


HRESULT GetRecordCount(int *count)

Parameters

count- [out] reference to an integer variable which will be set to number of records in the record set

Returns

S_OK in case of success.
 
Remarks: 

The method returns the number record in the record set.


HRESULT GetFieldCount(int *count)

Parameters

count- [out] reference to an integer variable which will be set to number of fields in each record of the set.

Return Values

S_OK in case of success.
Remarks:
 
This method returns number of fields in each record of the record set. This method along with the GetFieldDescription and GetFieldType methods allows discovering structure of the data table at runtime. 

HRESULT GetFieldAt(int index, int field, VARIANT *data)

Parameters

index - [in] index of a record in the record set.

field - [in] index of the field in the record to be retrieved

data - [out] returned value of the field. See remarks.

Returns

S_OK in case of success.

DISP_E_BADINDEX if index or field are out of range.

Remarks:

This method will return value of field-th field in index-th record. Type of data is described by vt member of the data parameter.


HRESULT GetDoubleAt(int index, int field, double *data)

Parameters

index - [in] index of a record in the record set.

field - [in] index of the field in the record to be retrieved

data - [out] returned value of the field. 

Returns

S_OK in case of success.

DISP_E_BADINDEX if index or field are out of range.

DISP_E_PARAMNOTOPTIONAL if field  does not have double or single type

Remarks:

This a shortcut for GetFieldAt method above/ This method will return value of field-th field in index-th record. The caller has to make sure that the field has double type. Types of each field in the table are described by the documentation for every particular usage. It ca also be retrieved at runtime using GetFieldType and GetFieldDescription.


HRESULT GetLongAt(int index, int field, long *data)

Parameters

index - [in] index of a record in the record set.

field - [in] index of the field in the record to be retrieved

data - [out] returned value of the field. 

Returns

S_OK in case of success.

DISP_E_BADINDEX if index or field are out of range.

DISP_E_PARAMNOTOPTIONAL if field  does not have integral type.

Remarks:

This a shortcut for GetFieldAt method above/ This method will return value of field-th field in index-th record. The caller has to make sure that the field has integer  type. Types of each field in the table are described by the documentation for every particular usage. It ca also be retrieved at runtime using GetFieldType and GetFieldDescription.


HRESULT GetStringAt(int index, int field, BSTR *string)

Parameters

index - [in] index of a record in the record set.

field - [in] index of the field in the record to be retrieved

string - [out] returned value of the field. 

Returns

S_OK in case of success.

DISP_E_BADINDEX if index or field are out of range.

DISP_E_PARAMNOTOPTIONAL if field  does not have string type.

Remarks:

This a shortcut for GetFieldAt method above/ This method will return value of field-th field in index-th record. The caller has to make sure that the field has integer  type. Types of each field in the table are described by the documentation for every particular case. It ca also be retrieved at runtime using GetFieldType and GetFieldDescription.


HRESULT GetFieldType(int field, EDataType* type)

Parameters

index - [in] index of a record in the record set.

field - [in] index of the field in the record to be retrieved

type  - [out] returned value, member of EDataType enumeration describing the type of the field.

Returns

S_OK in case of success.

Remarks:

This method along with the GetFieldCount and GetFieldDescription methods allows discovering structure of the data table at runtime. 


HRESULT GetFieldDescription(int field, BSTR *descript)

Parameters

field - [in] index of the field in the table

descript - [out] returned description string

Returns

S_OK in case of success.

Remarks:  

The method returns a short description of data stored in the field of the data table. 

This method along with the GetFieldCount and GetFieldType methods allows discovering structure of the data table at runtime.