Wiselib
wiselib.testing/external_interface/pc/pc_facet_provider.h
Go to the documentation of this file.
00001 // vim: set noexpandtab ts=4 sw=4:
00002 
00003 #ifndef PC_FACET_PROVIDER_H
00004 #define PC_FACET_PROVIDER_H
00005 
00006 #include "external_interface/facet_provider.h"
00007 #include "external_interface/pc/pc_os.h"
00008 #include "external_interface/pc/pc_os_model.h"
00009 
00010 namespace wiselib {
00011    template<typename Facet_P>
00012    class FacetProvider<PCOsModel, Facet_P> {
00013       public:
00014          typedef PCOsModel OsModel;
00015          typedef Facet_P Facet;
00016          
00017          static Facet& get_facet(typename OsModel::Os& os) {
00018             if(!facet_) {
00019                facet_ = new Facet(os);
00020             }
00021             return *facet_;
00022          }
00023          
00024       private:
00025          static Facet *facet_;
00026    };
00027    
00028    template<typename Facet_P>
00029    typename FacetProvider<PCOsModel, Facet_P>::Facet* FacetProvider<PCOsModel, Facet_P>::facet_ = 0;
00030 }
00031 
00032 #endif // PC_FACET_PROVIDER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines