VR-Forces 4.10 Class Documentation
 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 <tbb/recursive_mutex.h>
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 boost::enable_shared_from_this<DtFeaturesDebugger>
35  , public DtSubCommandManager
36  {
37  public:
38  typedef boost::shared_ptr<DtFeaturesDebugger> Ptr;
39 
42  DtFeaturesDebugger(const std::string& name, DtConsoleCommandManager* manager = 0);
43 
44  virtual ~DtFeaturesDebugger();
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 boost::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 tbb::recursive_mutex Mutex;
91  mutable Mutex mutex;
92 
93  boost::scoped_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  bool runCommand(DtString);
111 
113  DtString helpText(const DtString&) const;
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:101
#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.
Definition: featureSet.h:186
boost::shared_ptr< Record > Ptr
Definition: featuresDebugger.h:60
boost::scoped_ptr< DtFeatureSet > myFeatureSet
Definition: featuresDebugger.h:93
This is a class which maintains a list of string command names and the callback functions that are to...
Definition: consoleCommandManager.h:48
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
tbb::recursive_mutex Mutex
Definition: featuresDebugger.h:90
Features pagetable class.
Definition: featuresDebugger.h:31
CommandSequence::const_iterator CommandIterator
Definition: featuresDebugger.h:63
Mutex myMutex
Definition: featuresDebugger.h:122
A utility class for use with DtConsoleCommandManager.
Definition: consoleCommandManager.h:157
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:126
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
int myListIndex
Definition: featuresDebugger.h:96
boost::shared_ptr< DtFeaturesDebugger > Ptr
Definition: featuresDebugger.h:38

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)