Schema component for numeric data, either Integer or Real.
More...
#include <parsnip_schema.h>
|
|
using | value_type = NumericType |
| |
|
| | RangeSchema (const NumericType min=std::numeric_limits< NumericType >::lowest(), const NumericType max=std::numeric_limits< NumericType >::max()) |
| | Construct a numeric schema from a schema definition.
|
| |
|
| RangeSchema (const RangeSchema &)=default |
| |
|
| RangeSchema (RangeSchema &&)=default |
| |
|
RangeSchema & | operator= (const RangeSchema &)=default |
| |
|
RangeSchema & | operator= (RangeSchema &&)=default |
| |
| | RangeSchema (const Parsnip::Data &schema_spec) |
| | Construct a numeric schema from a schema definition.
|
| |
| virtual RangeSchema * | createCopy () const override |
| | Create an identical, deep copy of the schema.
|
| |
| virtual void | validate (const Parsnip::Data &entry) const override |
| | Validate item range: ensure the datatype falls within the allowed range.
|
| |
| virtual bool | operator== (const SchemaBase &other) const override |
| | Check if two schemas perform the same validation.
|
| |
| virtual void | mergeSchemas (const SchemaBase &from) override |
| | Merge elements into the current schema.
|
| |
| virtual std::ostream & | dump (std::ostream &target, int indent, bool suppress_ident=false) const override |
| | Render the schema in human-friendly text.
|
| |
|
bool | operator!= (const SchemaBase &other) const |
| |
template<typename NumericType>
class Parsnip::RangeSchema< NumericType >
Schema component for numeric data, either Integer or Real.
◆ RangeSchema() [1/2]
template<typename NumericType >
| Parsnip::RangeSchema< NumericType >::RangeSchema |
( |
const NumericType |
min = std::numeric_limits<NumericType>::lowest(), |
|
|
const NumericType |
max = std::numeric_limits<NumericType>::max() |
|
) |
| |
Construct a numeric schema from a schema definition.
- Template Parameters
-
| NumericType | Either double for number or long for integer. |
- Parameters
-
| min | The minimum acceptable value. |
| max | The maximum allowed value. |
◆ RangeSchema() [2/2]
template<typename NumericType >
Construct a numeric schema from a schema definition.
- Template Parameters
-
| NumericType | Either double for number or long for integer. |
- Parameters
-
| schema_spec | The schema specification. |
◆ createCopy()
template<typename NumericType >
◆ dump()
template<typename NumericType >
| std::ostream & Parsnip::RangeSchema< NumericType >::dump |
( |
std::ostream & |
target, |
|
|
int |
indent, |
|
|
bool |
suppress_indent = false |
|
) |
| const |
|
overridevirtual |
Render the schema in human-friendly text.
- Parameters
-
| target | Where to write the schema. |
| indent | Amount of indent to use. |
| suppress_indent | Flag indicating indent was already performed. |
Implements Parsnip::SchemaBase.
◆ mergeSchemas()
template<typename NumericType >
Merge elements into the current schema.
Merge elements managed by this class.
- Elements seen every time are mandatory.
- Elements seen only sometime are optional.
- Elements always seen together are codependent.
- Elements must always expect similar types, except they may vary as element and list-of-same-element.
- Parameters
-
| from | A schema for a valid command command line. |
- Exceptions
-
Reimplemented from Parsnip::SchemaBase.
◆ operator==()
template<typename NumericType >
Check if two schemas perform the same validation.
Compare two schemas to see if they determine validity in the same manner.
- Parameters
-
| other | The schema to compare to. |
- Returns
- True if the schemas match, false otherwise.
Reimplemented from Parsnip::SchemaBase.
Reimplemented in Parsnip::IntegerSchema.
◆ validate()
template<typename NumericType >
The documentation for this class was generated from the following files: