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

Generic port interface. More...

#include <smgl/Ports.hpp>

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

Public Types

enum class  State { Idle , Waiting , Queued , Error }
 

Public Member Functions

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

 Port ()=default
 
 Port (State s)
 
virtual ~Port ()=default
 
- Protected Member Functions inherited from smgl::UniquelyIdentifiable
 UniquelyIdentifiable ()=default
 

Protected Attributes

State state_ {State::Idle}
 
Nodeparent_ {nullptr}
 
- Protected Attributes inherited from smgl::UniquelyIdentifiable
Uuid uuid_ {Uuid::Uuid4()}
 

Detailed Description

Generic port interface.

Definition at line 90 of file Ports.hpp.

Member Enumeration Documentation

◆ State

enum class smgl::Port::State
strong

Port state types

Definition at line 94 of file Ports.hpp.

Constructor & Destructor Documentation

◆ Port() [1/2]

smgl::Port::Port ( )
protecteddefault

Default constructor

◆ Port() [2/2]

smgl::Port::Port ( State  s)
explicitprotected

Construct with state

◆ ~Port()

virtual smgl::Port::~Port ( )
protectedvirtualdefault

Default destructor

Member Function Documentation

◆ deserialize()

virtual void smgl::Port::deserialize ( const Metadata m)
pure virtual

Deserialize the port

Implemented in smgl::InputPort< T >, and smgl::OutputPort< T, Args >.

◆ notify()

virtual void smgl::Port::notify ( State  s)
pure virtual

Notify a port of source state

Implemented in smgl::InputPort< T >, and smgl::OutputPort< T, Args >.

◆ serialize()

virtual Metadata smgl::Port::serialize ( )
pure virtual

Serialize the port

Implemented in smgl::InputPort< T >, and smgl::OutputPort< T, Args >.

◆ setParent()

void smgl::Port::setParent ( Node p)

Set the port's parent node

◆ setState()

void smgl::Port::setState ( State  s)

Set the port's state

◆ state()

State smgl::Port::state ( ) const

Return the port's current state

◆ update()

virtual bool smgl::Port::update ( )
pure virtual

Update the port's target with any posted values

Implemented in smgl::InputPort< T >, and smgl::OutputPort< T, Args >.

Member Data Documentation

◆ parent_

Node* smgl::Port::parent_ {nullptr}
protected

Parent node

Definition at line 127 of file Ports.hpp.

◆ state_

State smgl::Port::state_ {State::Idle}
protected

Current state

Definition at line 125 of file Ports.hpp.


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