Lumiera  0.pre.03
»edit your freedom«
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 
63 namespace steam {
64 namespace mobject {
65 
66  LUMIERA_ERROR_DECLARE (INVALID_MODEL_PORT);
67  LUMIERA_ERROR_DECLARE (UNCONNECTED_MODEL_PORT);
68 
69 
70  using asset::ID;
71 
72 
95  class ModelPort
96  {
97  ID<asset::Pipe> id_;
98 
99  public:
100  ModelPort()
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;
112  ID<asset::Struct> holder() const;
113  StreamType::ID streamType() 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
LUMIERA_ERROR_DECLARE(BUILDER_LIFECYCLE)
Builder activated while in non operational state.
A "processing pipe" represented as Asset.
Framework for classification of media streams.
static bool exists(ID< asset::Pipe >)
check if the global model port registration contains a mapping for the given pipe-ID ...
Steam-Layer implementation namespace root.
ID< asset::Pipe > pipe() const
access the Pipe (ID) of the global model port registered with the ID underlying this model port...
Handle designating a point within the model, where actually output data can be pulled.
Definition: model-port.hpp:95
size_t HashVal
a STL compatible hash value
Definition: hash-value.h:52
ID< asset::Struct > holder() const
access the timeline (or similar structural element) holding a global pipe which corresponds to this m...
StreamType::ID streamType() const
convenience shortcut to access the stream type associated with the pipe-ID corresponding to this mode...
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition: asset.hpp:99