Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
struct.hpp
Go to the documentation of this file.
1/*
2 STRUCT.hpp - key abstraction: structural asset
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
52#ifndef ASSET_STRUCT_H
53#define ASSET_STRUCT_H
54
55#include "lib/symbol.hpp"
56#include "steam/asset.hpp"
57#include "common/query.hpp"
58#include "lib/nocopy.hpp"
59
60#include <memory>
61#include <string>
62
63
64
65namespace steam {
66namespace asset {
67
68 using std::string;
69 using std::unique_ptr;
70 using lumiera::Query;
71 using lib::Symbol;
72
73 class Struct;
74 class StructFactory;
75 class StructFactoryImpl;
76 class Pipe;
77
78
79 template<>
80 class ID<Struct> : public ID<Asset>
81 {
82 public:
83 ID (HashVal id);
84 ID (const Struct&);
85 };
86
87
88
104 class Struct : public Asset
105 {
106 public:
108
109 virtual const ID<Struct>&
110 getID() const
111 {
112 return static_cast<const ID<Struct>& > (Asset::getID());
113 }
114
115
116
117 protected:
118 Struct (const Asset::Ident& idi) : Asset(idi) {}
119 };
120
121
122 // definition of ID<Struct> ctors is possible now,
123 // after providing full definition of class Struct
124
125 inline ID<Struct>::ID(HashVal id) : ID<Asset> (id) {};
126 inline ID<Struct>::ID(const Struct& stru) : ID<Asset> (stru.getID()) {};
127
128
129
130
131
132
138 {
139 unique_ptr<StructFactoryImpl> impl_;
140
141 protected:
142 StructFactory ();
143 friend class Struct;
144
145
146 public:
147 template<class STRU>
149
150// lib::P<Timeline> operator() (MORef<Binding>); ///////////TODO doesn't this create circular includes?? Any better idea how to refer to an existing binding?
151
152 template<class STRU>
153 lib::P<STRU> newInstance (Symbol nameID ="");
154
155 template<class STRU>
156 lib::P<STRU> made4fake (Query<STRU> const& query);
157
158 lib::P<Pipe> newPipe (string pipeID, string streamID);
159 };
160
161
162
163}} // namespace steam::asset
164#endif
Steam-Layer Interface: Assets.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition p.hpp:77
Token or Atom with distinct identity.
Definition symbol.hpp:120
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
Definition query.hpp:254
Superinterface describing especially bookkeeping properties.
Definition asset.hpp:139
virtual const ID< Asset > & getID() const
Definition asset.hpp:199
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Definition asset.hpp:98
ID(HashVal id)
Definition asset.hpp:101
Factory specialised for creating Structural Asset objects.
Definition struct.hpp:138
lib::P< STRU > operator()(Query< STRU > const &query)
Retrieve a suitable Structural Asset instance, possibly create one.
Definition struct.cpp:112
StructFactory()
using private implementation detail class
Definition struct.cpp:67
lib::P< STRU > made4fake(Query< STRU > const &query)
special backdoor for fake-configrules.hpp This allows to simulate creation of objects triggered by ru...
Definition struct.cpp:140
unique_ptr< StructFactoryImpl > impl_
Definition struct.hpp:139
lib::P< STRU > newInstance(Symbol nameID="")
invoke the factory to create new Structural Asset.
Definition struct.cpp:85
lib::P< Pipe > newPipe(string pipeID, string streamID)
Factory method for creating Pipes explicitly.
Definition struct.cpp:158
key abstraction: structural asset Created automatically as a sideeffect of building the structure of ...
Definition struct.hpp:105
Struct(const Asset::Ident &idi)
Definition struct.hpp:118
virtual const ID< Struct > & getID() const
<
Definition struct.hpp:110
static StructFactory retrieve
storage for the static StructFactory instance
Definition struct.hpp:107
Any copy and copy construction prohibited.
Definition nocopy.hpp:38
The asset subsystem of the Steam-Layer.
Steam-Layer implementation namespace root.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Basic and generic representation of an internal query.
a POD comprised of all the information sufficiently identifying any given Asset.
Definition asset.hpp:147
Marker types to indicate a literal string and a Symbol.