Fawkes API  Fawkes Development Version
DomainEffect Class Reference

DomainEffect representation for JSON transfer. More...

#include <DomainEffect.h>

Public Member Functions

 DomainEffect ()
 Constructor. More...
 
 DomainEffect (const std::string &json)
 Constructor from JSON. More...
 
 DomainEffect (const rapidjson::Value &v)
 Constructor from JSON. More...
 
virtual ~DomainEffect ()
 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< 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...
 

Static Public Member Functions

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

Detailed Description

DomainEffect representation for JSON transfer.

Definition at line 27 of file DomainEffect.h.

Constructor & Destructor Documentation

◆ DomainEffect() [1/3]

DomainEffect::DomainEffect ( )

Constructor.

Definition at line 24 of file DomainEffect.cpp.

◆ DomainEffect() [2/3]

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

Constructor from JSON.

Parameters
jsonJSON string to initialize from

Definition at line 28 of file DomainEffect.cpp.

References from_json().

◆ DomainEffect() [3/3]

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

Constructor from JSON.

Parameters
vRapidJSON value object to initialize from.

Definition at line 33 of file DomainEffect.cpp.

References from_json_value().

◆ ~DomainEffect()

DomainEffect::~DomainEffect ( )
virtual

Destructor.

Definition at line 38 of file DomainEffect.cpp.

Member Function Documentation

◆ addto_param_constants() [1/2]

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

Add element to param-constants array.

Parameters
param_constantsnew value

Definition at line 264 of file DomainEffect.h.

References param_constants().

◆ addto_param_constants() [2/2]

void DomainEffect::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 274 of file DomainEffect.h.

References param_constants().

◆ addto_param_names() [1/2]

void DomainEffect::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 DomainEffect.h.

References param_names().

◆ addto_param_names() [2/2]

void DomainEffect::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 DomainEffect.h.

References param_names().

◆ addto_param_values() [1/2]

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

Add element to param-values array.

Parameters
param_valuesnew value

Definition at line 229 of file DomainEffect.h.

References param_values().

◆ addto_param_values() [2/2]

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

References param_values().

◆ api_version()

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

Get version of implemented API.

Returns
string representation of version

Definition at line 48 of file DomainEffect.h.

◆ apiVersion()

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

Get apiVersion value.

Returns
apiVersion value

Definition at line 109 of file DomainEffect.h.

Referenced by set_apiVersion().

◆ from_json()

void DomainEffect::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 121 of file DomainEffect.cpp.

References from_json_value().

Referenced by DomainEffect().

◆ from_json_value()

void DomainEffect::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 130 of file DomainEffect.cpp.

Referenced by DomainEffect(), from_json(), and PlanAction::from_json_value().

◆ kind()

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

Get kind value.

Returns
kind value

Definition at line 92 of file DomainEffect.h.

Referenced by set_kind().

◆ name()

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

Get name value.

Returns
name value

Definition at line 126 of file DomainEffect.h.

Referenced by set_name().

◆ param_constants()

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

Get param-constants value.

Returns
param-constants value

Definition at line 247 of file DomainEffect.h.

Referenced by addto_param_constants(), and set_param_constants().

◆ param_names()

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

Get param-names value.

Returns
param-names value

Definition at line 177 of file DomainEffect.h.

Referenced by addto_param_names(), and set_param_names().

◆ param_values()

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

Get param-values value.

Returns
param-values value

Definition at line 212 of file DomainEffect.h.

Referenced by addto_param_values(), and set_param_values().

◆ predicate()

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

Get predicate value.

Returns
predicate value

Definition at line 160 of file DomainEffect.h.

Referenced by set_predicate().

◆ set_apiVersion()

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

Set apiVersion value.

Parameters
apiVersionnew value

Definition at line 118 of file DomainEffect.h.

References apiVersion().

◆ set_kind()

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

Set kind value.

Parameters
kindnew value

Definition at line 101 of file DomainEffect.h.

References kind().

◆ set_name()

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

Set name value.

Parameters
namenew value

Definition at line 135 of file DomainEffect.h.

References name().

◆ set_param_constants()

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

Set param-constants value.

Parameters
param_constantsnew value

Definition at line 256 of file DomainEffect.h.

References param_constants().

◆ set_param_names()

void DomainEffect::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 DomainEffect.h.

References param_names().

◆ set_param_values()

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

Set param-values value.

Parameters
param_valuesnew value

Definition at line 221 of file DomainEffect.h.

References param_values().

◆ set_predicate()

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

Set predicate value.

Parameters
predicatenew value

Definition at line 169 of file DomainEffect.h.

References predicate().

◆ set_type()

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

Set type value.

Parameters
typenew value

Definition at line 152 of file DomainEffect.h.

References type().

◆ to_json()

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

References to_json_value().

◆ to_json_value()

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

Referenced by to_json().

◆ type()

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

Get type value.

Returns
type value

Definition at line 143 of file DomainEffect.h.

Referenced by set_type().

◆ validate()

void DomainEffect::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 177 of file DomainEffect.cpp.


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