Lluvia
Node.h
Go to the documentation of this file.
1 
8 #ifndef LLUVIA_CORE_NODE_NODE_H_
9 #define LLUVIA_CORE_NODE_NODE_H_
10 
11 #include <cstdint>
12 #include <memory>
13 #include <string>
14 
17 
23 
24 namespace ll {
25 
26 class Object;
27 class CommandBuffer;
28 class Parameter;
29 
30 class Node {
31 
32 public:
33  virtual ~Node() = default;
34 
35  void setState(const ll::NodeState tState);
36  ll::NodeState getState() const noexcept;
37 
38  void init();
39 
47  virtual ll::NodeType getType() const noexcept = 0;
48 
56  virtual bool hasPort(const std::string& name) const noexcept = 0;
57 
68  virtual std::shared_ptr<ll::Object> getPort(const std::string& name) const = 0;
69 
78  virtual void setParameter(const std::string& name, const ll::Parameter& value) = 0;
79 
90  virtual const ll::Parameter& getParameter(const std::string& name) const = 0;
91 
100  virtual void bind(const std::string& name, const std::shared_ptr<ll::Object>& obj) = 0;
101 
109  virtual void record(ll::CommandBuffer& commandBuffer) const = 0;
110 
111 protected:
112  virtual void onInit() = 0;
113 
114 private:
116 };
117 
118 } // namespace ll
119 
120 #endif // LLUVIA_CORE_NODE_NODE_H_
NodeState enum.
NodeType enum.
PortDescriptor class.
PortDirection enum.
PortType enum.
Class for command buffer.
Definition: CommandBuffer.h:63
Definition: Node.h:30
virtual ~Node()=default
virtual void setParameter(const std::string &name, const ll::Parameter &value)=0
Sets a parameter.
virtual bool hasPort(const std::string &name) const noexcept=0
Returns whether or not a port exists with a given name.
virtual const ll::Parameter & getParameter(const std::string &name) const =0
Gets a parameter.
virtual void record(ll::CommandBuffer &commandBuffer) const =0
Records the operations required to run this node in a ll::CommandBuffer.
void init()
virtual ll::NodeType getType() const noexcept=0
Gets the node type.
virtual void onInit()=0
virtual std::shared_ptr< ll::Object > getPort(const std::string &name) const =0
Gets a port descriptor given its name.
virtual void bind(const std::string &name, const std::shared_ptr< ll::Object > &obj)=0
Binds a ll::Object as port index for this node.
ll::NodeState getState() const noexcept
void setState(const ll::NodeState tState)
Base class for all types that can be used in computer shaders.
Definition: Object.h:94
Definition: Parameter.h:23
Enums.
Definition: Buffer.h:28
NodeState
Class for node state.
Definition: NodeState.h:21
NodeType
Class for node type.
Definition: NodeType.h:19