VR-Forces 4.2 Class Documentation
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 
18 {
19 public:
20  static const size_t NumberOfNames = 200;
21  static const size_t MaxTagLength = 200;
22 
24  {
25  DtDebugDrawerSharedMemoryNoType = 0,
26  DtDebugDrawerSharedMemoryFeaturesType = 1,
27  DtDebugDrawerSharedMemoryVRFType = 2,
28  DtDebugDrawerSharedMemoryBHaveType = 3
29  };
30 
31  class ScopedLock
32  {
33  public:
34  ScopedLock(DtDebugDrawerNameManager& manager) : myManager(manager)
35  {
36  myManager.lockAccess();
37  }
38 
40  {
41  myManager.unlockAccess();
42  }
43 
44  private:
46  };
47 
48  friend class ScopedLock;
49 
51  virtual ~DtDebugDrawerNameManager();
52  virtual void init();
53  virtual long addAndCreateNewName(MemoryType type);
54  virtual long addAndCreateNewName(MemoryType type, std::string tag);
55  virtual void removeName(long name);
56 
57  struct Slot
58  {
59  Slot(long name, std::string tag)
60  : name(name), tag(tag) { }
61 
62  long name;
63  std::string tag;
64  };
65 
66  virtual std::vector<Slot> getMemoryBlockNamesByType(MemoryType memoryType);
67 
68  virtual DtString blockDescription();
69 
70 protected:
71  virtual void lockAccess();
72  virtual void unlockAccess();
73 
74  struct DtMemoryHeader;
75 
77  char* myMemoryPtr;
79  DtMemoryHeader* myHeader;
81  DtSharedMemoryPoolManager* myManager;
82 };
83 

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)