00001 00002 /************************************************************************/ 00003 /* This file is part of openMask(c) INRIA, CNRS, Universite de Rennes 1 */ 00004 /* 1993-2002, thereinafter the Software */ 00005 /* */ 00006 /* The Software has been developped within the Siames Project. */ 00007 /* INRIA, the University of Rennes 1 and CNRS jointly hold intellectual */ 00008 /* property rights */ 00009 /* */ 00010 /* The Software has been registered with the Agence pour la Protection */ 00011 /* des Programmes (APP) under registration number */ 00012 /* IDDN.FR.001.510008.00.S.P.2001.000.41200 */ 00013 /* */ 00014 /* This file may be distributed under the terms of the Q Public License */ 00015 /* version 1.0 as defined by Trolltech AS of Norway and appearing in */ 00016 /* the file LICENSE.QPL included in the packaging of this file. */ 00017 /* */ 00018 /* Licensees holding valid specific licenses issued by INRIA, CNRS or */ 00019 /* Universite Rennes 1 for the software may use this file in */ 00020 /* acordance with that specific license */ 00021 /************************************************************************/ 00022 00023 #if !defined _INTERACTOROUTPUTS_H_ 00024 #define _INTERACTOROUTPUTS_H_ 00025 00026 #include <string> 00027 #include "OMKName.h" 00028 #include "OMKInteraction.h" 00029 #include "OMKControlTakeOverPrm.h" 00030 #include "OMKTracer.h" 00031 #include "OBTPrototypeFactory.h" 00032 00033 namespace OMK 00034 { 00035 class ConfigurationParameterDescriptor ; 00036 class ExtensibleSimulatedObject ; 00037 template< typename Type > class IAttributeBaseT ; 00038 00039 namespace Iii 00040 { 00041 //----------------------------------------------------------------- 00042 // Predefined classes 00043 class InteractorExtension ; 00044 00045 //============================================================================= 00059 class OMKIII_API InteractorOutput 00060 { 00061 protected: 00062 InteractorOutput( const Name& id, InteractorExtension *interactor, const Name& category, const Name& type ) ; 00063 public: 00064 virtual ~InteractorOutput() {} 00067 virtual const Name& id() const { return _id ; } 00070 const Name& category() const { return _category ; } 00073 const Name& type() const { return _type ; } 00076 const OMK::Type::AccessGroupLevel& getAccessGroup() const { return _accessGroup ; } 00081 void setAccessGroup( const OMK::Type::AccessGroupLevel& accessGroup ) ; 00093 static bool create( const Name& id, 00094 InteractorExtension *interactor, 00095 const ConfigurationParameterDescriptor * node ) ; 00107 static void create( const Name& id, 00108 const Name& attributeId, 00109 InteractorExtension *interactor, 00110 const Name& category, 00111 const OMK::Type::AccessGroupLevel& accessGroup, 00112 bool setByEvent ) ; 00113 protected: 00115 00116 00117 Name _id ; 00123 Name _category ; 00127 Name _type ; 00129 OMK::Type::AccessGroupLevel _accessGroup ; 00131 InteractorExtension* _interactor ; 00133 } ; 00134 00135 //============================================================================= 00143 class OMKIII_API InteractorOutputCreator 00144 { 00145 public: 00146 virtual ~InteractorOutputCreator() {} 00147 virtual InteractorOutput* operator()( const Name& id, const Name& attributeId, 00148 InteractorExtension *interactor, 00149 const Name& category, 00150 bool setByEvent ) const 00151 { 00152 OMERROR( "Creator is not registered for \"" << id.getString() << "\"" ) ; 00153 throw Exception( "Creator is not registered" ) ; 00154 return 0 ; 00155 } 00156 } ; 00157 00158 //----------------------------------------------------------------------------- 00164 template <class T> 00165 class InteractorOutputCreatorT : public InteractorOutputCreator 00166 { 00167 public: 00168 virtual InteractorOutput* operator()( const Name& id, const Name& attributeId, 00169 InteractorExtension *interactor, 00170 const Name& category, 00171 bool setByEvent ) const 00172 { 00173 return new T( id, attributeId, interactor, category, setByEvent ) ; 00174 } 00175 } ; 00176 00177 00178 //============================================================================= 00179 }// namespace Iii 00180 00183 typedef OBT::Singleton< OBT::PrototypeFactory< std::pair< std::string, std::string >, Iii::InteractorOutputCreator > > InteractorOutputFactory ; 00184 00185 //============================================================================= 00186 }// namespace OMK 00187 template class OMKIII_API OBT::PrototypeFactory< std::pair< std::string, std::string >, OMK::Iii::InteractorOutputCreator > ; 00188 template class OMKIII_API OBT::Singleton< OBT::PrototypeFactory< std::pair< std::string, std::string >, OMK::Iii::InteractorOutputCreator > > ; 00189 00190 #endif // defined _INTERACTOROUTPUTS_H_
Documentation generated on Mon Jun 9 11:45:56 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |