Lumiera  0.pre.03
»edit your freedom«
ModelPort Class Reference

#include "steam/mobject/model-port.hpp"

Description

Handle designating a point within the model, where actually output data can be pulled.

ModelPort is a frontend to be used by clients. These ModelPort handle objects may be copied and stored at will, but their validity will be verified on each access. Actually, the Builder will discover any model ports and maintain a ModelPortRegistry behind the scenes.

Each model port corresponds to a (global) pipe within a specific Timeline ("holder"); consequently each such port is also bound to produce data of a specific StreamType (as defined by the corresponding pipe). A model port may be in unconnected state, which can be checked through bool conversion. While the ModelPort handles are value objects, the identity of the underlying model port (descriptor) is given by the corresponding pipe-ID, thus effectively resulting in a global namespace for model ports.

See also
builder::ModelPortRegistry management interface
ModelPortRegistry_test abstract usage example

Definition at line 104 of file model-port.hpp.

Public Member Functions

 ModelPort (ID< asset::Pipe > refID)
 
ID< asset::Structholder () const
 access the timeline (or similar structural element) holding a global pipe which corresponds to this model port More...
 
bool isValid () const
 
 operator bool () const
 
ID< asset::Pipepipe () const
 access the Pipe (ID) of the global model port registered with the ID underlying this model port. More...
 
StreamType::ID streamType () const
 convenience shortcut to access the stream type associated with the pipe-ID corresponding to this model port. More...
 

Static Public Member Functions

static bool exists (ID< asset::Pipe >)
 check if the global model port registration contains a mapping for the given pipe-ID
 

Friends

bool operator!= (ModelPort const &mp1, ModelPort const &mp2)
 
bool operator< (ModelPort const &mp1, ModelPort const &mp2)
 
bool operator== (ModelPort const &mp1, ModelPort const &mp2)
 

Private Attributes

ID< asset::Pipeid_
 

Constructor & Destructor Documentation

◆ ModelPort()

ModelPort ( ID< asset::Pipe refID)
Note
conversion from pipe-ID

Definition at line 253 of file model-port-registry.cpp.

References ModelPortRegistry::accessDescriptor().

+ Here is the call graph for this function:

Member Function Documentation

◆ pipe()

ID< asset::Pipe > pipe ( ) const

access the Pipe (ID) of the global model port registered with the ID underlying this model port.

Exceptions
error::Logicif no model port is registered for this Pipe-ID

Definition at line 274 of file model-port-registry.cpp.

References ModelPortRegistry::accessDescriptor().

+ Here is the call graph for this function:

◆ holder()

ID< asset::Struct > holder ( ) const

access the timeline (or similar structural element) holding a global pipe which corresponds to this model port

Exceptions
error::Logicif no model port is registered for this Pipe-ID

Definition at line 287 of file model-port-registry.cpp.

References ModelPortRegistry::accessDescriptor().

+ Here is the call graph for this function:

◆ streamType()

StreamType::ID streamType ( ) const

convenience shortcut to access the stream type associated with the pipe-ID corresponding to this model port.

Note
no check if this model port actually is valid
Exceptions
error::Invalidin case of unknown/unregistered Pipe-ID

Definition at line 299 of file model-port-registry.cpp.

+ Collaboration diagram for ModelPort:

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