SRGStructureData Class Overview
This abstract class is the basis for all classes that connect to external data. It provides a standardized set of methods for extracting data from any array of structures. The class maintains a set of pointers and indices that are used to access the data. It is the responsibility of the derived class to extract the information from the data type. The structure data classes are primarily designed to extract data from C-style structures that reside in memory.Objective Chart assumes that all data to be plotted will be a double precision floating-point number, but the members of the structure may be any numeric data type and may have a different physical size. Therefore, there are a number of classes, based upon SRGStructureData, which handle various data types. SRGIntStructData is designed to extract integers. SRGFloatStructData extracts single precision floating-point numbers. SRGCharStructData extracts byte-sized characters. SRGShortStructData extracts short integers. SRGDoubleStructData handles double precision floating-point numbers.
Classes to handle other data types can be derived from SRGStructureData by simply overriding the GetValue and SetValue functions, following the example in these classes.
SRGStructureData is derived from SRGraphDynamicData, so the same access methods are available. First, Objective Chart needs to know how your memory buffer is configured. Call SetStructure with a pointer to your memory block, SetStructureSize with the total size of the elemental structure (use sizeof), SetBufferSize with the number of structure elements in the array, and SetDataOffset with the position of the desired data within the structure. Separate positions are maintained for input and output (IncrementInput, DecrementInput, IncrementOutput, DecrementOutput). Then use GetValue and SetValue to access the data at the current position.