Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
model-port.hpp
Go to the documentation of this file.
1/*
2 MODEL-PORT.hpp - point to pull output data from the model
3
4 Copyright (C)
5 2010, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
57#ifndef STEAM_MOBJECT_MODEL_PORT_H
58#define STEAM_MOBJECT_MODEL_PORT_H
59
60#include "steam/asset/pipe.hpp"
61#include "steam/streamtype.hpp"
62
63namespace steam {
64namespace mobject {
65
66 LUMIERA_ERROR_DECLARE (INVALID_MODEL_PORT);
67 LUMIERA_ERROR_DECLARE (UNCONNECTED_MODEL_PORT);
68
69
70 using asset::ID;
71
72
96 {
98
99 public:
101 : id_(ID<asset::Pipe>::INVALID)
102 { }
103
104 ModelPort (ID<asset::Pipe> refID);
105
106 // using default copy operations
107
108
109 static bool exists (ID<asset::Pipe>);
110
111 ID<asset::Pipe> pipe() const;
114
115 bool
116 isValid() const
117 {
118 return exists (this->id_);
119 }
120
121 explicit
122 operator bool() const
123 {
124 return isValid();
125 }
126
127
128 friend bool
129 operator== (ModelPort const& mp1, ModelPort const& mp2)
130 {
131 return mp1.id_ == mp2.id_;
132 }
133
134 friend bool
135 operator!= (ModelPort const& mp1, ModelPort const& mp2)
136 {
137 return mp1.id_ != mp2.id_;
138 }
139
140 friend bool
141 operator< (ModelPort const& mp1, ModelPort const& mp2)
142 {
143 return lib::HashVal(mp1.id_) < lib::HashVal(mp2.id_);
144 }
145
146 private:
147
148 };
149
150
151
152}} // namespace steam::mobject
153#endif
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition asset.hpp:98
Handle designating a point within the model, where actually output data can be pulled.
friend bool operator!=(ModelPort const &mp1, ModelPort const &mp2)
ID< asset::Pipe > id_
friend bool operator<(ModelPort const &mp1, ModelPort const &mp2)
ID< asset::Struct > holder() const
access the timeline (or similar structural element) holding a global pipe which corresponds to this m...
static bool exists(ID< asset::Pipe >)
check if the global model port registration contains a mapping for the given pipe-ID
ID< asset::Pipe > pipe() const
access the Pipe (ID) of the global model port registered with the ID underlying this model port.
friend bool operator==(ModelPort const &mp1, ModelPort const &mp2)
StreamType::ID streamType() const
convenience shortcut to access the stream type associated with the pipe-ID corresponding to this mode...
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Definition error.h:62
size_t HashVal
a STL compatible hash value
Definition hash-value.h:52
The asset subsystem of the Steam-Layer.
Steam-Layer implementation namespace root.
A "processing pipe" represented as Asset.
Framework for classification of media streams.