Fawkes API Fawkes Development Version
PDDLPredicate Class Reference

PDDLPredicate representation for JSON transfer. More...

#include <PDDLPredicate.h>

Public Member Functions

 PDDLPredicate ()
 Constructor. More...
 
 PDDLPredicate (const std::string &json)
 Constructor from JSON. More...
 
 PDDLPredicate (const rapidjson::Value &v)
 Constructor from JSON. More...
 
virtual ~PDDLPredicate ()
 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 > part_of () const
 Get part-of value. More...
 
void set_part_of (const std::string &part_of)
 Set part-of value. 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_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...
 

Static Public Member Functions

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

Detailed Description

PDDLPredicate representation for JSON transfer.

Definition at line 27 of file PDDLPredicate.h.

Constructor & Destructor Documentation

◆ PDDLPredicate() [1/3]

PDDLPredicate::PDDLPredicate ( )

Constructor.

Definition at line 24 of file PDDLPredicate.cpp.

◆ PDDLPredicate() [2/3]

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

Constructor from JSON.

Parameters
jsonJSON string to initialize from

Definition at line 28 of file PDDLPredicate.cpp.

References from_json().

◆ PDDLPredicate() [3/3]

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

Constructor from JSON.

Parameters
vRapidJSON value object to initialize from.

Definition at line 33 of file PDDLPredicate.cpp.

References from_json_value().

◆ ~PDDLPredicate()

PDDLPredicate::~PDDLPredicate ( )
virtual

Destructor.

Definition at line 38 of file PDDLPredicate.cpp.

Member Function Documentation

◆ addto_param_constants() [1/2]

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

Add element to param-constants array.

Parameters
param_constantsnew value

Definition at line 229 of file PDDLPredicate.h.

References param_constants().

◆ addto_param_constants() [2/2]

void PDDLPredicate::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 239 of file PDDLPredicate.h.

References param_constants().

◆ addto_param_names() [1/2]

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

Add element to param-names array.

Parameters
param_namesnew value

Definition at line 194 of file PDDLPredicate.h.

References param_names().

◆ addto_param_names() [2/2]

void PDDLPredicate::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 204 of file PDDLPredicate.h.

References param_names().

◆ api_version()

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

Get version of implemented API.

Returns
string representation of version

Definition at line 48 of file PDDLPredicate.h.

◆ apiVersion()

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

Get apiVersion value.

Returns
apiVersion value

Definition at line 109 of file PDDLPredicate.h.

Referenced by set_apiVersion().

◆ from_json()

void PDDLPredicate::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 113 of file PDDLPredicate.cpp.

References from_json_value().

Referenced by PDDLPredicate().

◆ from_json_value()

void PDDLPredicate::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 122 of file PDDLPredicate.cpp.

Referenced by from_json(), and PDDLPredicate().

◆ id()

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

Get id value.

Returns
id value

Definition at line 126 of file PDDLPredicate.h.

Referenced by set_id().

◆ kind()

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

Get kind value.

Returns
kind value

Definition at line 92 of file PDDLPredicate.h.

Referenced by set_kind().

◆ param_constants()

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

Get param-constants value.

Returns
param-constants value

Definition at line 212 of file PDDLPredicate.h.

Referenced by addto_param_constants(), and set_param_constants().

◆ param_names()

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

Get param-names value.

Returns
param-names value

Definition at line 177 of file PDDLPredicate.h.

Referenced by addto_param_names(), and set_param_names().

◆ part_of()

std::optional< std::string > PDDLPredicate::part_of ( ) const
inline

Get part-of value.

Returns
part-of value

Definition at line 143 of file PDDLPredicate.h.

Referenced by set_part_of().

◆ predicate()

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

Get predicate value.

Returns
predicate value

Definition at line 160 of file PDDLPredicate.h.

Referenced by set_predicate().

◆ set_apiVersion()

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

Set apiVersion value.

Parameters
apiVersionnew value

Definition at line 118 of file PDDLPredicate.h.

References apiVersion().

◆ set_id()

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

Set id value.

Parameters
idnew value

Definition at line 135 of file PDDLPredicate.h.

References id().

◆ set_kind()

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

Set kind value.

Parameters
kindnew value

Definition at line 101 of file PDDLPredicate.h.

References kind().

◆ set_param_constants()

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

Set param-constants value.

Parameters
param_constantsnew value

Definition at line 221 of file PDDLPredicate.h.

References param_constants().

◆ set_param_names()

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

Set param-names value.

Parameters
param_namesnew value

Definition at line 186 of file PDDLPredicate.h.

References param_names().

◆ set_part_of()

void PDDLPredicate::set_part_of ( const std::string &  part_of)
inline

Set part-of value.

Parameters
part_ofnew value

Definition at line 152 of file PDDLPredicate.h.

References part_of().

◆ set_predicate()

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

Set predicate value.

Parameters
predicatenew value

Definition at line 169 of file PDDLPredicate.h.

References predicate().

◆ to_json()

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

References to_json_value().

◆ to_json_value()

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

Referenced by to_json().

◆ validate()

void PDDLPredicate::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 160 of file PDDLPredicate.cpp.


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