VR-Forces 4.7 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>
31  class DtPagingFeatureSet;
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 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)