3#include <Infinity/api.h>
4#include <Infinity/Types/All.hpp>
13class ProceduralSystemImpl;
84 ProceduralSystem(
const std::vector<unsigned char>& buffer,
const std::filesystem::path& loadPath = {});
113 std::string
id()
const;
185 const T&
getIn(
const std::string& name)
const
187 if constexpr (std::is_base_of_v<Infinity::Types::Core::Data, T>)
189 return *
dynamic_cast<const T*
>(getInData(name));
211 const T&
getOut(
const std::string& name)
const
213 if constexpr (std::is_base_of_v<Infinity::Types::Core::Data, T>)
215 return *
dynamic_cast<const T*
>(getOutData(name));
232 void setIn(
const std::string& name, T&& val)
234 if constexpr (std::is_base_of_v<Infinity::Types::Core::Data, T>)
236 setInData(name, std::make_shared<T>(std::move(val)));
253 void setIn(
const std::string& name,
const T& val)
255 if constexpr (std::is_base_of_v<Infinity::Types::Core::Data, T>)
257 setInData(name, std::make_shared<T>(val));
271 void setIn(
const std::string& name,
const T* val)
273 setInData(name, std::make_shared<T>(*val));
302 void setInData(
const std::string& name, std::shared_ptr<const Infinity::Types::Core::Base> data);
304 std::unique_ptr<ProceduralSystemImpl> _impl;
306 friend class ProceduralSystemImpl;
Main interface for a directed acyclic graph of procedural components.
Definition ProceduralSystem.hpp:58
~ProceduralSystem()
Destructor.
const T & getIn(const std::string &name) const
Retrieves typed data from an input port.
Definition ProceduralSystem.hpp:185
bool setLoop(int start, int stop, int step)
Configures the system to loop over a range of integer values.
std::string id() const
Gets the unique identifier for this system.
void clearLoop()
Clears any configured loop behavior.
bool setLoop(std::string portName)
Configures the system to loop over values from an input port.
void execute()
Executes the procedural system.
void setSeed(uint64_t seed)
Sets the random seed for the entire system.
const T & getOut(const std::string &name) const
Retrieves typed data from an output port.
Definition ProceduralSystem.hpp:211
void setIn(const std::string &name, T &&val)
Sets typed data on an input port (rvalue reference overload).
Definition ProceduralSystem.hpp:232
ProceduralSystem(const std::filesystem::path &file)
Loads a ProceduralSystem from a file.
ProceduralSystem(ProceduralSystem &&other)
Move constructor.
void setIn(const std::string &name, const T &val)
Sets typed data on an input port (const reference overload).
Definition ProceduralSystem.hpp:253
void setIn(const std::string &name, const T *val)
Sets typed data on an input port from a pointer (copied).
Definition ProceduralSystem.hpp:271
ProceduralSystem & operator=(ProceduralSystem &&other)
Move assignment operator.
ProceduralSystem(const std::vector< unsigned char > &buffer, const std::filesystem::path &loadPath={})
Creates a ProceduralSystem from a binary buffer.
Abstract base class for all Infinity Engine data types.
Definition Base.hpp:43
Template wrapper for primitive types to integrate with the Infinity type system.
Definition Value.hpp:89
Definition ComponentException.hpp:7