Skip to main content

StagePorts Struct

Resolved port-id table for a stage — populated by the runtime before start(). More...

Declaration

struct simaai::neat::graph::StagePorts { ... }

Included Headers

#include <StageExecutor.h>

Public Member Functions Index

PortIdin_port (const std::string &name) const

Look up the id of an input port by name; returns kInvalidPort if missing. More...

PortIdout_port (const std::string &name) const

Look up the id of an output port by name; returns kInvalidPort if missing. More...

PortIdonly_input () const

Convenience: returns the sole input port if there's exactly one, else kInvalidPort. More...

PortIdonly_output () const

Convenience: returns the sole output port if there's exactly one, else kInvalidPort. More...

Public Member Attributes Index

std::unordered_map< std::string, PortId >in

Input ports keyed by name. More...

std::unordered_map< std::string, PortId >out

Output ports keyed by name. More...

Description

Resolved port-id table for a stage — populated by the runtime before start().

Stage authors should cache the relevant port-ids in set_ports() rather than looking them up by name on every on_input() call.

Definition at line 76 of file StageExecutor.h.

Public Member Functions

in_port()

PortId simaai::neat::graph::StagePorts::in_port (const std::string & name)
inline

Look up the id of an input port by name; returns kInvalidPort if missing.

Definition at line 81 of file StageExecutor.h.

81 PortId in_port(const std::string& name) const {
82 auto it = in.find(name);
83 return it == in.end() ? kInvalidPort : it->second;
84 }

only_input()

PortId simaai::neat::graph::StagePorts::only_input ()
inline

Convenience: returns the sole input port if there's exactly one, else kInvalidPort.

Definition at line 93 of file StageExecutor.h.

93 PortId only_input() const {
94 return in.size() == 1 ? in.begin()->second : kInvalidPort;
95 }

only_output()

PortId simaai::neat::graph::StagePorts::only_output ()
inline

Convenience: returns the sole output port if there's exactly one, else kInvalidPort.

Definition at line 98 of file StageExecutor.h.

99 return out.size() == 1 ? out.begin()->second : kInvalidPort;
100 }

out_port()

PortId simaai::neat::graph::StagePorts::out_port (const std::string & name)
inline

Look up the id of an output port by name; returns kInvalidPort if missing.

Definition at line 87 of file StageExecutor.h.

87 PortId out_port(const std::string& name) const {
88 auto it = out.find(name);
89 return it == out.end() ? kInvalidPort : it->second;
90 }

Public Member Attributes

in

std::unordered_map<std::string, PortId> simaai::neat::graph::StagePorts::in

Input ports keyed by name.

Definition at line 77 of file StageExecutor.h.

77 std::unordered_map<std::string, PortId> in;

out

std::unordered_map<std::string, PortId> simaai::neat::graph::StagePorts::out

Output ports keyed by name.

Definition at line 78 of file StageExecutor.h.

78 std::unordered_map<std::string, PortId> out;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.