OMKVisServiceExtension.cpp

Go to the documentation of this file.
00001 #include "OMKVisServiceExtension.h"
00002 #include "OMKEventListenerCallBack.h"
00003 #include "OMKExtensibleSimulatedObject.h"
00004 //-------------------------------------------------------------------------
00005 using namespace OMK ;
00006 using namespace OMK::Vis ;
00007 using namespace OMK::Type ;
00008 
00009 const EventIdentifier VisServiceExtension::VISU_INFO_EVENT_ID( "VISU_INFO_EVENT_ID" );
00010 
00011 //-------------------------------------------------------------------------
00012 REGISTER_EXTENSION_FACTORY( VisServiceExtension, "VisServiceExtension" ) ;
00013 
00014 //-------------------------------------------------------------------------
00015 VisServiceExtension::VisServiceExtension( ExtensibleSimulatedObject* owner, const Name& id, bool registerExtension )
00016 : OMK::ExtensionT< ExtensibleSimulatedObject >( owner, id, registerExtension )
00017 {
00018 
00019  _eventVisuInfo = new EventListenerCallBack< VisServiceExtension >( *_owner,this,
00020       (EventListenerCallBack< VisServiceExtension>::CallBackFct)
00021              &VisServiceExtension::handleVisuInfoEvent, VISU_INFO_EVENT_ID ) ;
00022   
00023  _owner->registerForSignal( VISU_INFO_EVENT_ID ) ;
00024 }
00025 
00026 //-------------------------------------------------------------------------
00027 VisServiceExtension::~VisServiceExtension()
00028 {
00029   _owner->cancelRegistrationForSignal( VISU_INFO_EVENT_ID ) ;
00030   delete _eventVisuInfo;
00031 }
00032 
00033 //-------------------------------------------------------------------------
00034 bool VisServiceExtension::handleVisuInfoEvent( Event* event )
00035 {
00036   // Send NAME + Process
00037   _owner->sendValuedEvent( event->sender, VISU_INFO_EVENT_ID,
00038        VisuInfoType( VisuInfoPrm( _owner->getName(), 
00039                                   _owner->getObjectDescriptor().getProcess() ) ) );
00040  
00041   return true;
00042 }
00043 
00044 //-------------------------------------------------------------------------

logo OpenMask

Documentation generated on Mon Jun 9 11:45:57 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007