0.2.0
Loading...
Searching...
No Matches
NAV::OutputPin Class Reference

Output pins of nodes. More...

Classes

struct  OutgoingLink
 Collection of information about the connected node and pin. More...
 

Public Types

using PeekPollDataFunc
 FileReader/Simulator peekPollData function type for nodes with more than one polling pin.
 
using PinData
 Possible Types represented by an output pin.
 
using PollDataFunc
 FileReader/Simulator pollData function type for nodes with a single poll pin.
 

Public Member Functions

bool canCreateLink (const InputPin &other) const
 Checks if this pin can connect to the provided pin.
 
bool createLink (InputPin &endPin, ax::NodeEditor::LinkId linkId=0)
 Creates a link from this pin to another, calling all node specific callbacks.
 
void deleteLink (InputPin &endPin)
 Disconnects the link.
 
void deleteLinks ()
 Disconnects all links.
 
bool isPinLinked () const
 Checks if the pin is linked.
 
bool isPinLinked (const InputPin &endPin) const
 Checks if the pin is linked to the other pin.
 
OutputPinoperator= (const OutputPin &)=delete
 Copy assignment operator.
 
OutputPinoperator= (OutputPin &&other) noexcept
 Move assignment operator.
 
 OutputPin ()=default
 Default constructor (for serialization)
 
 OutputPin (ax::NodeEditor::PinId id, const char *name, Type type, Node *parentNode)
 Constructor.
 
 OutputPin (const OutputPin &)=delete
 Copy constructor.
 
 OutputPin (OutputPin &&other) noexcept
 Move constructor.
 
bool recreateLink (InputPin &endPin)
 Destroys and recreates a link from this pin to another.
 
 ~OutputPin ()=default
 Destructor.
 
- Public Member Functions inherited from NAV::Pin
void drawPinIcon (bool connected, int alpha) const
 Draw the Pin Icon.
 
ImColor getIconColor () const
 Get the Icon Color object.
 
 Pin (ax::NodeEditor::PinId id, const char *name, Type type, Kind kind, Node *parentNode)
 Constructor.
 

Public Attributes

std::atomic< bool > blocksConnectedNodeFromFinishing
 Flag, whether connected nodes can finish with this pin not being finished yet (needed to make a loop with nodes)
 
PinData data
 Pointer to data (owned by this node) which is transferred over this pin.
 
std::condition_variable dataAccessConditionVariable
 Condition variable to signal that the data was read by connected nodes (used for non-flow pins)
 
size_t dataAccessCounter
 Counter for data accessing.
 
std::mutex dataAccessMutex
 Mutex to interact with the data object and also the dataAccessCounter variable.
 
std::vector< OutgoingLinklinks
 Info to identify the linked pins.
 
std::atomic< bool > noMoreDataAvailable
 Flag set, when no more data is available on this pin.
 
- Public Attributes inherited from NAV::Pin
std::vector< std::string > dataIdentifier
 One or multiple Data Identifiers (Unique name which is used for data flows)
 
ax::NodeEditor::PinId id
 Unique Id of the Pin.
 
Kind kind
 Kind of the Pin (Input/Output)
 
std::string name
 Name of the Pin.
 
NodeparentNode
 Reference to the parent node.
 
Type type
 Type of the Pin.
 

Additional Inherited Members

- Static Public Member Functions inherited from NAV::Pin
static bool canCreateLink (const OutputPin &startPin, const InputPin &endPin)
 Checks if pins can connect.
 
static bool dataIdentifierHaveCommon (const std::vector< std::string > &a, const std::vector< std::string > &b)
 Checks if the first list of data identifiers has a common entry with the second.
 
- Protected Member Functions inherited from NAV::Pin
 Pin ()=default
 Default constructor.
 
- Static Protected Member Functions inherited from NAV::Pin
static bool createLink (OutputPin &startPin, InputPin &endPin, ax::NodeEditor::LinkId linkId=0)
 Create a Link between the two given pins.
 
static void deleteLink (OutputPin &startPin, InputPin &endPin)
 Disconnects the link.
 
static bool recreateLink (OutputPin &startPin, InputPin &endPin)
 Destroys and recreates a link from this pin to another.
 

Detailed Description

Output pins of nodes.

Member Typedef Documentation

◆ PeekPollDataFunc

FileReader/Simulator peekPollData function type for nodes with more than one polling pin.

  • First parameter is the index of the pin in the outputPins vector
  • Second parameter is a boolean 'peek' This function gets called twice.
    • First with 'peek = true': There an observation with a valid InsTime must be provided. invokeCallbacks(... should not be called.
    • Second with 'peek = false': Here the message is read again and invokeCallbacks(...) should be called

Constructor & Destructor Documentation

◆ OutputPin()

NAV::OutputPin::OutputPin ( ax::NodeEditor::PinId id,
const char * name,
Type type,
Node * parentNode )
inline

Constructor.

Parameters
[in]idUnique Id of the Pin
[in]nameName of the Pin
[in]typeType of the Pin
[in]parentNodeReference to the parent node

Member Function Documentation

◆ canCreateLink()

bool NAV::OutputPin::canCreateLink ( const InputPin & other) const

Checks if this pin can connect to the provided pin.

Parameters
[in]otherThe pin to create a link to
Returns
True if it can create a link

◆ createLink()

bool NAV::OutputPin::createLink ( InputPin & endPin,
ax::NodeEditor::LinkId linkId = 0 )

Creates a link from this pin to another, calling all node specific callbacks.

Parameters
[in]endPinPin which should be linked to this pin
[in]linkIdId of the link to create
Returns
True if the link could be created

◆ deleteLink()

void NAV::OutputPin::deleteLink ( InputPin & endPin)

Disconnects the link.

Parameters
[in]endPinPin which should be linked to this pin

◆ isPinLinked() [1/2]

bool NAV::OutputPin::isPinLinked ( ) const

Checks if the pin is linked.

Returns
True if a link exists on this pin

◆ isPinLinked() [2/2]

bool NAV::OutputPin::isPinLinked ( const InputPin & endPin) const

Checks if the pin is linked to the other pin.

Parameters
[in]endPinThe pin to check if they are linked
Returns
True if a link exists on the pins

◆ recreateLink()

bool NAV::OutputPin::recreateLink ( InputPin & endPin)

Destroys and recreates a link from this pin to another.

Parameters
[in]endPinPin which should be linked to this pin
Returns
True if the link could be created

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