Lumiera  0.pre.03
»edit your freedom«
abstractmo.hpp
Go to the documentation of this file.
1 /*
2  ABSTRACTMO.hpp - abstract base class for all Media Objects
3 
4  Copyright (C)
5  2008, 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 
14 
20 #ifndef MOBJECT_SESSION_ABSTRACTMO_H
21 #define MOBJECT_SESSION_ABSTRACTMO_H
22 
24 #include "lib/symbol.hpp"
25 
26 
27 
28 namespace steam {
29 namespace mobject {
30 namespace session {
31 
32  namespace error = lumiera::error;
33 
34 
39  class AbstractMO
40  : public MObject
41  {
42 
43 
44  /* === some default implementations === */
45 
46  DEFINE_PROCESSABLE_BY (builder::BuilderTool);
47 
48  string
49  initShortID() const
50  {
51  return buildShortID("MObject");
52  }
53 
54  public:
55 
56  Duration&
57  getLength()
58  {
59  return length_;
60  }
61 
62  bool operator== (const MObject& oo) const;
63 
64  protected:
65  void
66  throwIfInvalid() const
67  {
68  if (!isValid())
69  throw error::Fatal ("Invalid MObject in model. Indicates a race "
70  "or similarly broken internal assumptions.");
71  }
72 
73  string buildShortID (lib::Literal typeID, string suffix ="") const;
74  };
75 
76 
77 
78 }}} // namespace steam::mobject::session
79 #endif
inline string literal This is a marker type to indicate that
Definition: symbol.hpp:76
bool operator==(const MObject &oo) const
default/fallback implementation of equality using literal object identity (same address).
Definition: abstractmo.cpp:36
Base class of all BuilderTools, used according to the visitor pattern: each Tool contains the concret...
Definition: buildertool.hpp:97
Core abstraction of the Session model: a media object.
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
MObject is the interface class for all "Media Objects".
Definition: mobject.hpp:70
Derived specific exceptions within Lumiera&#39;s exception hierarchy.
Definition: error.hpp:190
Marker types to indicate a literal string and a Symbol.
abstract base class of all MObjects for providing common services.
Definition: abstractmo.hpp:39
Duration is the internal Lumiera time metric.
Definition: timevalue.hpp:468
virtual bool isValid() const =0
MObject self-test (usable for asserting)