Class EnvironmentDescription

Nested Relationships

Nested Types

Class Documentation

class EnvironmentDescription

Description class for environment properties.

Allows environment properties to be prepared and attached to a ModelDescription. Properties can be any arithmetic or enum type. Properties marked as const within the EnvironmentDescription cannot be changed during the simulation

Public Functions

EnvironmentDescription()

Default destruction

bool operator==(const EnvironmentDescription &rhs) const
bool operator!=(const EnvironmentDescription &rhs) const
template<typename T>
void newProperty(const std::string &name, const T &value, const bool &isConst = false)

Adds a new environment property

Constructors

Parameters
  • name – name used for accessing the property

  • value – stored value of the property

  • isConst – If set to true, it is not possible to change the value during the simulation

Template Parameters

T – Type of the environmental property to be created

Throws

DuplicateEnvProperty – If a property of the same name already exists

template<typename T, EnvironmentManager::size_type N>
void newProperty(const std::string &name, const std::array<T, N> &value, const bool &isConst = false)

Adds a new environment property array

Parameters
  • name – Name used for accessing the property

  • value – Stored value of the property

  • isConst – If set to true, it is not possible to change the value during the simulation

Template Parameters
  • T – Type of the environmental property array to be created

  • N – Length of the environmental property array to be created

Throws

DuplicateEnvProperty – If a property of the same name already exists

template<typename T>
T getProperty(const std::string &name) const

Gets an environment property

Getters

Parameters

name – name used for accessing the property

Template Parameters

T – Type of the value to be returned

Throws

InvalidEnvProperty – If a property of the name does not exist

template<typename T, EnvironmentManager::size_type N>
std::array<T, N> getProperty(const std::string &name) const

Gets an environment property array

Parameters

name – name used for accessing the property

Template Parameters
  • T – Type of the value to be returned

  • N – Length of the array to be returned

Throws

InvalidEnvProperty – If a property array of the name does not exist

template<typename T>
T getProperty(const std::string &name, const EnvironmentManager::size_type &index) const

Gets an element of an environment property array

Parameters
  • name – name used for accessing the property

  • index – element from the environment property array to return

Template Parameters

T – Type of the value to be returned

Throws
bool getConst(const std::string &name)

Returns whether an environment property is marked as const

Parameters

name – name used for accessing the property

Throws

InvalidEnvProperty – If a property of the name does not exist

template<typename T>
T setProperty(const std::string &name, const T &value)

Sets an environment property

Setters

Parameters
  • name – name used for accessing the property

  • value – value to set the property

Template Parameters

T – Type of the value to be returned

Throws

InvalidEnvProperty – If a property of the name does not exist

Returns

Returns the previous value

template<typename T, EnvironmentManager::size_type N>
std::array<T, N> setProperty(const std::string &name, const std::array<T, N> &value)

Sets an environment property array

Parameters
  • name – name used for accessing the property

  • value – value to set the property

Template Parameters
  • T – Type of the value to be returned

  • N – Length of the array to be returned

Throws

InvalidEnvProperty – If a property of the name does not exist

Returns

Returns the previous value

template<typename T>
T setProperty(const std::string &name, const EnvironmentManager::size_type &index, const T &value)

Sets an element of an environment property array

See

set(const std::string &, const T &value)

Parameters
  • name – name used for accessing the property

  • index – element from the environment property array to set

  • value – value to set the property

Template Parameters

T – Type of the value to be returned

Throws
Returns

Returns the previous value of the environment property array element which has been set

const std::unordered_map<std::string, PropData> getPropertiesMap() const
struct PropData

Holds all of the properties required to add a value to EnvironmentManager

Public Functions

inline PropData(const bool &_is_const, const Any &_data)
Parameters
  • _is_const – Is the property constant

  • _data – The data to initially fill the property with

inline bool operator==(const PropData &rhs) const

Public Members

bool isConst
const Any data