VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scriptReactiveTaskControllerPSR.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
10 
14 #include <readerWriter/rwReal.h>
15 #include <readerWriter/rwString.h>
17 #include "vrfutil/railSegment.h"
18 #include "vrfutil/rwRailSegment.h"
19 #include "readerWriter/rwVector.h"
20 #include <set>
23 #include <readerWriter/rwReal.h>
24 #include <readerWriter/rwBoolean.h>
25 #include <readerWriter/rwInt.h>
27 #include "vrfutil/rwUserQuestion.h"
29 
31 {
32 protected:
33  typedef void (*DtScriptPSRScenarioSaveLoadFcn)(void*);
34 
35 public:
38  const DtString& rwName = DtString::nullString(),
39  DtReaderWriterRegistry* parentRegistry = 0);
40 
43  const DtString& rwName = DtString::nullString(),
44  DtReaderWriterRegistry* parentRegistry = 0);
45 
48 
51 
54  const DtString& rwName = DtString::nullString(),
55  DtReaderWriterRegistry* parentRegistry = 0) const;
56 
59  virtual DtString type() const;
60 
62  static DtVrfProcessStateRepository* creator (const DtString& rwName,
63  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry);
64 
65  virtual void putSelf(std::string& fp, int indentLevel, bool writeUnspecified, const DtFilename& path);
66  virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths, const DtVariableBindingsList& variableBindings);
67 
68  virtual void addTaskPriority(const DtSimTaskMessageType& scriptId, int priority);
71  virtual void removeTaskPriority(const DtSimTaskMessageType& scriptId);
72  virtual const std::map<int, std::list<DtSimTaskMessageType> >& priorityMap() const;
73  virtual void updateAllPriorities();
74 
79  virtual void addReactiveTaskEntry(const DtSimTaskMessageType& scriptId, DtRwScriptReactiveTaskEntry* entry, bool deleteOnUpdate = true);
80  virtual void removeReactiveTaskEntry(const DtSimTaskMessageType& scriptId, bool deleteEntry = true);
81  virtual DtRwScriptReactiveTaskEntry* findReactiveTaskEntry(const DtSimTaskMessageType& scriptId) const;
82  virtual const std::map<DtSimTaskMessageType, DtRwScriptReactiveTaskEntry*>& reactiveTaskEntryMap() const;
83 
84  virtual void addActionCategories(const std::set<DtString>& actionCategories);
85  virtual int currentReactionLevel(const std::set<DtString>& actionCategories) const;
86  virtual void updateReactionLevels(const std::set<DtString>& actionCategories);
87  virtual void updateAllReactionLevels();
88 
89  virtual void sweepMarkedForDeletion();
90 
92  virtual DtRwUserQuestionHandler& userQuestionHandler();
93  virtual const DtRwUserQuestionHandler& userQuestionHandler() const;
94 
95 protected:
96  bool doCategoriesOverlap(const std::set<DtString>& firstSet, const std::set<DtString>& secondSet, std::set<DtString>& overlap) const;
97 
98 protected:
100 
102  std::map<DtSimTaskMessageType, DtRwScriptReactiveTaskEntry*> myReactiveTaskEntryMap;
103  std::map<int, std::list<DtSimTaskMessageType> > myPriorityMap;
104  std::map<DtString, int> myCategoryReactionLevelMap;
105 
107 };
File: rwRailSegment.h.
Definition: readerWriterRegistry.h:39
std::map< int, std::list< DtSimTaskMessageType > > myPriorityMap
Definition: scriptReactiveTaskControllerPSR.h:103
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
DtRwTemplatedListPtr< DtRwScriptReactiveTaskEntry, false > myReactiveTasks
Definition: scriptReactiveTaskControllerPSR.h:99
virtual DtVrfProcessStateRepository * clone(const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) const =0
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
virtual void putSelf(std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
Top level call to write itself to file. If write unspecified is true, will write entries that are uns...
DtRwUserQuestionHandler myUserQuestionHandler
Definition: scriptReactiveTaskControllerPSR.h:106
Class DtVrfProcessStateRepository: Abstract base class for all process state repositories. Process state repositories represent (potentially) shared, savable information for one or more components functioning together to achieve some process or set of processes; such as aiming and firing a weapon; moving an object; or just waiting a specified amount of time.
Definition: vrfProcessStateRepository.h:45
std::map< DtSimTaskMessageType, DtRwScriptReactiveTaskEntry * > myReactiveTaskEntryMap
Fast access only, though state will be saved through members above these.
Definition: scriptReactiveTaskControllerPSR.h:102
virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
Top level to read itself from an input stream. searchPath is passed down to all DtReaderWriter member...
Definition: scriptReactiveTaskControllerPSR.h:30
Definition: rwScriptReactiveTaskEntry.h:21
Process Helper class to handle user questions.
Definition: rwUserQuestionHandler.h:17
virtual DtString type() const =0
Returns the string type of the repository, as defined in procSRTypes.h.
File: rwVector.h.
std::map< DtString, int > myCategoryReactionLevelMap
Definition: scriptReactiveTaskControllerPSR.h:104
const DtVrfProcessStateRepository & operator=(const DtVrfProcessStateRepository &orig)
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)