Fawkes API Fawkes Development Version
DomainPredicate Class Reference

DomainPredicate representation for JSON transfer. More...

#include <DomainPredicate.h>

Public Member Functions

 DomainPredicate ()
 Constructor. More...
 
 DomainPredicate (const std::string &json)
 Constructor from JSON. More...
 
 DomainPredicate (const rapidjson::Value &v)
 Constructor from JSON. More...
 
virtual ~DomainPredicate ()
 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< bool > sensed () const
 Get sensed value. More...
 
void set_sensed (const bool &sensed)
 Set sensed 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_types () const
 Get param-types value. More...
 
void set_param_types (const std::vector< std::string > &param_types)
 Set param-types value. More...
 
void addto_param_types (const std::string &&param_types)
 Add element to param-types array. More...
 
void addto_param_types (const std::string &param_types)
 Add element to param-types array. More...
 

Static Public Member Functions

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

Detailed Description

DomainPredicate representation for JSON transfer.

Definition at line 27 of file DomainPredicate.h.

Constructor & Destructor Documentation

◆ DomainPredicate() [1/3]

DomainPredicate::DomainPredicate ( )

Constructor.

Definition at line 24 of file DomainPredicate.cpp.

◆ DomainPredicate() [2/3]

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

Constructor from JSON.

Parameters
jsonJSON string to initialize from

Definition at line 28 of file DomainPredicate.cpp.

References from_json().

◆ DomainPredicate() [3/3]

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

Constructor from JSON.

Parameters
vRapidJSON value object to initialize from.

Definition at line 33 of file DomainPredicate.cpp.

References from_json_value().

◆ ~DomainPredicate()

DomainPredicate::~DomainPredicate ( )
virtual

Destructor.

Definition at line 38 of file DomainPredicate.cpp.

Member Function Documentation

◆ addto_param_names() [1/2]

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

Add element to param-names array.

Parameters
param_namesnew value

Definition at line 177 of file DomainPredicate.h.

References param_names().

◆ addto_param_names() [2/2]

void DomainPredicate::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 187 of file DomainPredicate.h.

References param_names().

◆ addto_param_types() [1/2]

void DomainPredicate::addto_param_types ( const std::string &&  param_types)
inline

Add element to param-types array.

Parameters
param_typesnew value

Definition at line 212 of file DomainPredicate.h.

References param_types().

◆ addto_param_types() [2/2]

void DomainPredicate::addto_param_types ( const std::string &  param_types)
inline

Add element to param-types array.

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

Parameters
param_typesnew value

Definition at line 222 of file DomainPredicate.h.

References param_types().

◆ api_version()

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

Get version of implemented API.

Returns
string representation of version

Definition at line 48 of file DomainPredicate.h.

◆ apiVersion()

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

Get apiVersion value.

Returns
apiVersion value

Definition at line 109 of file DomainPredicate.h.

Referenced by set_apiVersion().

◆ from_json()

void DomainPredicate::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 108 of file DomainPredicate.cpp.

References from_json_value().

Referenced by DomainPredicate().

◆ from_json_value()

void DomainPredicate::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 117 of file DomainPredicate.cpp.

Referenced by DomainPredicate(), and from_json().

◆ kind()

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

Get kind value.

Returns
kind value

Definition at line 92 of file DomainPredicate.h.

Referenced by set_kind().

◆ name()

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

Get name value.

Returns
name value

Definition at line 126 of file DomainPredicate.h.

Referenced by set_name().

◆ param_names()

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

Get param-names value.

Returns
param-names value

Definition at line 160 of file DomainPredicate.h.

Referenced by addto_param_names(), and set_param_names().

◆ param_types()

std::vector< std::string > DomainPredicate::param_types ( ) const
inline

Get param-types value.

Returns
param-types value

Definition at line 195 of file DomainPredicate.h.

Referenced by addto_param_types(), and set_param_types().

◆ sensed()

std::optional< bool > DomainPredicate::sensed ( ) const
inline

Get sensed value.

Returns
sensed value

Definition at line 143 of file DomainPredicate.h.

Referenced by set_sensed().

◆ set_apiVersion()

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

Set apiVersion value.

Parameters
apiVersionnew value

Definition at line 118 of file DomainPredicate.h.

References apiVersion().

◆ set_kind()

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

Set kind value.

Parameters
kindnew value

Definition at line 101 of file DomainPredicate.h.

References kind().

◆ set_name()

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

Set name value.

Parameters
namenew value

Definition at line 135 of file DomainPredicate.h.

References name().

◆ set_param_names()

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

Set param-names value.

Parameters
param_namesnew value

Definition at line 169 of file DomainPredicate.h.

References param_names().

◆ set_param_types()

void DomainPredicate::set_param_types ( const std::vector< std::string > &  param_types)
inline

Set param-types value.

Parameters
param_typesnew value

Definition at line 204 of file DomainPredicate.h.

References param_types().

◆ set_sensed()

void DomainPredicate::set_sensed ( const bool &  sensed)
inline

Set sensed value.

Parameters
sensednew value

Definition at line 152 of file DomainPredicate.h.

References sensed().

◆ to_json()

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

References to_json_value().

◆ to_json_value()

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

Referenced by to_json().

◆ validate()

void DomainPredicate::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 152 of file DomainPredicate.cpp.


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