VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
featuresDebugger.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <features/featureSet.h>
14 
16 
17 #include <tbb/queuing_rw_mutex.h>
18 #include <mutex>
19 
20 #include <boost/ptr_container/ptr_map.hpp>
21 
22 #include <ostream>
23 
27 
28 namespace MAKVRinTerra
29 {
30  template <typename FS>
32 
34  : public std::enable_shared_from_this<DtFeaturesDebugger>
35  , public DtSubCommandManager
36  {
37  public:
38  typedef std::shared_ptr<DtFeaturesDebugger> Ptr;
39 
42  DtFeaturesDebugger(const std::string& name, DtConsoleCommandManager* manager = 0);
43 
44  virtual ~DtFeaturesDebugger() override;
45 
47 
48  DtFeaturesDebugger& operator[](const std::string& key);
49  const DtFeaturesDebugger& operator[](const std::string& key) const;
51 
52  virtual bool executeCommands(const std::string&);
53 
56  {
57  public:
58  friend class DtFeaturesDebugger;
59 
60  typedef std::shared_ptr<Record> Ptr;
61 
62  typedef std::vector<std::string> CommandSequence;
63  typedef CommandSequence::const_iterator CommandIterator;
64 
66  explicit Record(DtFeatureSet*, bool enable=true);
67 
68  virtual ~Record();
69 
70  virtual const DtFeatureSet& featureSet() const;
71  virtual std::string name() const;
72 
73  virtual CommandIterator executeCommand(
74  CommandIterator, CommandIterator, std::ostream&);
75  virtual bool executeCommand(const std::string&, std::ostream&);
76 
77  virtual void executeListCommand(std::ostream&);
78 
79  virtual CommandIterator executeInfoCommand(
80  CommandIterator, CommandIterator, std::ostream&);
81  virtual void executeInfoCommand(std::ostream&);
82  virtual bool executeInfoCommand(const std::string&, std::ostream&);
83 
84  virtual void clear();
85 
86  Record& command(const std::string&);
87  Record& command(const std::string&, std::ostream&);
88 
89  protected:
90  typedef std::recursive_mutex Mutex;
91  mutable Mutex mutex;
92 
93  std::unique_ptr<DtFeatureSet> myFeatureSet;
94 
95  private:
97  };
98 
99  virtual Record::Ptr add(Record*);
100 
103  template <typename F>
104  Record& add(DtFeatureSetTemplate<F>* fs, bool enable = true)
105  {
106  return *add(new Record(DtFeatureSet::Wrap(fs), enable));
107  }
108 
110  virtual bool runCommand(DtString) override;
111 
113  virtual DtString helpText(const DtString&) const override;
114 
115  protected:
116  typedef std::vector<Record::Ptr> RecordVector;
117 
118  virtual RecordVector getMatchingRecords(
120 
121  typedef tbb::queuing_rw_mutex Mutex;
122  mutable Mutex myMutex;
123 
126 
127  typedef std::map<std::string, Ptr> SubDebuggers;
129  };
130 }
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:105
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
std::map< std::string, Ptr > SubDebuggers
Definition: featuresDebugger.h:127
static FeatureSet * Wrap(FS *fs)
Wrap a compatible feature set type in the interface of this feature set type. The Wrap functions are ...
Definition: featureSet.h:193
This is a class which maintains a list of string command names and the callback functions that are to...
Definition: consoleCommandManager.h:56
RecordVector myFeatureSets
Definition: featuresDebugger.h:124
Entry for a feature set in the debugger.
Definition: featuresDebugger.h:55
std::vector< std::string > CommandSequence
Definition: featuresDebugger.h:62
DtConsoleCommandOwner myCommandOwner
Definition: featuresDebugger.h:125
SubDebuggers mySubDebuggers
Definition: featuresDebugger.h:128
tbb::queuing_rw_mutex Mutex
Definition: featuresDebugger.h:121
Features pagetable class. This class is just the shell around a set of related classes. The general idea is a hierarchy of subsets/tiles from an arbitrary 2D coordsys. It uses weak pointers to manage its contained feature sets while returning feature sets which have shared pointers. This way feature sets will automatically be destroyed when users are done with them. The unused tile tracker can provide an owner for these feature sets and pages them out according to it&#39;s own policy.
Definition: featuresDebugger.h:31
CommandSequence::const_iterator CommandIterator
Definition: featuresDebugger.h:63
std::unique_ptr< DtFeatureSet > myFeatureSet
Definition: featuresDebugger.h:93
Mutex myMutex
Definition: featuresDebugger.h:122
A utility class for use with DtConsoleCommandManager. This class takes ownership of an arbitrary numb...
Definition: consoleCommandManager.h:168
std::recursive_mutex Mutex
Definition: featuresDebugger.h:90
std::shared_ptr< Record > Ptr
Definition: featuresDebugger.h:60
std::vector< Record::Ptr > RecordVector
Definition: featuresDebugger.h:116
A specialized version of DtConsoleCommandManager which handles a set of sub commands from another con...
Definition: consoleCommandManager.h:135
Definition: featuresDebugger.h:33
Mutex mutex
Definition: featuresDebugger.h:91
Record & add(DtFeatureSetTemplate< F > *fs, bool enable=true)
Add a feature set to be debugged.
Definition: featuresDebugger.h:104
std::shared_ptr< DtFeaturesDebugger > Ptr
Definition: featuresDebugger.h:38
int myListIndex
Definition: featuresDebugger.h:96

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)