| |||
| Home > The Cycle Accurate Debug Interface > CADI data structures > CADIParameterInfo_t and CADIParameterValue_t |
CADIParameterInfo_t and CADIParameterValue_t structures are used to configure component parameters.
Example 3.18. CADIParameterInfo_t
struct CADIParameterInfo_t
{
public: // methods
CADIParameterInfo_t(uint32_t id=0, const char *name_par="",
CADIValueDataType_t dataType=CADI_PARAM_INVALID,
const char *description_par = "", uint32_t isRunTime = 0,
int64_t minValue = 0, int64_t maxValue = 0,
int64_t defaultValue = 0, const char *defaultString_par = "") :
id(id), dataType(dataType), isRunTime(isRunTime),
minValue(minValue), maxValue(maxValue), defaultValue(defaultValue)
{
AssignString(name, name_par, CADI_NAME_SIZE);
AssignString(description, description_par, CADI_DESCRIPTION_SIZE);
AssignString(defaultString, defaultString_par,
CADI_DESCRIPTION_SIZE);
}
public: // data
uint32_t id; // Used for identification
char name[CADI_NAME_SIZE]; // Name of the parameter
CADIValueDataType_t dataType; // Data type for interpretation purposes
// of the debugger
char description[CADI_DESCRIPTION_SIZE]; // Parameter description
uint32_t isRunTime; /* If equals to 0, then the parameter is
instantiation-time only.
If equals to 1, then the parameter can be
changed at run-time */
int64_t minValue; // minimum admissible value
int64_t maxValue; // maximum admissible value
int64_t defaultValue; // default value if parameter is type
// bool/int
char defaultString[CADI_DESCRIPTION_SIZE]; // default string if
// parameter is type CADI_PARAM_STRING
};
Example 3.19. CADIParameterValue_t
struct CADIParameterValue_t
{
public: // methods
CADIParameterValue_t(uint32_t parameterID = static_cast<uint32_t>(-1),
CADIValueDataType_t dataType=CADI_PARAM_INVALID,
int64_t intValue = 0, const char *stringValue_par="") :
parameterID(parameterID), dataType(dataType), intValue(intValue)
{
AssignString(stringValue, stringValue_par, CADI_DESCRIPTION_SIZE);
}
public: // data
uint32_t parameterID; // Refers to the id of respective
// CADIParameterInfo_t.
CADIValueDataType_t dataType; // Data type.
int64_t intValue; // This also contains the BOOL
// (0 = false, 1 = true).
char stringValue[CADI_DESCRIPTION_SIZE]; // String value if type is
// string.
};