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

Output pins of nodes. More...

Data Structures

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.
 

Data Fields

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.
 
- Data Fields 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.
 

Private Member Functions

void connect (InputPin &endPin, ax::NodeEditor::LinkId linkId=0)
 Connects this pin to another.
 
void disconnect (InputPin &endPin)
 Disconnects the link.
 

Friends

class InputPin
 
class 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.

Definition at line 337 of file Pin.hpp.

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

Definition at line 442 of file Pin.hpp.

◆ PinData

Possible Types represented by an output pin.

Definition at line 448 of file Pin.hpp.

◆ PollDataFunc

FileReader/Simulator pollData function type for nodes with a single poll pin.

Definition at line 445 of file Pin.hpp.

Constructor & Destructor Documentation

◆ OutputPin() [1/4]

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

Definition at line 345 of file Pin.hpp.

◆ OutputPin() [2/4]

NAV::OutputPin::OutputPin ( )
default

Default constructor (for serialization)

◆ ~OutputPin()

NAV::OutputPin::~OutputPin ( )
default

Destructor.

◆ OutputPin() [3/4]

NAV::OutputPin::OutputPin ( const OutputPin & )
delete

Copy constructor.

◆ OutputPin() [4/4]

NAV::OutputPin::OutputPin ( OutputPin && other)
inlinenoexcept

Move constructor.

Definition at line 355 of file Pin.hpp.

Member Function Documentation

◆ canCreateLink()

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

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

Definition at line 239 of file Pin.cpp.

◆ connect()

void NAV::OutputPin::connect ( NAV::InputPin & endPin,
ax::NodeEditor::LinkId linkId = 0 )
private

Connects this pin to another.

Parameters
[in]endPinPin which should be linked to this pin
[in]linkIdId of the link to create

Definition at line 287 of file Pin.cpp.

◆ 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

Definition at line 257 of file Pin.cpp.

◆ deleteLink()

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

Disconnects the link.

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

Definition at line 267 of file Pin.cpp.

◆ deleteLinks()

void NAV::OutputPin::deleteLinks ( )

Disconnects all links.

Definition at line 272 of file Pin.cpp.

◆ disconnect()

void NAV::OutputPin::disconnect ( InputPin & endPin)
private

Disconnects the link.

Parameters
[in]endPinPin which should be disconnected from this pin

Definition at line 319 of file Pin.cpp.

◆ isPinLinked() [1/2]

bool NAV::OutputPin::isPinLinked ( ) const
nodiscard

Checks if the pin is linked.

Returns
True if a link exists on this pin

Definition at line 244 of file Pin.cpp.

◆ isPinLinked() [2/2]

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

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

Definition at line 249 of file Pin.cpp.

◆ operator=() [1/2]

OutputPin & NAV::OutputPin::operator= ( const OutputPin & )
delete

Copy assignment operator.

◆ operator=() [2/2]

OutputPin & NAV::OutputPin::operator= ( OutputPin && other)
inlinenoexcept

Move assignment operator.

Definition at line 365 of file Pin.hpp.

◆ 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

Definition at line 262 of file Pin.cpp.

Friends And Related Symbol Documentation

◆ InputPin

friend class InputPin
friend

Definition at line 476 of file Pin.hpp.

◆ Pin

friend class Pin
friend

Definition at line 475 of file Pin.hpp.

Field Documentation

◆ blocksConnectedNodeFromFinishing

std::atomic<bool> NAV::OutputPin::blocksConnectedNodeFromFinishing

Flag, whether connected nodes can finish with this pin not being finished yet (needed to make a loop with nodes)

Definition at line 473 of file Pin.hpp.

◆ data

PinData NAV::OutputPin::data

Pointer to data (owned by this node) which is transferred over this pin.

Definition at line 458 of file Pin.hpp.

◆ dataAccessConditionVariable

std::condition_variable NAV::OutputPin::dataAccessConditionVariable

Condition variable to signal that the data was read by connected nodes (used for non-flow pins)

Definition at line 467 of file Pin.hpp.

◆ dataAccessCounter

size_t NAV::OutputPin::dataAccessCounter

Counter for data accessing.

Definition at line 464 of file Pin.hpp.

◆ dataAccessMutex

std::mutex NAV::OutputPin::dataAccessMutex

Mutex to interact with the data object and also the dataAccessCounter variable.

Definition at line 461 of file Pin.hpp.

◆ links

std::vector<OutgoingLink> NAV::OutputPin::links

Info to identify the linked pins.

Definition at line 433 of file Pin.hpp.

◆ noMoreDataAvailable

std::atomic<bool> NAV::OutputPin::noMoreDataAvailable

Flag set, when no more data is available on this pin.

Definition at line 470 of file Pin.hpp.


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