#include <seHelperDataTable.h>
Public Member Functions | |
seHelperDataTable () | |
Constructor. | |
seHelperDataTable (const seHelperDataTable &other) | |
Copy constructor. | |
seHelperDataTable & | operator= (const seHelperDataTable &other) |
Assignment. | |
virtual | ~seHelperDataTable () |
Destructor. | |
void | init (seDRMDataTable &data_table, SE_Integer_Positive tpd_index, const SE_Data_Table_Sub_Extent *extents=NULL) |
const SE_Data_Table_Sub_Extent & | getFullExtents () |
const SE_Data_Table_Sub_Extent & | getHelperExtents () |
SE_Integer_Unsigned | getCellCount () |
const SE_Table_Property_Description_Fields & | getTPDFields () |
const SE_Data_Table_Data & | getDTData () |
SE_Integer_Unsigned | getCellIndex (SE_Short_Integer_Unsigned axes_count, SE_Integer_Unsigned axis_indices[]) |
void | getDataValue (SE_Integer_Unsigned cell_index, SE_Single_Value &val) |
Static Public Member Functions | |
void | getDataValue (const SE_Data_Table_Data &dtd, SE_Integer_Unsigned cell_index, SE_Single_Value &val) |
SE_Integer_Unsigned | getValueTypeSize (SE_Data_Table_Data_Value_Type type) |
Returns the size of a data cell of the specified value type. | |
SE_Integer_Unsigned | getTPDCount (seDRMDataTable &data_table) |
SE_Integer_Unsigned | getCellCount (SE_Data_Table_Sub_Extent &extents) |
void | allocateExtents (seDRMDataTable &data_table, SE_Data_Table_Sub_Extent &extents) |
void | deallocateExtents (SE_Data_Table_Sub_Extent &extents) |
Deallocates the extents allocated by allocateExtents(). | |
void | allocateDataTableData (SE_Data_Table_Data &dtd) |
void | deallocateDataTableData (SE_Data_Table_Data &dtd) |
Deallocates the data table data allocated by allocateDataTableData(). | |
SE_Single_Value_Type | mapDTDVTtoSVT (SE_Data_Table_Data_Value_Type type) |
Protected Member Functions | |
void | reset () |
Resets the helper's data. | |
void | copyFrom (const seHelperDataTable &other) |
Copy data from another. | |
void | checkValid () |
Checks the helper is valid. | |
Protected Attributes | |
SE_Data_Table_Sub_Extent | _extents |
Extents of helper. | |
SE_Data_Table_Sub_Extent | _full_extents |
Full extents. | |
SE_Table_Property_Description_Fields | _tpd_flds |
TPD fields. | |
SE_Data_Table_Data | _dt_data |
Data Table data retrieved. | |
SE_Integer_Unsigned * | _axis_size |
For quick cell index computation. |
Sample usage, cycle through all Data Table cells for a particular <Table Property Description>:
seHelperDataTable hlpr; seDRMDataTable data_table; EDCS_Attribute_Code eac; //... retrieve the "data_table" object, choose tpd_index to retrieve //... set "eac" to the attribute code being used, from the TPD hlpr.init(data_table, tpd_index); SE_Integer_Unsigned cell_count = hlpr.getCellCount(); for (SE_Integer_Unsigned cell_index=0; cell_index < cell_count; cell_index++) { SE_Single_Value val; hlpr.getDataValue(cell_index, val); SE_PrintSingleValue(eac, &val, NULL, 0); // eac is from the TPD SE_FreeSingleValue(&val, NULL); // don't forget to free! }
Sample usage, get cell value at a specific index by axis for a particular <Table Property Description> and sub-extents:
seHelperDataTable hlpr; seDRMDataTable data_table; SE_Data_Table_Sub_Extent extents; //... retrieve the "data_table" object, choose tpd_index to retrieve //... decide sub-extents wanted from the data, or pass NULL for extents seHelperDataTable::allocateExtents(data_table, extents); // change extents values if needed hlpr.init(data_table, tpd_index, &extents); SE_Integer_Unsigned *indices = new SE_Integer_Unsigned[extents.axes_count]; //... set "indices" array values to point to the cell you want // get the cell index into the data array SE_Integer_Unsigned cell_index = hlpr.getCellIndex(extents.axes_count, indices); //... from here you can index directly into the SE_Data_Table_Data // (see getDTData()), or put it into a single value as shown below: SE_Single_Value val; hlpr.getDataValue(cell_index, val); SE_PrintSingleValue(eac, &val, NULL, 0); // eac is from the TPD SE_FreeSingleValue(&val, NULL); // don't forget to free! // free resources seHelperDataTable::deallocateExtents(extents); delete[] index;
You can also use this class to modify the data in the Data Table. Just retrieve the data as shown above, modify the data by getting a reference to the DT Data structure, and pass it back to the Data Table object:
seHelperDataTable hlpr; seDRMDataTable data_table; SE_Data_Table_Sub_Extent extents; //... initialize extents and helper, get cell index, as above const SE_Data_Table_Data &dtdata = hlpr.getDTData(); // modify the index into dtdata dtdata.dt_array.single_long_float_values[cell_index] = x; // EXAMPLE // write back the modified data data_table.putDataTableData(1, &dtdata, &extents); // free resources...
Be careful when using this class in STL containers, since some operations may require copy/reallocation of data which could adversely impact performance.
|
|
|
|
|
|
|
Allocates an array of cells for a particular value type. All non-dynamic fields should be set appropriately or this method will fail.
|
|
Retrieves the extents information for a <Data Table> object. Use deallocateExtents() to deallocate the memory. |
|
|
|
|
|
|
|
|
|
Retrieves the number of cells in the passed-in extents. You can use this method in combination with allocateExtents() to get information about the <Data Table> object before getting the actual data.
|
|
Returns the number of cells in the helper's extents. This is the same value stored in the Data Table Data structure, obtained from getDTData(). |
|
Returns the index for an axis-indexed cell into the value pointers in the DT Data structure. The
|
|
Gets the value at the specified cell index.
|
|
Gets the value at the specified cell index. You can get a cell index value for an axis-index by using getCellIndex().
|
|
Returns a reference to the data for the helper's extents. You can use the appropriate pointer indexed by the index returned by getCellIndex() to get to the value you want. Since the data table data is managed by this class (users don't need to free it), you can keep an instance of this class as long as you need access to the Data Table's data. This is true even if the transmittal is closed or the Data Table object used to initialize the helper goes out of scope.
|
|
Returns the full extents of the <Data Table> data. If you want to retrieve the extents used to initialize this helper, use getHelperExtents().
|
|
Returns the extents used to retrieve the <Data Table> data. The extents returned are the same extents that were used to initialize this helper (which could be the full extents if none was specified).
|
|
Retrieves the number of <Table Property Description>'s for a <Data Table> object. You can use this method in combination with allocateExtents() to get information about the <Data Table> object before getting the actual data.
|
|
Returns the fields of the <Table Property Description> used to initialize this helper.
|
|
|
|
Initialize the helper and retrieve data from a <Data Table>. The
Optional You can use allocateExtents() to retrieve the extents of the data in a <Data Table> object before calling this function. This is useful, for example, to specify a reduced extent.
|
|
Returns an appropriate mapping for using Single Values.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SEDRIS Transmittal Access C++ API | 4.0.0 beta - 14 Jul 2004 |
Copyright © 2004 SEDRIS | Docs by Doxygen 1.3.2 |