|
Telescience Resource Kit
TReK C++
5.4.0 ART
|
This class determine a parameter's dependency based on a numeric comparison. More...
#include <comparison_dependency.h>
Inherits trek::Dependency.
Public Member Functions | |
int32_t | LoadFile (const char *filename) |
Loads the ComparisonDependency definition from the specified file. More... | |
int32_t | SaveFile (const char *filename) |
Saves the ComparisonDependency definition to the specified file. More... | |
Constructors, Destructor, and Other Basic Methods | |
ComparisonDependency () | |
Default constructor of the class. | |
ComparisonDependency (ComparisonDependency &input) | |
Copy constructor of the class. | |
virtual | ~ComparisonDependency () |
Class destructor. More... | |
virtual Dependency * | Clone () |
Creates and returns an extact copy of the object. | |
void | operator= (ComparisonDependency &right_side) |
Provides the equal operator. | |
Dependency Methods | |
int32_t | Configure (const char *name, enum comparison_type comp_type, double value, bool use_cal, uint16_t samp_num=1) |
Configures the comparison dependency. More... | |
double | GetValue () |
Returns the value for the comparison depenendcy. | |
enum comparison_type | GetComparisonType () |
Returns the comparison type for the comparison depenendcy. | |
bool | GetUseCalibratedValue () |
Returns if the calibrated value should be used in the comparison. | |
uint16_t | GetSampleNumber () |
Returns the start sample number for the comparison depenendcy. | |
virtual bool | Check () |
Checks for if the dependency is met. More... | |
![]() | |
enum dependency_type | GetType () |
Returns an enumeration for the type of dependency. | |
const char * | GetDependencyParameter () |
Returns the parameter to use for the counter. | |
Dependency () | |
Default constructor of the class. | |
Dependency (Dependency &input) | |
Copy constructor of the class. | |
virtual | ~Dependency () |
Class destructor. More... | |
void | operator= (Dependency &right_side) |
Provides the equal operator. | |
virtual void | Init () |
Initializes the object. | |
![]() | |
void | SetName (const char *input_ptr) |
Sets the name of the item. More... | |
void | SetAlias (const char *input) |
Sets the alias of the item. More... | |
void | SetShortDescription (const char *input_ptr) |
Sets the short description of the item. More... | |
void | SetLongDescription (const char *input_ptr) |
Sets the long description of the item. More... | |
void | SetUserDescription (const char *input_ptr) |
Sets the user description of the item. More... | |
void | SetOwner (const char *input_ptr) |
Sets the owner of the item. More... | |
void | SetPath (const char *input_ptr) |
Sets the path for the item. More... | |
const char * | GetName () |
Returns the name of the item. | |
const char * | GetAlias () |
Returns the alias of the item. | |
const char * | GetShortDescription () |
Returns the short description of the item. | |
const char * | GetLongDescription () |
Returns the long description of the item. | |
const char * | GetUserDescription () |
Returns the user description of the item. | |
const char * | GetOwner () |
Returns the owner of the item. | |
const char * | GetPath () |
Returns the path for the item. | |
int32_t | AddAttribute (const char *name, const char *value) |
Adds an attribute to the item. More... | |
void | GetAttributeList (StringArray &attr_array) |
Gets a list of the attribute names. More... | |
int32_t | GetAttribute (const char *name, char *value, uint32_t &value_len) |
Get the value of the specified attribute. More... | |
NamedItem () | |
Default constructor of the class. | |
NamedItem (NamedItem &input) | |
Copy constructor of the class. | |
virtual | ~NamedItem () |
Class destructor. More... | |
void | operator= (NamedItem &right_side) |
Provides the equal operator. | |
bool | operator== (NamedItem &right_side) |
Provides the == operator. | |
This class determine a parameter's dependency based on a numeric comparison.
A simple comparison class used to determine inclusion of a parameter based on the comparison with a value from a second parameter. Comparison operators supported are equal, not equal, greater than, great than or equal to, less than, and less than or equal to.
|
virtual |
Class destructor.
Removes all resources created with this instance of the class.
|
virtual |
Checks for if the dependency is met.
Compares dependency parameter value to the configured data to see if the parameter is included in the packet.
Example:
Implements trek::Dependency.
int32_t trek::ComparisonDependency::Configure | ( | const char * | name, |
enum comparison_type | comp_type, | ||
double | value, | ||
bool | use_cal, | ||
uint16_t | samp_num = 1 |
||
) |
Configures the comparison dependency.
Sets the parameter to check for dependency as well as the required attributes. The parameter name is not checked on input for existence in the containing packet. Also, the sample number is not checked to see if it exists. These checks will be performed when validation is available at the packet level.
[in] | name | The name of the parameter whose value is checked. |
[in] | comp_type | The comparison type. |
[in] | value | The value to comparison against. |
[in] | samp_num | The sample number of the parameter to use. Sample numbers begin with 1. |
Example:
int32_t trek::ComparisonDependency::LoadFile | ( | const char * | filename | ) |
Loads the ComparisonDependency definition from the specified file.
Reads an XML format for the ComparisonDependency. It can be written in with SaveFile.
[in] | filename | The file to load the parameter object from. |
Example:
int32_t trek::ComparisonDependency::SaveFile | ( | const char * | filename | ) |
Saves the ComparisonDependency definition to the specified file.
Writes an XML format for the ComparisonDependency. It can be read in with LoadFile.
[in] | filename | The file to save the parameter object to. |
Example: