VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
webServerObject.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  ******************************************************************************/
5 
6 #pragma once
7 
8 #include <string>
9 #include <vector>
11 #include <vrfutil/simResource.h>
12 #include <tbb/spin_rw_mutex.h>
13 #include <vrfutil/tracyLocks.h>
15 
16 extern const char DtWebServerObjectMutexName[];
17 
25 {
26 public:
28  : makVrf::DtStateDataWrapper(stateData)
29  {
30  }
31 
32  virtual ~DtWebServerObject() override = default;
33 
34  // =========================================================================
35  // Capable tasks and sets
36  // =========================================================================
37 
39  const std::vector<std::string>& capableTasksAndSets() const { return myCapableTasksAndSets; }
40 
42  void setCapableTasksAndSets(std::vector<std::string> tasksAndSets)
43  {
44  myCapableTasksAndSets = std::move(tasksAndSets);
45  }
46 
47  // =========================================================================
48  // Current tasks
49  // =========================================================================
50 
53  {
55  return myCurrentTasks;
56  }
57 
60  {
62  myCurrentTasks = std::move(tasks);
63  }
64 
65  // =========================================================================
66  // Resources
67  // =========================================================================
68 
70  std::vector<DtSimResource> resources() const
71  {
73  return myResources;
74  }
75 
77  void setResources(std::vector<DtSimResource> resources)
78  {
80  myResources = std::move(resources);
81  }
82 
83 private:
84  std::vector<std::string> myCapableTasksAndSets;
86  std::vector<DtSimResource> myResources;
87  mutable tbb::spin_rw_mutex myDataMutex;
88 };
89 
90 using DtWebServerObjectPtr = std::shared_ptr<DtWebServerObject>;
std::vector< DtSimResource > resources() const
Returns the resource list last received for this object.
Definition: webServerObject.h:70
virtual ~DtWebServerObject() override=default
Template around a TBB RW Mutex lock which adds a tracy marker when the lock is waiting on the mutex...
Definition: tracyLocks.h:45
void setResources(std::vector< DtSimResource > resources)
Replaces the resource list.
Definition: webServerObject.h:77
std::vector< TaskInformation > EntityTaskInformation
Definition: currentTaskManager.h:48
void setCurrentTasks(DtCurrentTaskManager::EntityTaskInformation tasks)
Replaces the current task information.
Definition: webServerObject.h:59
tbb::spin_rw_mutex myDataMutex
Definition: webServerObject.h:87
std::vector< std::string > myCapableTasksAndSets
Definition: webServerObject.h:84
void setCapableTasksAndSets(std::vector< std::string > tasksAndSets)
Replaces the entire capable tasks and sets list.
Definition: webServerObject.h:42
DtWebServerObject(makVrf::DtStateData *stateData)
Definition: webServerObject.h:27
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
const DtStateData * stateData() const
Definition: stateDataWrapper.h:246
DtWebServerObject — thin extension of DtStateDataWrapper for objects tracked by the web server...
Definition: webServerObject.h:24
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: stateDataWrapper.h:49
DtCurrentTaskManager::EntityTaskInformation currentTasks() const
Returns the current task information last received for this object.
Definition: webServerObject.h:52
std::vector< DtSimResource > myResources
Definition: webServerObject.h:86
const std::vector< std::string > & capableTasksAndSets() const
Returns the list of capable task and set names for this object.
Definition: webServerObject.h:39
DtStateDataWrapper()
CTOR – Even though this takes a state data it will not keep a reference to that state data...
DtCurrentTaskManager::EntityTaskInformation myCurrentTasks
Definition: webServerObject.h:85
const char DtWebServerObjectMutexName[]
std::shared_ptr< DtWebServerObject > DtWebServerObjectPtr
Definition: webServerObject.h:90

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)