00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00046 #ifndef LUMIERA_CONFIGRULES_H
00047 #define LUMIERA_CONFIGRULES_H
00048
00049 #include "common/p.hpp"
00050 #include "common/query.hpp"
00051 #include "common/meta/generator.hpp"
00052 #include "common/singletonsubclass.hpp"
00053
00054
00055 #include "proc/mobject/session/track.hpp"
00056 #include "proc/asset/procpatt.hpp"
00057 #include "proc/asset/pipe.hpp"
00058 #include "proc/asset/track.hpp"
00059
00060 #include <string>
00061
00062
00063
00064 namespace lumiera
00065 {
00066 using std::string;
00067 using lumiera::P;
00068
00069
00070
00071
00072 namespace query
00073 {
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 class Resolver
00090 {
00091
00092 };
00093
00094
00095 template
00096 < const Symbol SYM,
00097 typename SIG = bool(string)
00098 >
00099 class Pred
00100 {
00101
00102 };
00103
00117 template<class TY>
00118 class TypeHandler
00119 {
00120 static const TY NIL;
00121
00122 template<Symbol SYM, typename SIG>
00123 TY find (Pred<SYM,SIG> capability);
00124
00125 template<Symbol SYM, typename SIG>
00126 TY make (Pred<SYM,SIG> capability, TY& refObj =NIL);
00127 };
00128
00138 template<class TY>
00139 class QueryHandler
00140 {
00141 protected:
00142 virtual ~QueryHandler() { }
00143 public:
00151 virtual bool resolve (P<TY>& solution, const Query<TY>& q) = 0;
00152 };
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00175 template<typename TYPES>
00176 class ConfigRules
00177 : public typelist::InstantiateForEach<TYPES, QueryHandler>
00178 {
00179 protected:
00180 ConfigRules () {}
00181 virtual ~ConfigRules() {}
00182
00183 public:
00184
00185 };
00186
00187
00188
00189
00190 LUMIERA_ERROR_DECLARE (CAPABILITY_QUERY);
00191
00192 }
00193
00194
00195
00196
00197
00198
00199
00204 typedef lumiera::typelist::Types < mobject::session::Track
00205 , asset::Track
00206 , asset::Pipe
00207 , const asset::ProcPatt
00208 > ::List
00209 InterfaceTypes;
00210
00215 class ConfigRules
00216 : public query::ConfigRules<InterfaceTypes>
00217 {
00218
00219 public:
00220 static SingletonSub<ConfigRules> instance;
00221
00222 };
00223
00224
00225
00226
00227 namespace query
00228 {
00229
00234 void setFakeBypass(string const& q);
00235 bool isFakeBypass (string const& q);
00236
00237 }
00238
00239 }
00240 #endif