Fawkes API Fawkes Development Version
GroundedPDDLFormula Class Reference

GroundedPDDLFormula representation for JSON transfer. More...

#include <GroundedPDDLFormula.h>

Public Member Functions

 GroundedPDDLFormula ()
 Constructor. More...
 
 GroundedPDDLFormula (const std::string &json)
 Constructor from JSON. More...
 
 GroundedPDDLFormula (const rapidjson::Value &v)
 Constructor from JSON. More...
 
virtual ~GroundedPDDLFormula ()
 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 > id () const
 Get id value. More...
 
void set_id (const std::string &id)
 Set id value. More...
 
std::optional< std::string > formula_id () const
 Get formula-id value. More...
 
void set_formula_id (const std::string &formula_id)
 Set formula-id value. More...
 
std::optional< std::string > grounding () const
 Get grounding value. More...
 
void set_grounding (const std::string &grounding)
 Set grounding 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...
 

Detailed Description

GroundedPDDLFormula representation for JSON transfer.

Definition at line 27 of file GroundedPDDLFormula.h.

Constructor & Destructor Documentation

◆ GroundedPDDLFormula() [1/3]

GroundedPDDLFormula::GroundedPDDLFormula ( )

Constructor.

Definition at line 24 of file GroundedPDDLFormula.cpp.

◆ GroundedPDDLFormula() [2/3]

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

Constructor from JSON.

Parameters
jsonJSON string to initialize from

Definition at line 28 of file GroundedPDDLFormula.cpp.

References from_json().

◆ GroundedPDDLFormula() [3/3]

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

Constructor from JSON.

Parameters
vRapidJSON value object to initialize from.

Definition at line 33 of file GroundedPDDLFormula.cpp.

References from_json_value().

◆ ~GroundedPDDLFormula()

GroundedPDDLFormula::~GroundedPDDLFormula ( )
virtual

Destructor.

Definition at line 38 of file GroundedPDDLFormula.cpp.

Member Function Documentation

◆ api_version()

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

Get version of implemented API.

Returns
string representation of version

Definition at line 48 of file GroundedPDDLFormula.h.

◆ apiVersion()

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

Get apiVersion value.

Returns
apiVersion value

Definition at line 109 of file GroundedPDDLFormula.h.

Referenced by set_apiVersion().

◆ formula_id()

std::optional< std::string > GroundedPDDLFormula::formula_id ( ) const
inline

Get formula-id value.

Returns
formula-id value

Definition at line 143 of file GroundedPDDLFormula.h.

Referenced by set_formula_id().

◆ from_json()

void GroundedPDDLFormula::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 102 of file GroundedPDDLFormula.cpp.

References from_json_value().

Referenced by GroundedPDDLFormula().

◆ from_json_value()

void GroundedPDDLFormula::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 111 of file GroundedPDDLFormula.cpp.

Referenced by from_json(), and GroundedPDDLFormula().

◆ grounding()

std::optional< std::string > GroundedPDDLFormula::grounding ( ) const
inline

Get grounding value.

Returns
grounding value

Definition at line 160 of file GroundedPDDLFormula.h.

Referenced by set_grounding().

◆ id()

std::optional< std::string > GroundedPDDLFormula::id ( ) const
inline

Get id value.

Returns
id value

Definition at line 126 of file GroundedPDDLFormula.h.

Referenced by set_id().

◆ is_satisfied()

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

Get is-satisfied value.

Returns
is-satisfied value

Definition at line 177 of file GroundedPDDLFormula.h.

Referenced by set_is_satisfied().

◆ kind()

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

Get kind value.

Returns
kind value

Definition at line 92 of file GroundedPDDLFormula.h.

Referenced by set_kind().

◆ set_apiVersion()

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

Set apiVersion value.

Parameters
apiVersionnew value

Definition at line 118 of file GroundedPDDLFormula.h.

References apiVersion().

◆ set_formula_id()

void GroundedPDDLFormula::set_formula_id ( const std::string &  formula_id)
inline

Set formula-id value.

Parameters
formula_idnew value

Definition at line 152 of file GroundedPDDLFormula.h.

References formula_id().

◆ set_grounding()

void GroundedPDDLFormula::set_grounding ( const std::string &  grounding)
inline

Set grounding value.

Parameters
groundingnew value

Definition at line 169 of file GroundedPDDLFormula.h.

References grounding().

◆ set_id()

void GroundedPDDLFormula::set_id ( const std::string &  id)
inline

Set id value.

Parameters
idnew value

Definition at line 135 of file GroundedPDDLFormula.h.

References id().

◆ set_is_satisfied()

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

Set is-satisfied value.

Parameters
is_satisfiednew value

Definition at line 186 of file GroundedPDDLFormula.h.

References is_satisfied().

◆ set_kind()

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

Set kind value.

Parameters
kindnew value

Definition at line 101 of file GroundedPDDLFormula.h.

References kind().

◆ to_json()

std::string GroundedPDDLFormula::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 GroundedPDDLFormula.cpp.

References to_json_value().

◆ to_json_value()

void GroundedPDDLFormula::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 GroundedPDDLFormula.cpp.

Referenced by to_json().

◆ validate()

void GroundedPDDLFormula::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 134 of file GroundedPDDLFormula.cpp.


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