Class MsgBruteForce::Description

Nested Relationships

This class is a nested type of Class MsgBruteForce.

Inheritance Relationships

Derived Types

Class Documentation

class MsgBruteForce::Description

Within the model hierarchy, this class represents the definition of an message for a FLAMEGPU model This class is used to configure external elements of messages, such as variables Base-class, represents brute-force messages Can be extended by more advanced message descriptors

See

MessageData The internal data store for this class

See

ModelDescription::newMessage(const std::string&) For creating instances of this class

Subclassed by MsgArray2D::Description, MsgArray3D::Description, MsgArray::Description, MsgBucket::Description, MsgSpatial2D::Description, MsgSpatial3D::Description

Public Functions

bool operator==(const Description &rhs) const

Equality operator, checks whether MessageDescription hierarchies are functionally the same

Note

Instead compare pointers if you wish to check that they are the same instance

Returns

True when messages are the same

bool operator!=(const Description &rhs) const

Equality operator, checks whether MessageDescription hierarchies are functionally different

Note

Instead compare pointers if you wish to check that they are not the same instance

Returns

True when messages are not the same

template<typename T>
void newVariable(const std::string &variable_name)

Adds a new variable to the message

Template implementation

Parameters

variable_name – Name of the variable

Template Parameters

T – Type of the message variable, this must be an arithmetic type

Throws

InvalidMessageVar – If a variable already exists within the message with the same name

std::string getName() const

Const Accessors

Returns

The message’s name

const std::type_index &getVariableType(const std::string &variable_name) const
Parameters

variable_name – Name used to refer to the desired variable

Throws

InvalidAgentVar – If a variable with the name does not exist within the message

Returns

The type of the named variable

size_t getVariableSize(const std::string &variable_name) const
Parameters

variable_name – Name used to refer to the desired variable

Throws

InvalidAgentVar – If a variable with the name does not exist within the message

Returns

The size of the named variable’s type

size_type getVariablesCount() const
Returns

The total number of variables within the message

bool hasVariable(const std::string &variable_name) const
Parameters

variable_name – Name of the variable to check

Returns

True when a variable with the specified name exists within the message

Protected Functions

Description(const std::shared_ptr<const ModelData> &_model, Data *const data)

Constructors

Description(const Description &other_message) = delete

Default copy constructor, not implemented

Description(Description &&other_message) noexcept = delete

Default move constructor, not implemented

Description &operator=(const Description &other_message) = delete

Default copy assignment, not implemented

Description &operator=(Description &&other_message) noexcept = delete

Default move assignment, not implemented

Protected Attributes

const std::weak_ptr<const ModelData> model

Root of the model hierarchy

Data *const message

The class which stores all of the message’s data.