SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Requirements on a numeric value. More...
#include <NumberRequirement.h>
Public Member Functions | |
NumberRequirement () | |
Constructor. | |
virtual void | Reset () override |
Reset Requirement. | |
virtual void | Parse (Value json, const std::string &path) override |
Parse JSON value to set up Requirement. More... | |
virtual void | Validate (const Value &json, const std::string &path) override |
Validate JSON value. More... | |
Public Member Functions inherited from Json::Requirement | |
bool | HasErrors () |
Check if errors have occured. More... | |
std::vector< std::string > | GetErrors () |
Get list of error messages. More... | |
virtual void | ClearErrors () |
Clear list of error messages. | |
virtual bool | HasNotices () |
Check if notices have been queued. More... | |
std::vector< std::string > | GetNotices () |
Get list of notices. More... | |
virtual void | ClearNotices () |
Clear list of notice messages. | |
virtual | ~Requirement () |
Destructor. | |
Private Attributes | |
std::string | path_ |
JSON path. | |
double | multipleOf_ |
Base value for "multiple of" requirement. | |
double | min_ |
Lower bound for range requirement. | |
double | max_ |
Upper bound for range requirement. | |
bool | multSet_ |
If True , "Multiple of" requirement is active. | |
bool | minSet_ |
If True , Lower bound for range requirement is active. | |
bool | maxSet_ |
If True , Upper bound for range requirement is active. | |
bool | exclMin_ |
If True , lower bound is exclusive. | |
bool | exclMax_ |
If True , upper bound is exclusive. | |
Additional Inherited Members | |
Protected Member Functions inherited from Json::Requirement | |
void | PushError (const std::string &error) |
Add error to list of error messages. More... | |
void | PushNotice (const std::string ¬ice) |
Add message to list of notices. More... | |
Requirements on a numeric value.
The numbers are stored internally as double
.
Definition at line 39 of file NumberRequirement.h.
|
inlineoverridevirtual |
Parse JSON value to set up Requirement.
Implements Json::Requirement.
Definition at line 77 of file NumberRequirement.h.
References exclMax_, exclMin_, max_, maxSet_, min_, minSet_, multipleOf_, multSet_, path_, and Reset().
|
inlineoverridevirtual |
Validate JSON value.
Test that the JSON value meets the requirements set via NumberRequirement::Parse(). If the validation fails, an error is added to the list of error messages.
Implements Json::Requirement.
Definition at line 120 of file NumberRequirement.h.
References exclMax_, exclMin_, max_, maxSet_, min_, minSet_, multipleOf_, multSet_, and Json::Requirement::PushError().