VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
influenceEventDispatcher.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
8 #pragma once
11 #include <boost/signals2.hpp>
12 #include <unordered_map>
15 #include "vrfutil/rwUUID.h"
16 #include <tbb/spin_mutex.h>
17 
19 
20 namespace makVrfEvents
21 {
22  class DtEvent;
23 }
24 
26 {
27 public:
29  virtual ~DtInfluenceEventDispatcher();
30 
31  virtual bool init();
32 
33  virtual void registerForInfluenceEvents(const DtUUID& uuid, DtInfluenceEventFunction func, void* userData) override;
35  virtual void unregisterForInfluenceEvents(const DtUUID& uuid, DtInfluenceEventFunction func, void* userData) override;
36 
37  virtual void processInfluence(const makVrfEvents::DtEvent& m);
38 
39 protected:
41  boost::signals2::scoped_connection myInfluenceEventConnection;
42 
44  typedef DtBoost::shared_ptr<CallbackList > CallbackListPtr;
45  typedef std::unordered_map<DtUUID, CallbackListPtr> CallbackMap;
46 
48 
49  tbb::spin_mutex myMutex;
50 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
virtual void registerForInfluenceEvents(const DtUUID &uuid, DtInfluenceEventFunction func, void *userData)=0
Register to receive callbacks for influence events addressed to a specific UUID.
Contains the DtUUID class declaration.
Definition: influenceEventDispatcher.h:25
Contains the DtInfluenceDispatcherServiceInterface class declaration.
Definition: event.h:13
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
DtCallbackList< DtBoost::shared_ptr< const makVrfEvents::DtInfluenceEvent > > CallbackList
Definition: influenceEventDispatcher.h:43
Abstract interface class to the influence dispatcher service. This service provides DtInfluenceEvent ...
Definition: influenceDispatcherServiceInterface.h:25
Definition: noArgumentCallbackList.h:91
DtBoost::shared_ptr< CallbackList > CallbackListPtr
Definition: influenceEventDispatcher.h:44
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
CallbackMap myRegisteredCallbacks
Definition: influenceEventDispatcher.h:47
DtSimulationServices * mySimServices
Definition: influenceEventDispatcher.h:40
virtual void unregisterForInfluenceEvents(const DtUUID &uuid, DtInfluenceEventFunction func, void *userData)=0
Remove a callback registered with registerForInfluenceEvents()
std::unordered_map< DtUUID, CallbackListPtr > CallbackMap
Definition: influenceEventDispatcher.h:45
boost::signals2::scoped_connection myInfluenceEventConnection
Definition: influenceEventDispatcher.h:41
tbb::spin_mutex myMutex
Definition: influenceEventDispatcher.h:49

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)