Lumiera  0.pre.03
»edit your freedom«
timeline.cpp
Go to the documentation of this file.
1 /*
2  Timeline - independent top-level element of the Session
3 
4  Copyright (C) Lumiera.org
5  2009, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
29 #include "steam/asset/timeline.hpp"
31 #include "steam/assetmanager.hpp"
32 
33 
34 namespace steam {
35 namespace asset {
36 
37  using lib::AutoRegistered;
38 
39 
40 
42  Timeline::Timeline (const Asset::Ident& idi, RBinding const& sequenceBinding)
43  : Struct (idi)
44  , boundSequence_(sequenceBinding)
45  {
46  REQUIRE (boundSequence_);
47  }
48 
49 
50  PTimeline
51  Timeline::create (Asset::Ident const& idi, RBinding const& sequenceBinding)
52  {
53  REQUIRE (getRegistry, "can't create a Timeline prior to session initialisation");
54 
55  PTimeline newElement (AssetManager::instance().wrap (*new Timeline(idi, sequenceBinding)));
56  getRegistry().append (newElement);
57 
58  ENSURE (newElement);
59  ENSURE (getRegistry().isRegistered (*newElement));
60  return newElement;
61  }
62 
63 
64  void
66  {
68  boundSequence_.purge();
70  }
71 
72 
73 
74 
75 }} // namespace asset
virtual void unlink()
release all links to other Asset objects held internally.
Definition: asset.cpp:173
virtual void unlink()
release all links to other Asset objects held internally.
Definition: timeline.cpp:65
Steam-Layer Interface: Asset Lookup and Organisation.
An active (smart-ptr like) external reference to a specifically placed MObject "instance" within the ...
Definition: mobject-ref.hpp:94
void purge()
detach this object instance from model, including all child elements.
Steam-Layer implementation namespace root.
static lib::Depend< AssetManager > instance
get at the system-wide asset manager instance.
Helper mixin template for implementing a type intended to participate in automatic element tracking...
static PTarget create()
factory for creating smart-ptr managed TAR instances, automatically registered with the element-track...
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:158
MObject in session to represent the top-level binding of a sequence.
void detach()
detach this element from the element-tracking registry.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:80
key abstraction: structural asset Created automatically as a sideeffect of building the structure of ...
Definition: struct.hpp:113
Timeline(Ident const &, RBinding const &)
Definition: timeline.cpp:42
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
static RegistryLink getRegistry
storage for the functor to link an AutoRegistered entity to the corresponding registration service ...
Top level structural element within the session.