smgl 0.11.0
Structured Metadata Engine and Graph Objects Library
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
smgl::Input Class Reference

Generic input port interface. More...

#include <smgl/Ports.hpp>

Inheritance diagram for smgl::Input:
[legend]
Collaboration diagram for smgl::Input:
[legend]

Public Member Functions

std::vector< ConnectiongetConnections () const
 
std::size_t numConnections () const
 Get the number of connections.
 
virtual Inputoperator= (Output &op)
 Connect an output port to an input port.
 
- Public Member Functions inherited from smgl::Port
virtual bool update ()=0
 
virtual void notify (State s)=0
 
State state () const
 
void setState (State s)
 
void setParent (Node *p)
 
virtual Metadata serialize ()=0
 
virtual void deserialize (const Metadata &m)=0
 
- Public Member Functions inherited from smgl::UniquelyIdentifiable
auto uuid () const -> Uuid
 
void setUuid (const Uuid &uuid)
 

Protected Member Functions

 Input ()
 
 ~Input () override
 
virtual void connect (Output *op) final
 
virtual void disconnect (Output *op) final
 
- Protected Member Functions inherited from smgl::Port
 Port ()=default
 
 Port (State s)
 
virtual ~Port ()=default
 
- Protected Member Functions inherited from smgl::UniquelyIdentifiable
 UniquelyIdentifiable ()=default
 

Protected Attributes

Outputsrc_ {nullptr}
 
std::size_t last_updated_ {0}
 
- Protected Attributes inherited from smgl::Port
State state_ {State::Idle}
 
Nodeparent_ {nullptr}
 
- Protected Attributes inherited from smgl::UniquelyIdentifiable
Uuid uuid_ {Uuid::Uuid4()}
 

Friends

template<typename OutputValType , typename... OutputArgs>
class OutputPort
 
void connect (Output &op, Input &ip)
 Connect an output port to an input port.
 
void disconnect (Output &op, Input &ip)
 Disconnect an output port and input port.
 

Additional Inherited Members

- Public Types inherited from smgl::Port
enum class  State { Idle , Waiting , Queued , Error }
 

Detailed Description

Generic input port interface.

Definition at line 131 of file Ports.hpp.

Constructor & Destructor Documentation

◆ Input()

smgl::Input::Input ( )
protected

Default constructor

◆ ~Input()

smgl::Input::~Input ( )
overrideprotected

Destructor performs auto-disconnect

Member Function Documentation

◆ connect()

virtual void smgl::Input::connect ( Output op)
finalprotectedvirtual

Connect to an output port

◆ disconnect()

virtual void smgl::Input::disconnect ( Output op)
finalprotectedvirtual

Disconnect from an output port

◆ getConnections()

std::vector< Connection > smgl::Input::getConnections ( ) const

Get a list of port connections

◆ numConnections()

std::size_t smgl::Input::numConnections ( ) const

Get the number of connections.

1 if connected to an output port, 0 otherwise.

◆ operator=()

virtual Input & smgl::Input::operator= ( Output op)
virtual

Connect an output port to an input port.

Exceptions
smgl::bad_connectionif port instances do not share underlying type T

Reimplemented in smgl::InputPort< T >.

Friends And Related Symbol Documentation

◆ connect

void connect ( Output op,
Input ip 
)
friend

Connect an output port to an input port.

Friend: smgl::connect

Exceptions
smgl::bad_connectionif port instances do not share underlying type T

◆ disconnect

void disconnect ( Output op,
Input ip 
)
friend

Disconnect an output port and input port.

Friend: smgl::disconnect

Does nothing if ports are not connected

◆ OutputPort

template<typename OutputValType , typename... OutputArgs>
friend class OutputPort
friend

Friend: typed OutputPort class

Definition at line 170 of file Ports.hpp.

Member Data Documentation

◆ last_updated_

std::size_t smgl::Input::last_updated_ {0}
protected

Tick of last received update

Definition at line 161 of file Ports.hpp.

◆ src_

Output* smgl::Input::src_ {nullptr}
protected

Pointer to connected output port

Definition at line 159 of file Ports.hpp.


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