Fawkes API  Fawkes Development Version
DomainPreconditionAtom Class Reference

DomainPreconditionAtom representation for JSON transfer. More...

#include <DomainPreconditionAtom.h>

Inheritance diagram for DomainPreconditionAtom:

Public Member Functions

 DomainPreconditionAtom ()
 Constructor. More...
 
 DomainPreconditionAtom (const std::string &json)
 Constructor from JSON. More...
 
 DomainPreconditionAtom (const rapidjson::Value &v)
 Constructor from JSON. More...
 
virtual ~DomainPreconditionAtom ()
 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 > predicate () const
 Get predicate value. More...
 
void set_predicate (const std::string &predicate)
 Set predicate 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...
 
- Public Member Functions inherited from DomainPrecondition
 DomainPrecondition ()
 Constructor. More...
 
 DomainPrecondition (const std::string &json)
 Constructor from JSON. More...
 
 DomainPrecondition (const rapidjson::Value &v)
 Constructor from JSON. More...
 
virtual ~DomainPrecondition ()
 Destructor. 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 > grounded () const
 Get grounded value. More...
 
void set_grounded (const bool &grounded)
 Set grounded 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...
 

Static Public Member Functions

static std::string api_version ()
 Get version of implemented API. More...
 
- Static Public Member Functions inherited from DomainPrecondition
static std::string api_version ()
 Get version of implemented API. More...
 

Detailed Description

DomainPreconditionAtom representation for JSON transfer.

Definition at line 27 of file DomainPreconditionAtom.h.

Constructor & Destructor Documentation

◆ DomainPreconditionAtom() [1/3]

DomainPreconditionAtom::DomainPreconditionAtom ( )

Constructor.

Definition at line 22 of file DomainPreconditionAtom.cpp.

◆ DomainPreconditionAtom() [2/3]

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

Constructor from JSON.

Parameters
jsonJSON string to initialize from

Definition at line 26 of file DomainPreconditionAtom.cpp.

References from_json().

◆ DomainPreconditionAtom() [3/3]

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

Constructor from JSON.

Parameters
vRapidJSON value object to initialize from.

Definition at line 31 of file DomainPreconditionAtom.cpp.

References from_json_value().

◆ ~DomainPreconditionAtom()

DomainPreconditionAtom::~DomainPreconditionAtom ( )
virtual

Destructor.

Definition at line 36 of file DomainPreconditionAtom.cpp.

Member Function Documentation

◆ addto_param_constants() [1/2]

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

Add element to param-constants array.

Parameters
param_constantsnew value

Definition at line 198 of file DomainPreconditionAtom.h.

References param_constants().

◆ addto_param_constants() [2/2]

void DomainPreconditionAtom::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 208 of file DomainPreconditionAtom.h.

References param_constants().

◆ addto_param_names() [1/2]

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

Add element to param-names array.

Parameters
param_namesnew value

Definition at line 128 of file DomainPreconditionAtom.h.

References param_names().

◆ addto_param_names() [2/2]

void DomainPreconditionAtom::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 138 of file DomainPreconditionAtom.h.

References param_names().

◆ addto_param_values() [1/2]

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

Add element to param-values array.

Parameters
param_valuesnew value

Definition at line 163 of file DomainPreconditionAtom.h.

References param_values().

◆ addto_param_values() [2/2]

void DomainPreconditionAtom::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 173 of file DomainPreconditionAtom.h.

References param_values().

◆ api_version()

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

Get version of implemented API.

Returns
string representation of version

Definition at line 49 of file DomainPreconditionAtom.h.

◆ from_json()

void DomainPreconditionAtom::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()

Reimplemented from DomainPrecondition.

Definition at line 100 of file DomainPreconditionAtom.cpp.

References from_json_value().

Referenced by DomainPreconditionAtom().

◆ from_json_value()

void DomainPreconditionAtom::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()

Reimplemented from DomainPrecondition.

Definition at line 109 of file DomainPreconditionAtom.cpp.

References DomainPrecondition::from_json_value().

Referenced by DomainPreconditionAtom(), and from_json().

◆ param_constants()

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

Get param-constants value.

Returns
param-constants value

Definition at line 181 of file DomainPreconditionAtom.h.

Referenced by addto_param_constants(), and set_param_constants().

◆ param_names()

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

Get param-names value.

Returns
param-names value

Definition at line 111 of file DomainPreconditionAtom.h.

Referenced by addto_param_names(), and set_param_names().

◆ param_values()

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

Get param-values value.

Returns
param-values value

Definition at line 146 of file DomainPreconditionAtom.h.

Referenced by addto_param_values(), and set_param_values().

◆ predicate()

std::optional<std::string> DomainPreconditionAtom::predicate ( ) const
inline

Get predicate value.

Returns
predicate value

Definition at line 94 of file DomainPreconditionAtom.h.

Referenced by set_predicate().

◆ set_param_constants()

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

Set param-constants value.

Parameters
param_constantsnew value

Definition at line 190 of file DomainPreconditionAtom.h.

References param_constants().

◆ set_param_names()

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

Set param-names value.

Parameters
param_namesnew value

Definition at line 120 of file DomainPreconditionAtom.h.

References param_names().

◆ set_param_values()

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

Set param-values value.

Parameters
param_valuesnew value

Definition at line 155 of file DomainPreconditionAtom.h.

References param_values().

◆ set_predicate()

void DomainPreconditionAtom::set_predicate ( const std::string &  predicate)
inline

Set predicate value.

Parameters
predicatenew value

Definition at line 103 of file DomainPreconditionAtom.h.

References predicate().

◆ to_json()

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

Render object to JSON.

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

Reimplemented from DomainPrecondition.

Definition at line 41 of file DomainPreconditionAtom.cpp.

References to_json_value().

◆ to_json_value()

void DomainPreconditionAtom::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

Reimplemented from DomainPrecondition.

Definition at line 60 of file DomainPreconditionAtom.cpp.

References DomainPrecondition::to_json_value().

Referenced by to_json().

◆ validate()

void DomainPreconditionAtom::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

Reimplemented from DomainPrecondition.

Definition at line 145 of file DomainPreconditionAtom.cpp.

References DomainPrecondition::validate().


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