50 return "Experimental/Simple";
55 if (ImGui::InputInt(fmt::format(
"Delay length##{}",
size_t(
id)).c_str(), &
_delayLength))
59 if (
name.starts_with(
"z^-"))
86 if (j.contains(
"delayLength"))
128 if (
auto* connectedPin = link.getConnectedPin())
nlohmann::json json
json namespace
#define LOG_DEBUG
Debug information. Should not be called on functions which receive observations (spamming)
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
static std::string type()
Returns the type of the data class.
ImVec2 _guiConfigDefaultWindowSize
std::vector< OutputPin > outputPins
List of output pins.
Node(std::string name)
Constructor.
Kind kind
Kind of the Node.
bool callbacksEnabled
Enables the callbacks.
std::string nameId() const
Node name and id.
std::string name
Name of the Node.
void invokeCallbacks(size_t portIndex, const std::shared_ptr< const NodeData > &data)
Calls all registered callbacks on the specified output port.
ax::NodeEditor::NodeId id
Unique Id of the Node.
bool _hasConfig
Flag if the config window should be shown.
Node * parentNode
Reference to the parent node.
ax::NodeEditor::PinId id
Unique Id of the Pin.
std::vector< std::string > dataIdentifier
One or multiple Data Identifiers (Unique name which is used for data flows)
auto extract_front()
Returns a copy of the first element in the container and removes it from the container.
json save() const override
Saves the node into a json object.
bool onCreateLink(OutputPin &startPin, InputPin &endPin) override
Called when a new link is to be established.
void guiConfig() override
ImGui config window which is shown on double click.
int _delayLength
The amount to delay messages for.
static std::string category()
String representation of the Class Category.
Delay()
Default constructor.
~Delay() override
Destructor.
static constexpr size_t OUTPUT_PORT_INDEX_FLOW
Flow.
std::string type() const override
String representation of the Class Type.
void delayObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Delays the observation.
void deinitialize() override
Deinitialize the node.
std::deque< std::shared_ptr< const NodeData > > _buffer
Buffer to delay data.
static std::string typeStatic()
String representation of the Class Type.
bool initialize() override
Initialize the node.
void restore(const json &j) override
Restores the node from a json object.
OutputPin * CreateOutputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, OutputPin::PinData data=static_cast< void * >(nullptr), int idx=-1)
Create an Output Pin object.
InputPin * CreateInputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
Create an Input Pin object.