CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
GraphSocket.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "Forward.hpp"
11
17
18namespace CeresEngine {
19
23 Input,
24
26 Output
27 };
28
29 enum class GraphValueType {
30 Float,
31 Double
32 };
33
35 enum class GraphSocketFlag {
39 Exsocketed = (1u << 0u),
40 };
41
45
99
100} // namespace CeresEngine
#define CE_FLAGS_OPERATORS(Enum)
Defines global operators for a Flags<Enum, Storage> implementation.
Definition Flags.hpp:216
Definition GraphConnection.hpp:19
Definition GraphNode.hpp:21
Definition GraphSocket.hpp:46
GraphNode & mNode
A reference to the node that owns this socket.
Definition GraphSocket.hpp:49
const GraphSocketFlags & getFlags() const noexcept
A set of user-defined flags that customize behavior of the socket.
Definition GraphSocket.hpp:91
GraphSocketFlags mFlags
A set of user-defined flags that customize behavior of the socket.
Definition GraphSocket.hpp:58
GraphConnection * connectWith(GraphSocket &targetSocket)
Event< void()> onChange
Definition GraphSocket.hpp:64
GraphSocket(GraphNode &node, const GraphSocketDirection direction, const GraphValueType type)
Definition GraphSocket.hpp:70
GraphConnection * connectWith(GraphNode &targetNode, StringView targetSocketName)
GraphNode & getNode() const noexcept
A reference to the node that owns this socket.
Definition GraphSocket.hpp:85
Event< void(GraphConnection &)> onDisconnect
Definition GraphSocket.hpp:67
GraphSocketDirection mDirection
Determines the connection direction of the socket.
Definition GraphSocket.hpp:52
void disconnectWith(GraphSocket &targetSocket)
GraphConnection * getConnectionTo(GraphSocket &targetSocket) const
Event< void(GraphConnection &)> onConnect
Definition GraphSocket.hpp:66
void setFlags(const GraphSocketFlags &flags)
A set of user-defined flags that customize behavior of the socket.
const Vector< GraphConnectionPtr > & getConnections() const noexcept
Definition GraphSocket.hpp:75
GraphValueType mType
Determines the type of this socket.
Definition GraphSocket.hpp:55
Vector< GraphConnectionPtr > mConnections
A vector of all connections on this socket.
Definition GraphSocket.hpp:61
GraphValueType getType() const noexcept
Determines the type of this socket.
Definition GraphSocket.hpp:97
GraphSocketDirection getDirection() const noexcept
Determines the connection direction of the socket.
Definition GraphSocket.hpp:88
GraphConnection * disconnectWith(GraphNode &targetNode, StringView targetSocketName)
A simple reference counter base class.
Definition SmartPtr.hpp:438
Base template for the event class.
Definition Event.hpp:27
Definition Application.hpp:19
GraphValueType
Definition GraphSocket.hpp:29
GraphSocketFlag
A set of user-defined flags that customize behavior of a socket.
Definition GraphSocket.hpp:35
@ Exsocketed
If set to true, this socket will be considered connected and, if let unconneted, will be available as...
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
GraphSocketDirection
Enumeration that determines the direction of a socket.
Definition GraphSocket.hpp:21
@ Output
Determines that the socket takes a value as output.
@ Input
Determines that the socket takes a value as input.
float Float
Definition DataTypes.hpp:32
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
double Double
Definition DataTypes.hpp:33