VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
debugDrawerNameManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 
12 #include "vlutil/vlString.h"
13 #include "vlutil/vlShmPool.h"
14 #include <vector>
15 #include <string>
16 
17 #include <boost/interprocess/sync/scoped_lock.hpp>
18 #include <boost/interprocess/sync/named_mutex.hpp>
19 
21 {
22 public:
23  typedef boost::interprocess::named_mutex mutex;
24  typedef boost::interprocess::scoped_lock<mutex> scoped_lock;
25 
26  static const size_t NumberOfNames = 200;
27  static const size_t MaxTagLength = 200;
28 
30  {
31  DtDebugDrawerSharedMemoryNoType = 0,
32  DtDebugDrawerSharedMemoryFeaturesType = 1,
33  DtDebugDrawerSharedMemoryVRFType = 2,
34  DtDebugDrawerSharedMemoryFeaturesSourceType = 4
35  };
36 
37  class ScopedLock
38  {
39  public:
41  : lock(*manager.myMutex)
42  {
43  }
44 
45  private:
47  };
48 
49  friend class ScopedLock;
50 
51  static void SetEnabled(bool);
52  static bool isEnabled();
53 
55  virtual ~DtDebugDrawerNameManager();
56  virtual void init();
57  virtual long addAndCreateNewName(MemoryType type);
58  virtual long addAndCreateNewName(MemoryType type, std::string tag);
59  virtual bool activate(long name, bool state = true);
60  virtual void removeName(long name);
61 
62  struct Slot
63  {
64  Slot(long name, std::string tag)
65  : name(name), tag(tag) { }
66 
67  long name;
68  std::string tag;
69  };
70 
71  virtual std::vector<Slot> getMemoryBlockNamesByType(MemoryType memoryType);
72 
73  virtual DtString blockDescription();
74 
75 protected:
76  struct DtMemoryHeader;
77 
78  std::auto_ptr<mutex> myMutex;
79 
81  char* myMemoryPtr;
83  DtMemoryHeader* myHeader;
85  DtSharedMemoryPoolManager* myManager;
86 };
87 

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)