VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
hazardAreaManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 #pragma once
9 
11 #include "vrfobjcore/simObject.h"
14 #include <tbb/mutex.h>
15 
17 class DtSimMessage;
18 
23 {
24 public:
27 
29  virtual ~DtHazardAreaManager();
30 
32  virtual bool loadHazardAreaInformationFile(const DtFilename& filename, bool clear);
33 
34 private:
37 
39  DtHazardAreaManager & operator=(const DtHazardAreaManager & orig);
40 
41 public:
43  virtual void addHazardAreaType(const DtEntityType&);
44 
47  virtual void removeHazardAreaType(const DtEntityType&);
48 
50  virtual std::vector<DtSimObjectReference> hazardAreas(const DtEntityType&) const;
51 
52  virtual const std::vector<DtEntityType>& hazardAreaTypes() const;
53 
55  virtual const std::map<unsigned long long, DtSimObjectReference>& hazardAreas() const;
56 
58  virtual const DtRwHazardAreaInformation& hazardAreaInformation() const;
59 
60 protected:
61  static void requestHazardAreaInformationCallback(DtSimMessage* msg, void* usr);
62  virtual void processHazardAreaInformation(DtSimMessage* msg);
63 
65  virtual void processHazardAreaAdded(DtSimObjectReference);
66 
68  virtual void processHazardAreaDeleted(const DtSimObject*);
69 
70 protected:
73  std::vector<DtEntityType> myHazardAreaTypes;
74  std::map<unsigned long long, DtSimObjectReference> myHazardAreas;
75 
76  boost::signals2::scoped_connection mySimObjectAddedConnection;
77  tbb::spin_mutex myRemovalMutex;
78 };
const DtSimulationServices * mySimulationServices
Definition: hazardAreaManager.h:71
DtRwHazardAreaInformation myHazardAreaInformation
Definition: hazardAreaManager.h:72
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
Definition: rwHazardAreaInformation.h:122
The DtHazardAreaManager will keep track of all hazard area objects and their state. Hazard areas are predefined as part of this class. Call the add/remove methods to add or remove areas to watch.
Definition: hazardAreaManager.h:22
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
File: simMsg.h.
Definition: simMessage.h:35
std::map< unsigned long long, DtSimObjectReference > myHazardAreas
Definition: hazardAreaManager.h:74
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:94
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:88
tbb::spin_mutex myRemovalMutex
Definition: hazardAreaManager.h:77
boost::signals2::scoped_connection mySimObjectAddedConnection
Definition: hazardAreaManager.h:76
std::vector< DtEntityType > myHazardAreaTypes
Definition: hazardAreaManager.h:73

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)