Program Listing for File LayerData.h

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

#ifndef INCLUDE_FLAMEGPU_MODEL_LAYERDATA_H_
#define INCLUDE_FLAMEGPU_MODEL_LAYERDATA_H_

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

#include "flamegpu/runtime/HostAPI_macros.h"  // Todo replace with std/cub style fns (see AgentFunction.cuh)
#include "flamegpu/model/ModelData.h"

namespace flamegpu {

struct AgentFunctionData;
class LayerDescription;
class HostFunctionCallback;
class HostFunctionConditionCallback;

struct LayerData {
    friend class ModelDescription;
    friend struct ModelData;
    std::weak_ptr<const ModelData> model;
    std::set<std::shared_ptr<AgentFunctionData>> agent_functions;
    std::set<FLAMEGPU_HOST_FUNCTION_POINTER> host_functions;
    std::set<HostFunctionCallback*> host_functions_callbacks;
    std::shared_ptr<SubModelData> sub_model;
    std::string name;
    flamegpu::size_type index;
    bool operator==(const LayerData &rhs) const;
    bool operator!=(const LayerData &rhs) const;
    LayerData(const LayerData &other) = delete;

 protected:
    friend DependencyGraph;  // Uses normal constructor to directly create layers in ModelData - avoids requiring ModelDescription in DependencyGraph
    LayerData(const std::shared_ptr<const ModelData> &model, const LayerData &other);
    LayerData(const std::shared_ptr<const ModelData> &model, const std::string &name, const flamegpu::size_type &index);
};

}  // namespace flamegpu

#endif  // INCLUDE_FLAMEGPU_MODEL_LAYERDATA_H_