291 template<
typename P,
typename RT>
class TSlot :
public P {
A basic output slot.
Definition RenderGraphSlot.hpp:265
Vector< ConnectionPtr > mConnections
The connections that use this slot.
Definition RenderGraphSlot.hpp:268
void didDisconnect(Connection &slot) override
An internal method called whenever the slot is disconnected.
const Vector< ConnectionPtr > & getConnections() const final
A list of all connections to this output slot.
Definition RenderGraphSlot.hpp:275
void didConnect(Connection &connection) override
An internal method called after the slot is connected.
A class that describes the connection between an input and an output slot.
Definition RenderGraphSlot.hpp:188
InputSlot & mInput
The slot connected to the input end of the connection.
Definition RenderGraphSlot.hpp:197
Connection(InputSlot &input, OutputSlot &output)
Definition RenderGraphSlot.hpp:206
Status
Definition RenderGraphSlot.hpp:190
InputSlot & getInput() const
The slot connected to the input end of the connection.
Definition RenderGraphSlot.hpp:211
OutputSlot & mOutput
The slot connected to the output end of the connection.
Definition RenderGraphSlot.hpp:200
bool isConnected() const noexcept
Definition RenderGraphSlot.hpp:220
Status mStatus
A value that indicates the connection status.
Definition RenderGraphSlot.hpp:203
bool isDisconnected() const noexcept
Definition RenderGraphSlot.hpp:223
void disconnect()
Disconnects the connection.
OutputSlot & getOutput() const
The slot connected to the output end of the connection.
Definition RenderGraphSlot.hpp:214
Status getStatus() const noexcept
A value that indicates the connection status.
Definition RenderGraphSlot.hpp:217
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
A slot that outputs a resource. Can be connected to multiple input slots.
Definition RenderGraphSlot.hpp:159
Type getType() const final
Definition RenderGraphSlot.hpp:167
bool shouldDisconnect(Connection &connection) const override
An internal method called whenever a new disconnection is being made.
ConnectionPtr connect(InputSlot &input)
Connects the given input to this output slot.
bool supports(Slot &slot) const override
Checks if this slot supports a connection to the given slot.
OutputSlot(RenderTask *task, const StringView name)
Definition RenderGraphSlot.hpp:161
virtual const Vector< ConnectionPtr > & getConnections() const =0
A list of all connections to this output slot.
Connection * getConnection(Slot &slot) const override
Finds a connection to the given slot.
OutputSlot(RenderTask &task, StringView name)
A simple reference counter base class.
Definition SmartPtr.hpp:438
Definition RenderTask.hpp:164
A render task slot.
Definition RenderGraphSlot.hpp:23
static ConnectionPtr connect(InputSlot &input, OutputSlot &output)
Connects an output slot into an input slot.
RenderTask & getRenderTask() const
The render task that owns this render graph slot.
Definition RenderGraphSlot.hpp:45
static bool disconnect(InputSlot &input, OutputSlot &output)
Disconnect the given slot from this slot.
virtual bool shouldConnect(Slot &slot) const
An internal method called whenever a new connection is being made.
bool isOutput() const
Returns true if the slot is an output slot, false otherwise.
Definition RenderGraphSlot.hpp:64
virtual RenderResourceType getResourceType() const =0
The type of resource accepted by the slot.
bool isInput() const
Returns true if the slot is an input slot, false otherwise.
Definition RenderGraphSlot.hpp:58
virtual Connection * getConnection(Slot &slot) const =0
Finds a connection to the given slot.
virtual Type getType() const =0
virtual void willDisconnect(Connection &connection)
An internal method called before the slot is disconnected.
Definition RenderGraphSlot.hpp:110
RenderTask & mTask
The render task that owns this render graph slot.
Definition RenderGraphSlot.hpp:33
virtual void willConnect(Slot &slot)
An internal method called before the slot is connected.
virtual void didDisconnect(Connection &slot)
An internal method called whenever the slot is disconnected.
Definition RenderGraphSlot.hpp:113
virtual void didConnect(Connection &connection)
An internal method called after the slot is connected.
Definition RenderGraphSlot.hpp:103
const StringView mName
A human-readable name for the slot.
Definition RenderGraphSlot.hpp:36
StringView getName() const
A human-readable name for the slot.
Definition RenderGraphSlot.hpp:48
bool isConnected(Slot &slot) const
Checks if there's an active connection to the given slot.
OutputSlot & asOutput()
Definition RenderGraphSlot.hpp:237
virtual bool supports(Slot &slot) const
Checks if this slot supports a connection to the given slot.
Event< void(Connection &)> onConnect
An event triggered whenever the slot is connected to another.
Definition RenderGraphSlot.hpp:117
friend ConnectionPtr connect(InputSlot &input, OutputSlot &output)
Connects an output slot into an input slot.
Definition RenderGraphSlot.hpp:81
virtual bool shouldDisconnect(Connection &connection) const
An internal method called whenever a new disconnection is being made.
InputSlot & asInput()
Definition RenderGraphSlot.hpp:235
Event< void(Connection &)> onDisconnect
An event triggered whenever the slot is disconnected from another.
Definition RenderGraphSlot.hpp:120
Type
A enumeration of the types of slots.
Definition RenderGraphSlot.hpp:26
Slot(RenderTask &task, StringView name)
Slot(RenderTask *task, const StringView name)
Definition RenderGraphSlot.hpp:39
friend bool disconnect(InputSlot &input, OutputSlot &output)
Disconnect the given slot from this slot.
Definition RenderGraphSlot.hpp:87
Base template for the event class.
Definition Event.hpp:27
A type-safe output slot type.
Definition RenderGraphSlot.hpp:313
ConnectionPtr operator=(TSlot< BasicInputSlot, RT > &slot)
Connects the given input to this output slot.
Definition RenderGraphSlot.hpp:319
A type-safe slot base class.
Definition RenderGraphSlot.hpp:291
RenderResourceType getResourceType() const final
The type of resource accepted by the slot.
Definition RenderGraphSlot.hpp:297
Definition Application.hpp:19
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
std::uint32_t UInt32
Definition DataTypes.hpp:23
RenderResourceType
Definition RenderResource.hpp:22
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25