Struct SubAgentData

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< SubAgentData >

Struct Documentation

struct flamegpu::SubAgentData : public std::enable_shared_from_this<SubAgentData>

Holds all the mappings between a an agent in the submodel and the parent model States and variables can be mapped

Public Types

typedef std::unordered_map<std::string, std::string> Mapping

Map of submodel item name:parent model item name map<string, string>

Public Functions

bool operator==(const SubAgentData &rhs) const

Equality operator, checks whether SubAgentData hierarchies are functionally the same

Note

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

Returns

True when models are the same

bool operator!=(const SubAgentData &rhs) const

Equality operator, checks whether SubAgentData hierarchies are functionally different

Note

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

Returns

True when models are not the same

SubAgentData(const SubAgentData &other) = delete

Default copy constructor, not implemented

Public Members

std::weak_ptr<AgentData> subAgent

The sub agent which is bound

std::weak_ptr<AgentData> masterAgent

The master agent which is bound

Mapping variables

Holds all of the agent’s variable mappings

Mapping states

Holds all of the agent’s state mappings

std::weak_ptr<SubModelData> parent

The model which this agent is a member of

std::shared_ptr<SubAgentDescription> description

Description class which provides convenient accessors This may be null if the instance has been cloned

Protected Functions

explicit SubAgentData(const std::shared_ptr<const ModelData> &model, const std::shared_ptr<SubModelData> &parent, const SubAgentData &other)

Copy constructor This should only be called via clone();

explicit SubAgentData(const std::shared_ptr<const ModelData> &model, const std::shared_ptr<SubModelData> &_parent, const std::shared_ptr<AgentData> &subAgent, const std::shared_ptr<AgentData> &masterAgent)

Normal constructor This should only be called by SubModelDescription

Friends

friend class SubAgentDescription
friend class SubModelDescription
friend struct ModelData