00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef CONTROL_STYPEMANAGER_H
00025 #define CONTROL_STYPEMANAGER_H
00026
00027
00028 #include "lib/streamtype.hpp"
00029 #include "lib/singleton.hpp"
00030
00031 #include <boost/scoped_ptr.hpp>
00032
00033
00034 namespace control {
00035
00036 using lumiera::Symbol;
00037 using lumiera::StreamType;
00038
00039
00040 class STypeManager
00041 {
00042
00043 class Registry;
00044 boost::scoped_ptr<Registry> reg_;
00045
00046 public:
00047 static lumiera::Singleton<STypeManager> instance;
00048
00049 typedef StreamType::ImplFacade ImplFacade;
00050
00051
00054 StreamType const& getType (Symbol sTypeID) ;
00055
00057 StreamType const& getType (StreamType::Prototype const& protoType) ;
00058
00060 StreamType const& getType (StreamType::ImplFacade const& implType) ;
00061
00065 ImplFacade const& getImpl (Symbol libID, StreamType::Prototype const& protoType) ;
00066
00070 template<class TY>
00071 ImplFacade const& getImpl (Symbol libID, TY& rawType) ;
00072
00073
00074
00076 protected:
00077 STypeManager() ;
00078 ~STypeManager();
00079
00080 friend class lumiera::singleton::StaticCreate<STypeManager>;
00081
00087 void reset() ;
00088
00089 private:
00090 ImplFacade const& fetchImpl (StreamType::ImplFacade::TypeTag);
00091 };
00092
00093 extern Symbol ON_STREAMTYPES_RESET;
00094
00095
00096 template<class TY>
00097 StreamType::ImplFacade const&
00098 STypeManager::getImpl (Symbol libID, TY& rawType)
00099 {
00100 return fetchImpl (ImplFacade::TypeTag (libID,rawType));
00101 }
00102
00103
00104 }
00105
00106
00107 namespace proc_interface {
00108
00109 using control::STypeManager;
00110
00111
00112 }
00113
00114
00115 extern "C" {
00116
00122 void
00123 lumiera_StreamType_registerInitFunction (void setupFun(void));
00124
00125
00126 }
00127
00128
00129 #endif