Program Listing for File AgentData.h

Return to documentation for file (include/flamegpu/model/AgentData.h)

#ifndef INCLUDE_FLAMEGPU_MODEL_AGENTDATA_H_
#define INCLUDE_FLAMEGPU_MODEL_AGENTDATA_H_

#include <memory>
#include <unordered_map>
#include <set>
#include <string>

#include "flamegpu/model/Variable.h"
#include "flamegpu/model/ModelData.h"
#include "flamegpu/defines.h"

namespace flamegpu {

class CAgentDescription;
struct AgentFunctionData;

struct AgentData : std::enable_shared_from_this<AgentData> {
    friend class ModelDescription;
    friend struct ModelData;
    friend class DependencyGraph;
    typedef std::unordered_map<std::string, std::shared_ptr<AgentFunctionData>> FunctionMap;
    std::weak_ptr<const ModelData> model;
    FunctionMap functions;
    VariableMap variables;
    std::set<std::string> states;
    std::string initial_state;
    unsigned int agent_outputs;
    std::string name;
    bool keepDefaultState;
    unsigned int sortPeriod;
    bool isOutputOnDevice() const;
    bool operator==(const AgentData &rhs) const;
    bool operator==(const CAgentDescription& rhs) const;
    bool operator!=(const AgentData &rhs) const;
    AgentData(const AgentData &other) = delete;
    std::shared_ptr<const AgentData> clone() const;

 protected:
    AgentData(std::shared_ptr<const ModelData> model, const AgentData &other);
    AgentData(std::shared_ptr<const ModelData> model, const std::string &agent_name);
};

}  // namespace flamegpu

#endif  // INCLUDE_FLAMEGPU_MODEL_AGENTDATA_H_