|
OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
Represents a single configuration parameter. More...
#include <JsonConfig.h>
Public Types | |
| enum | ParamType { UNASSIGNED =0, BOOL =1, INT =2, UINT =3, FLOAT =4, STRING =5, VECTOR =6 } |
Public Member Functions | |
| JsonParam () | |
| JsonParam (const ossimString &argname, const ossimString &arglabel, const ossimString &argdescr, ParamType argparamType, void *value) | |
| JsonParam (const JsonParam ©) | |
| ~JsonParam () | |
| bool | loadJSON (const Json::Value &json_node) |
| Initializes from a JSON node. More... | |
| void | saveJSON (Json::Value &json_node) const |
| const ossimString & | name () const |
| const ossimString & | label () const |
| const ossimString & | descr () const |
| ParamType | type () const |
| bool | isBool () const |
| bool | asBool () const |
| bool | isUint () const |
| unsigned int | asUint () const |
| bool | isInt () const |
| int | asInt () const |
| bool | isFloat () const |
| double | asFloat () const |
| bool | isString () const |
| std::string | asString () const |
| bool | isVector () const |
| void | asVector (std::vector< double > &v) const |
| bool | operator== (const JsonParam &p) const |
Private Member Functions | |
| void | setValue (void *value) |
| void | resetValue () |
Private Attributes | |
| ossimString | _name |
| ossimString | _label |
| ossimString | _descr |
| ParamType | _type |
| void * | _value |
| std::vector< ossimString > | _allowedValues |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const JsonParam &obj) |
| Outputs JSON to output stream provided. More... | |
Represents a single configuration parameter.
This class provides for packing and unpacking the parameter from JSON payload, and provides for handling all datatypes of parameters.
Definition at line 112 of file JsonConfig.h.
| Enumerator | |
|---|---|
| UNASSIGNED | |
| BOOL | |
| INT | |
| UINT | |
| FLOAT | |
| STRING | |
| VECTOR | |
Definition at line 115 of file JsonConfig.h.
|
inline |
Definition at line 125 of file JsonConfig.h.
| ossim::JsonParam::JsonParam | ( | const ossimString & | argname, |
| const ossimString & | arglabel, | ||
| const ossimString & | argdescr, | ||
| ParamType | argparamType, | ||
| void * | value | ||
| ) |
| ossim::JsonParam::JsonParam | ( | const JsonParam & | copy | ) |
Definition at line 36 of file JsonConfig.cpp.
References _value, and setValue().
|
inline |
| bool ossim::JsonParam::asBool | ( | ) | const |
Definition at line 257 of file JsonConfig.cpp.
References _type, _value, and BOOL.
Referenced by ATP::AtpGenerator::constructChain(), ATP::ossimAtpTool::doPairwiseMatching(), ATP::AtpTileSource::filterPoints(), ATP::ossimCorrelationSource::findFeatures(), ATP::ossimCorrelationSource::getTile(), and ATP::AtpTileSource::initializeStaticMembers().
| double ossim::JsonParam::asFloat | ( | ) | const |
Definition at line 278 of file JsonConfig.cpp.
References _type, _value, FLOAT, and ossim::nan().
Referenced by ATP::AtpAnnotatedImage::annotateCorrelations(), ATP::AtpAnnotatedImage::annotateResiduals(), ATP::AtpGenerator::constructChain(), ATP::ossimCorrelationSource::findFeatures(), ATP::AtpTileSource::initializeStaticMembers(), and ATP::ossimCorrelationSource::OpenCVCorrelation().
| int ossim::JsonParam::asInt | ( | ) | const |
Definition at line 271 of file JsonConfig.cpp.
References _type, _value, INT, and UINT.
Referenced by ATP::AtpAnnotatedImage::AtpAnnotatedImage().
| std::string ossim::JsonParam::asString | ( | ) | const |
Definition at line 285 of file JsonConfig.cpp.
References _type, _value, and STRING.
Referenced by ATP::AtpGenerator::constructChain(), ATP::ossimDescriptorSource::getTile(), ATP::AtpGenerator::initialize(), and ATP::ossimAtpTool::loadJSON().
| unsigned int ossim::JsonParam::asUint | ( | ) | const |
Definition at line 264 of file JsonConfig.cpp.
References _type, _value, and UINT.
Referenced by ATP::AtpAnnotatedImage::annotateCorrelations(), ATP::AtpAnnotatedImage::annotateResiduals(), ATP::ossimCorrelationSource::correlate(), ATP::ossimCorrelationSource::findFeatures(), ATP::ossimDescriptorSource::getTile(), ATP::ossimCorrelationSource::getTile(), ATP::ossimCorrelationSource::initialize(), ATP::AtpGenerator::initialize(), ATP::AtpTileSource::initializeStaticMembers(), ATP::AtpGenerator::layoutSearchTileRects(), and ATP::ossimCorrelationSource::OpenCVCorrelation().
| void ossim::JsonParam::asVector | ( | std::vector< double > & | v | ) | const |
Definition at line 292 of file JsonConfig.cpp.
References _type, _value, and VECTOR.
|
inline |
Definition at line 144 of file JsonConfig.h.
References _descr.
Referenced by ossim::JsonConfig::loadJSON().
|
inline |
Definition at line 147 of file JsonConfig.h.
|
inline |
Definition at line 156 of file JsonConfig.h.
|
inline |
Definition at line 153 of file JsonConfig.h.
|
inline |
Definition at line 159 of file JsonConfig.h.
|
inline |
Definition at line 150 of file JsonConfig.h.
|
inline |
Definition at line 162 of file JsonConfig.h.
|
inline |
| bool ossim::JsonParam::loadJSON | ( | const Json::Value & | json_node | ) |
Initializes from a JSON node.
Return true if successful
Definition at line 111 of file JsonConfig.cpp.
References _allowedValues, _descr, _label, _name, _type, BOOL, ossimString::empty(), FLOAT, INT, n, ossimNotify(), ossimNotifyLevel_WARN, setValue(), STRING, UINT, ossimString::upcase(), and VECTOR.
Referenced by ossim::JsonConfig::loadJSON().
|
inline |
Definition at line 142 of file JsonConfig.h.
References _name.
Referenced by ossim::JsonConfig::loadJSON(), and ossim::JsonConfig::setParameter().
|
inline |
|
private |
Definition at line 81 of file JsonConfig.cpp.
References _type, _value, BOOL, FLOAT, INT, STRING, UINT, and VECTOR.
Referenced by ~JsonParam().
| void ossim::JsonParam::saveJSON | ( | Json::Value & | json_node | ) | const |
Definition at line 192 of file JsonConfig.cpp.
References _allowedValues, _descr, _label, _name, _type, _value, BOOL, FLOAT, INT, n, STRING, ossimString::string(), UINT, UNASSIGNED, and VECTOR.
Referenced by ossim::JsonConfig::loadJSON(), and ossim::operator<<().
|
private |
Definition at line 47 of file JsonConfig.cpp.
References _type, _value, BOOL, FLOAT, INT, STRING, UINT, and VECTOR.
Referenced by JsonParam(), and loadJSON().
|
inline |
|
friend |
Outputs JSON to output stream provided.
Definition at line 299 of file JsonConfig.cpp.
|
private |
Definition at line 179 of file JsonConfig.h.
Referenced by loadJSON(), and saveJSON().
|
private |
Definition at line 176 of file JsonConfig.h.
Referenced by descr(), loadJSON(), and saveJSON().
|
private |
Definition at line 175 of file JsonConfig.h.
Referenced by label(), loadJSON(), and saveJSON().
|
private |
Definition at line 174 of file JsonConfig.h.
Referenced by loadJSON(), name(), operator==(), and saveJSON().
|
private |
Definition at line 177 of file JsonConfig.h.
Referenced by asBool(), asFloat(), asInt(), asString(), asUint(), asVector(), isBool(), isFloat(), isInt(), isString(), isUint(), isVector(), loadJSON(), resetValue(), saveJSON(), setValue(), and type().
|
private |
Definition at line 178 of file JsonConfig.h.
Referenced by asBool(), asFloat(), asInt(), asString(), asUint(), asVector(), JsonParam(), resetValue(), saveJSON(), and setValue().
1.8.14