00001 00002 /************************************************************************/ 00003 /* This file is part of openMask(c) INRIA, CNRS, Universite de Rennes 1 */ 00004 /* 1993-2007, 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 OMK_EXTENSIBLETIVESIMULATEDOBJECT_H 00024 #define OMK_EXTENSIBLETIVESIMULATEDOBJECT_H 00025 00026 #include "OMKSimulatedObject.h" 00027 #include "OMKExtensionManager.h" 00028 00029 namespace OMK 00030 { 00031 // Predefined classes 00032 class IAttribute ; 00033 template< class CallerClass, class PrmType > class ValuedEventListenerCallBack ; 00034 template< typename Type > class IAttributeBaseT ; 00035 00036 namespace EventId 00037 { 00041 extern EventIdentifier OMK_API CREATE_AND_ADD_EXTENSION ; 00042 } 00043 00071 class OMK_API ExtensibleSimulatedObject 00072 : public SimulatedObject, public ExtensionManager 00073 { 00075 00076 protected: 00078 ExtensibleSimulatedObject( Controller& ctrl, const ObjectDescriptor& objectDescriptor ) ; 00079 public: 00082 virtual ~ExtensibleSimulatedObject() ; 00088 virtual void postConstruction() ; 00091 virtual void finish() ; 00093 00096 00097 protected: 00104 virtual void init() ; 00111 virtual bool loadParameters( const ConfigurationParameterDescriptor * node ) ; 00113 00116 00117 protected: 00142 virtual void compute() ; 00147 virtual void computeInputs() ; 00152 virtual void computeParameters() ; 00157 virtual void computeOutputs() ; 00159 00162 00163 00164 void activateCreateExtensionByEvent( bool activate = true ) ; 00165 protected: 00166 friend class ExtensionOfExtensionCreatorEvent ; 00167 typedef ValuedEventListenerCallBack< ExtensibleSimulatedObject, CreateAndAddExtensionType > CreateAndAddExtensionEventListener ; 00169 EventListener* _eventCreateAndAddExtensionListener ; 00175 bool processCreateAndAddExtension( CreateAndAddExtensionEvent * event ) ; 00176 00177 public: 00179 00182 00183 public: 00187 IAttribute* getAttribute( const Name& id ) ; 00193 template< typename Type > 00194 IAttributeBaseT< Type >* getBaseAttribute( const Name& id ) ; 00201 void addAttribute( IAttribute& attribute, bool createOutput = false ) ; 00209 void removeAttribute( const Name& id ) ; 00210 protected: 00212 typedef std::map< Name, IAttribute* > AttributeStore ; 00215 AttributeStore _attributes ; 00217 protected: 00220 bool _exitOnInitError ; 00221 } ; 00222 00223 }// namespace OMK 00224 00225 #include "OMKExtensibleSimulatedObject.inl" 00226 00227 #endif // defined OMK_EXTENSIBLETIVESIMULATEDOBJECT_H
Documentation generated on Mon Jun 9 11:45:56 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |