Fawkes API  Fawkes Development Version
GroundedFormula Class Reference

GroundedFormula representation for JSON transfer. More...

#include <GroundedFormula.h>

Public Member Functions

 GroundedFormula ()
 Constructor. More...
 
 GroundedFormula (const std::string &json)
 Constructor from JSON. More...
 
 GroundedFormula (const rapidjson::Value &v)
 Constructor from JSON. More...
 
virtual ~GroundedFormula ()
 Destructor. More...
 
virtual std::string to_json (bool pretty=false) const
 Render object to JSON. More...
 
virtual void to_json_value (rapidjson::Document &d, rapidjson::Value &v) const
 Render object to JSON. More...
 
virtual void from_json (const std::string &json)
 Retrieve data from JSON string. More...
 
virtual void from_json_value (const rapidjson::Value &v)
 Retrieve data from JSON string. More...
 
virtual void validate (bool subcall=false) const
 Validate if all required fields have been set. More...
 
std::optional< std::string > kind () const
 Get kind value. More...
 
void set_kind (const std::string &kind)
 Set kind value. More...
 
std::optional< std::string > apiVersion () const
 Get apiVersion value. More...
 
void set_apiVersion (const std::string &apiVersion)
 Set apiVersion value. More...
 
std::optional< std::string > name () const
 Get name value. More...
 
void set_name (const std::string &name)
 Set name value. More...
 
std::optional< std::string > type () const
 Get type value. More...
 
void set_type (const std::string &type)
 Set type value. More...
 
std::optional< bool > is_satisfied () const
 Get is-satisfied value. More...
 
void set_is_satisfied (const bool &is_satisfied)
 Set is-satisfied value. More...
 
std::vector< std::string > param_names () const
 Get param-names value. More...
 
void set_param_names (const std::vector< std::string > &param_names)
 Set param-names value. More...
 
void addto_param_names (const std::string &&param_names)
 Add element to param-names array. More...
 
void addto_param_names (const std::string &param_names)
 Add element to param-names array. More...
 
std::vector< std::string > param_values () const
 Get param-values value. More...
 
void set_param_values (const std::vector< std::string > &param_values)
 Set param-values value. More...
 
void addto_param_values (const std::string &&param_values)
 Add element to param-values array. More...
 
void addto_param_values (const std::string &param_values)
 Add element to param-values array. More...
 
std::vector< std::string > param_constants () const
 Get param-constants value. More...
 
void set_param_constants (const std::vector< std::string > &param_constants)
 Set param-constants value. More...
 
void addto_param_constants (const std::string &&param_constants)
 Add element to param-constants array. More...
 
void addto_param_constants (const std::string &param_constants)
 Add element to param-constants array. More...
 
std::vector< std::shared_ptr< GroundedFormula > > child () const
 Get child value. More...
 
void set_child (const std::vector< std::shared_ptr< GroundedFormula >> &child)
 Set child value. More...
 
void addto_child (const std::shared_ptr< GroundedFormula > &&child)
 Add element to child array. More...
 
void addto_child (const std::shared_ptr< GroundedFormula > &child)
 Add element to child array. More...
 
void addto_child (const GroundedFormula &&child)
 Add element to child array. More...
 

Static Public Member Functions

static std::string api_version ()
 Get version of implemented API. More...
 

Detailed Description

GroundedFormula representation for JSON transfer.

Definition at line 28 of file GroundedFormula.h.

Constructor & Destructor Documentation

◆ GroundedFormula() [1/3]

GroundedFormula::GroundedFormula ( )

Constructor.

Definition at line 24 of file GroundedFormula.cpp.

Referenced by from_json_value().

◆ GroundedFormula() [2/3]

GroundedFormula::GroundedFormula ( const std::string &  json)

Constructor from JSON.

Parameters
jsonJSON string to initialize from

Definition at line 28 of file GroundedFormula.cpp.

References from_json().

◆ GroundedFormula() [3/3]

GroundedFormula::GroundedFormula ( const rapidjson::Value &  v)

Constructor from JSON.

Parameters
vRapidJSON value object to initialize from.

Definition at line 33 of file GroundedFormula.cpp.

References from_json_value().

◆ ~GroundedFormula()

GroundedFormula::~GroundedFormula ( )
virtual

Destructor.

Definition at line 38 of file GroundedFormula.cpp.

Member Function Documentation

◆ addto_child() [1/3]

void GroundedFormula::addto_child ( const GroundedFormula &&  child)
inline

Add element to child array.

Parameters
childnew value

Definition at line 318 of file GroundedFormula.h.

References child().

◆ addto_child() [2/3]

void GroundedFormula::addto_child ( const std::shared_ptr< GroundedFormula > &&  child)
inline

Add element to child array.

Parameters
childnew value

Definition at line 300 of file GroundedFormula.h.

References child().

◆ addto_child() [3/3]

void GroundedFormula::addto_child ( const std::shared_ptr< GroundedFormula > &  child)
inline

Add element to child array.

The move-semantics version (std::move) should be preferred.

Parameters
childnew value

Definition at line 310 of file GroundedFormula.h.

References child().

◆ addto_param_constants() [1/2]

void GroundedFormula::addto_param_constants ( const std::string &&  param_constants)
inline

Add element to param-constants array.

Parameters
param_constantsnew value

Definition at line 265 of file GroundedFormula.h.

References param_constants().

◆ addto_param_constants() [2/2]

void GroundedFormula::addto_param_constants ( const std::string &  param_constants)
inline

Add element to param-constants array.

The move-semantics version (std::move) should be preferred.

Parameters
param_constantsnew value

Definition at line 275 of file GroundedFormula.h.

References param_constants().

◆ addto_param_names() [1/2]

void GroundedFormula::addto_param_names ( const std::string &&  param_names)
inline

Add element to param-names array.

Parameters
param_namesnew value

Definition at line 195 of file GroundedFormula.h.

References param_names().

◆ addto_param_names() [2/2]

void GroundedFormula::addto_param_names ( const std::string &  param_names)
inline

Add element to param-names array.

The move-semantics version (std::move) should be preferred.

Parameters
param_namesnew value

Definition at line 205 of file GroundedFormula.h.

References param_names().

◆ addto_param_values() [1/2]

void GroundedFormula::addto_param_values ( const std::string &&  param_values)
inline

Add element to param-values array.

Parameters
param_valuesnew value

Definition at line 230 of file GroundedFormula.h.

References param_values().

◆ addto_param_values() [2/2]

void GroundedFormula::addto_param_values ( const std::string &  param_values)
inline

Add element to param-values array.

The move-semantics version (std::move) should be preferred.

Parameters
param_valuesnew value

Definition at line 240 of file GroundedFormula.h.

References param_values().

◆ api_version()

static std::string GroundedFormula::api_version ( )
inlinestatic

Get version of implemented API.

Returns
string representation of version

Definition at line 49 of file GroundedFormula.h.

◆ apiVersion()

std::optional<std::string> GroundedFormula::apiVersion ( ) const
inline

Get apiVersion value.

Returns
apiVersion value

Definition at line 110 of file GroundedFormula.h.

Referenced by set_apiVersion().

◆ child()

std::vector<std::shared_ptr<GroundedFormula> > GroundedFormula::child ( ) const
inline

Get child value.

Returns
child value

Definition at line 283 of file GroundedFormula.h.

Referenced by addto_child(), and set_child().

◆ from_json()

void GroundedFormula::from_json ( const std::string &  json)
virtual

Retrieve data from JSON string.

Parameters
jsonJSON representation suitable for this object. Will allow partial assignment and not validate automaticaly.
See also
validate()

Definition at line 129 of file GroundedFormula.cpp.

References from_json_value().

Referenced by GroundedFormula().

◆ from_json_value()

void GroundedFormula::from_json_value ( const rapidjson::Value &  v)
virtual

Retrieve data from JSON string.

Parameters
vRapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly.
See also
validate()

Definition at line 138 of file GroundedFormula.cpp.

References GroundedFormula().

Referenced by from_json(), and GroundedFormula().

◆ is_satisfied()

std::optional<bool> GroundedFormula::is_satisfied ( ) const
inline

Get is-satisfied value.

Returns
is-satisfied value

Definition at line 161 of file GroundedFormula.h.

Referenced by set_is_satisfied().

◆ kind()

std::optional<std::string> GroundedFormula::kind ( ) const
inline

Get kind value.

Returns
kind value

Definition at line 93 of file GroundedFormula.h.

Referenced by set_kind().

◆ name()

std::optional<std::string> GroundedFormula::name ( ) const
inline

Get name value.

Returns
name value

Definition at line 127 of file GroundedFormula.h.

Referenced by set_name().

◆ param_constants()

std::vector<std::string> GroundedFormula::param_constants ( ) const
inline

Get param-constants value.

Returns
param-constants value

Definition at line 248 of file GroundedFormula.h.

Referenced by addto_param_constants(), and set_param_constants().

◆ param_names()

std::vector<std::string> GroundedFormula::param_names ( ) const
inline

Get param-names value.

Returns
param-names value

Definition at line 178 of file GroundedFormula.h.

Referenced by addto_param_names(), and set_param_names().

◆ param_values()

std::vector<std::string> GroundedFormula::param_values ( ) const
inline

Get param-values value.

Returns
param-values value

Definition at line 213 of file GroundedFormula.h.

Referenced by addto_param_values(), and set_param_values().

◆ set_apiVersion()

void GroundedFormula::set_apiVersion ( const std::string &  apiVersion)
inline

Set apiVersion value.

Parameters
apiVersionnew value

Definition at line 119 of file GroundedFormula.h.

References apiVersion().

◆ set_child()

void GroundedFormula::set_child ( const std::vector< std::shared_ptr< GroundedFormula >> &  child)
inline

Set child value.

Parameters
childnew value

Definition at line 292 of file GroundedFormula.h.

References child().

◆ set_is_satisfied()

void GroundedFormula::set_is_satisfied ( const bool &  is_satisfied)
inline

Set is-satisfied value.

Parameters
is_satisfiednew value

Definition at line 170 of file GroundedFormula.h.

References is_satisfied().

◆ set_kind()

void GroundedFormula::set_kind ( const std::string &  kind)
inline

Set kind value.

Parameters
kindnew value

Definition at line 102 of file GroundedFormula.h.

References kind().

◆ set_name()

void GroundedFormula::set_name ( const std::string &  name)
inline

Set name value.

Parameters
namenew value

Definition at line 136 of file GroundedFormula.h.

References name().

◆ set_param_constants()

void GroundedFormula::set_param_constants ( const std::vector< std::string > &  param_constants)
inline

Set param-constants value.

Parameters
param_constantsnew value

Definition at line 257 of file GroundedFormula.h.

References param_constants().

◆ set_param_names()

void GroundedFormula::set_param_names ( const std::vector< std::string > &  param_names)
inline

Set param-names value.

Parameters
param_namesnew value

Definition at line 187 of file GroundedFormula.h.

References param_names().

◆ set_param_values()

void GroundedFormula::set_param_values ( const std::vector< std::string > &  param_values)
inline

Set param-values value.

Parameters
param_valuesnew value

Definition at line 222 of file GroundedFormula.h.

References param_values().

◆ set_type()

void GroundedFormula::set_type ( const std::string &  type)
inline

Set type value.

Parameters
typenew value

Definition at line 153 of file GroundedFormula.h.

References type().

◆ to_json()

std::string GroundedFormula::to_json ( bool  pretty = false) const
virtual

Render object to JSON.

Parameters
prettytrue to enable pretty printing (readable spacing)
Returns
JSON string

Definition at line 43 of file GroundedFormula.cpp.

References to_json_value().

◆ to_json_value()

void GroundedFormula::to_json_value ( rapidjson::Document &  d,
rapidjson::Value &  v 
) const
virtual

Render object to JSON.

Parameters
dRapidJSON document to retrieve allocator from
vRapidJSON value to add data to

Definition at line 62 of file GroundedFormula.cpp.

Referenced by to_json().

◆ type()

std::optional<std::string> GroundedFormula::type ( ) const
inline

Get type value.

Returns
type value

Definition at line 144 of file GroundedFormula.h.

Referenced by set_type().

◆ validate()

void GroundedFormula::validate ( bool  subcall = false) const
virtual

Validate if all required fields have been set.

Parameters
subcalltrue if this is called from another class, e.g., a sub-class or array holder. Will modify the kind of exception thrown.
Exceptions
std::vector<std::string>thrown if required information is missing and subcall is set to true. Contains a list of missing fields.
std::runtime_errorinformative message describing the missing fields

Definition at line 196 of file GroundedFormula.cpp.


The documentation for this class was generated from the following files: