Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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 95 of file model-port.hpp.

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
 

Public Member Functions

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

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() [1/2]

ModelPort ( )
inline

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

◆ ModelPort() [2/2]

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

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

References ModelPortRegistry::accessDescriptor().

+ Here is the call graph for this function:

Member Function Documentation

◆ exists()

bool exists ( ID< asset::Pipe key)
static

check if the global model port registration contains a mapping for the given pipe-ID

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

References ModelPortRegistry::globalInstance(), and ModelPortRegistry::isRegistered().

Referenced by ModelPortRegistry_test::accessing_ModelPorts(), ModelPort::isValid(), and ModelPortRegistry_test::transactionalSwitch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 265 of file model-port-registry.cpp.

References ModelPortRegistry::accessDescriptor(), ModelPortRegistry::ModelPortDescriptor::id(), and ModelPort::id_.

Referenced by ModelPortRegistry_test::accessing_ModelPorts(), and ModelPortRegistry_test::transactionalSwitch().

+ Here is the call graph for this function:
+ Here is the caller 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 278 of file model-port-registry.cpp.

References ModelPortRegistry::accessDescriptor(), ModelPortRegistry::ModelPortDescriptor::holder(), and ModelPort::id_.

Referenced by ModelPortRegistry_test::accessing_ModelPorts(), and ModelPortRegistry_test::transactionalSwitch().

+ Here is the call graph for this function:
+ Here is the caller 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 290 of file model-port-registry.cpp.

References ModelPort::id_.

Referenced by ModelPortRegistry_test::accessing_ModelPorts().

+ Here is the caller graph for this function:

◆ isValid()

bool isValid ( ) const
inline

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

References ModelPort::exists().

Referenced by ModelPort::operator bool().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator bool()

operator bool ( ) const
inlineexplicit

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

References ModelPort::isValid().

+ Here is the call graph for this function:

Member Data Documentation

◆ id_

ID<asset::Pipe> id_
private

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

Referenced by ModelPort::holder(), ModelPort::pipe(), and ModelPort::streamType().

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( ModelPort const &  mp1,
ModelPort const &  mp2 
)
friend

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

◆ operator!=

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

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

◆ operator<

bool operator< ( ModelPort const &  mp1,
ModelPort const &  mp2 
)
friend

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

+ Collaboration diagram for ModelPort:

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