CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Slot Class Referenceabstract

A render task slot. More...

#include <CeresEngine/Renderer/RenderGraph/RenderGraphSlot.hpp>

Inheritance diagram for CeresEngine::Slot:
CeresEngine::InputSlot CeresEngine::OutputSlot CeresEngine::BasicInputSlot CeresEngine::BasicOutputSlot CeresEngine::TSlot< BasicInputSlot, RT > CeresEngine::TSlot< BasicInputSlot, ImageRenderResource > CeresEngine::TSlot< BasicOutputSlot, RT > CeresEngine::TInput< RT > CeresEngine::TOutput< RT >

Public Types

enum class  Type { Input , Output }
 A enumeration of the types of slots. More...
 

Public Member Functions

 Slot (RenderTask *task, const StringView name)
 
 Slot (RenderTask &task, StringView name)
 
 ~Slot ()
 
RenderTaskgetRenderTask () const
 The render task that owns this render graph slot.
 
StringView getName () const
 A human-readable name for the slot.
 
virtual RenderResourceType getResourceType () const =0
 The type of resource accepted by the slot.
 
virtual Type getType () const =0
 
bool isInput () const
 Returns true if the slot is an input slot, false otherwise.
 
InputSlotasInput ()
 
const InputSlotasInput () const
 
bool isOutput () const
 Returns true if the slot is an output slot, false otherwise.
 
OutputSlotasOutput ()
 
const OutputSlotasOutput () const
 
virtual ConnectiongetConnection (Slot &slot) const =0
 Finds a connection to the given slot.
 
bool isConnected (Slot &slot) const
 Checks if there's an active connection to the given slot.
 
UInt32 disconnectAll ()
 
virtual bool supports (Slot &slot) const
 Checks if this slot supports a connection to the given slot.
 

Static Public Member Functions

static ConnectionPtr connect (InputSlot &input, OutputSlot &output)
 Connects an output slot into an input slot.
 
static bool disconnect (InputSlot &input, OutputSlot &output)
 Disconnect the given slot from this slot.
 

Public Attributes

Event< void(Connection &)> onConnect
 An event triggered whenever the slot is connected to another.
 
Event< void(Connection &)> onDisconnect
 An event triggered whenever the slot is disconnected from another.
 

Protected Member Functions

virtual bool shouldConnect (Slot &slot) const
 An internal method called whenever a new connection is being made.
 
virtual void willConnect (Slot &slot)
 An internal method called before the slot is connected.
 
virtual void didConnect (Connection &connection)
 An internal method called after the slot is connected.
 
virtual bool shouldDisconnect (Connection &connection) const
 An internal method called whenever a new disconnection is being made.
 
virtual void willDisconnect (Connection &connection)
 An internal method called before the slot is disconnected.
 
virtual void didDisconnect (Connection &slot)
 An internal method called whenever the slot is disconnected.
 

Protected Attributes

RenderTaskmTask
 The render task that owns this render graph slot.
 
const StringView mName
 A human-readable name for the slot.
 

Friends

ConnectionPtr connect (InputSlot &input, OutputSlot &output)
 Connects an output slot into an input slot.
 
bool disconnect (InputSlot &input, OutputSlot &output)
 Disconnect the given slot from this slot.
 

Detailed Description

A render task slot.

Each slot can be either input or output and can be used to connect dependent resources between multiple tasks.

Member Enumeration Documentation

◆ Type

A enumeration of the types of slots.

Enumerator
Input 
Output 

Constructor & Destructor Documentation

◆ Slot() [1/2]

CeresEngine::Slot::Slot ( RenderTask task,
const StringView  name 
)
inlineexplicit

◆ Slot() [2/2]

CeresEngine::Slot::Slot ( RenderTask task,
StringView  name 
)
explicit

◆ ~Slot()

CeresEngine::Slot::~Slot ( )

Member Function Documentation

◆ asInput() [1/2]

InputSlot & CeresEngine::Slot::asInput ( )
inline

◆ asInput() [2/2]

const InputSlot & CeresEngine::Slot::asInput ( ) const
inline

◆ asOutput() [1/2]

OutputSlot & CeresEngine::Slot::asOutput ( )
inline

◆ asOutput() [2/2]

const OutputSlot & CeresEngine::Slot::asOutput ( ) const
inline

◆ connect()

static ConnectionPtr CeresEngine::Slot::connect ( InputSlot input,
OutputSlot output 
)
static

Connects an output slot into an input slot.

◆ didConnect()

virtual void CeresEngine::Slot::didConnect ( Connection connection)
inlineprotectedvirtual

An internal method called after the slot is connected.

Reimplemented in CeresEngine::BasicInputSlot, and CeresEngine::BasicOutputSlot.

◆ didDisconnect()

virtual void CeresEngine::Slot::didDisconnect ( Connection slot)
inlineprotectedvirtual

An internal method called whenever the slot is disconnected.

Reimplemented in CeresEngine::BasicInputSlot, and CeresEngine::BasicOutputSlot.

◆ disconnect()

static bool CeresEngine::Slot::disconnect ( InputSlot input,
OutputSlot output 
)
static

Disconnect the given slot from this slot.

◆ disconnectAll()

UInt32 CeresEngine::Slot::disconnectAll ( )

◆ getConnection()

virtual Connection * CeresEngine::Slot::getConnection ( Slot slot) const
pure virtual

Finds a connection to the given slot.

If no such connections exists, returns nullptr.

Implemented in CeresEngine::InputSlot, and CeresEngine::OutputSlot.

◆ getName()

StringView CeresEngine::Slot::getName ( ) const
inline

A human-readable name for the slot.

◆ getRenderTask()

RenderTask & CeresEngine::Slot::getRenderTask ( ) const
inline

The render task that owns this render graph slot.

◆ getResourceType()

virtual RenderResourceType CeresEngine::Slot::getResourceType ( ) const
pure virtual

◆ getType()

virtual Type CeresEngine::Slot::getType ( ) const
pure virtual

◆ isConnected()

bool CeresEngine::Slot::isConnected ( Slot slot) const

Checks if there's an active connection to the given slot.

◆ isInput()

bool CeresEngine::Slot::isInput ( ) const
inline

Returns true if the slot is an input slot, false otherwise.

◆ isOutput()

bool CeresEngine::Slot::isOutput ( ) const
inline

Returns true if the slot is an output slot, false otherwise.

◆ shouldConnect()

virtual bool CeresEngine::Slot::shouldConnect ( Slot slot) const
protectedvirtual

An internal method called whenever a new connection is being made.

The slot implementation can use this method to refuse connections.

◆ shouldDisconnect()

virtual bool CeresEngine::Slot::shouldDisconnect ( Connection connection) const
protectedvirtual

An internal method called whenever a new disconnection is being made.

The slot implementation can use this method to refuse disconnections.

Reimplemented in CeresEngine::InputSlot, and CeresEngine::OutputSlot.

◆ supports()

virtual bool CeresEngine::Slot::supports ( Slot slot) const
virtual

Checks if this slot supports a connection to the given slot.

Reimplemented in CeresEngine::InputSlot, and CeresEngine::OutputSlot.

◆ willConnect()

virtual void CeresEngine::Slot::willConnect ( Slot slot)
protectedvirtual

An internal method called before the slot is connected.

◆ willDisconnect()

virtual void CeresEngine::Slot::willDisconnect ( Connection connection)
inlineprotectedvirtual

An internal method called before the slot is disconnected.

Friends And Related Symbol Documentation

◆ connect

ConnectionPtr connect ( InputSlot input,
OutputSlot output 
)
friend

Connects an output slot into an input slot.

◆ disconnect

bool disconnect ( InputSlot input,
OutputSlot output 
)
friend

Disconnect the given slot from this slot.

Member Data Documentation

◆ mName

const StringView CeresEngine::Slot::mName
protected

A human-readable name for the slot.

◆ mTask

RenderTask& CeresEngine::Slot::mTask
protected

The render task that owns this render graph slot.

◆ onConnect

Event<void(Connection&)> CeresEngine::Slot::onConnect

An event triggered whenever the slot is connected to another.

◆ onDisconnect

Event<void(Connection&)> CeresEngine::Slot::onDisconnect

An event triggered whenever the slot is disconnected from another.


The documentation for this class was generated from the following file: