yast2-core
MemUsage.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------*- c++ -*-\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SUSE LINUX AG |
11 \----------------------------------------------------------------------/
12 
13  File: MemUsage.h
14  Author: Martin Vidner <mvidner@suse.cz>
15 
16 $Id$
17 
18 /-*/
19 
20 #ifndef MemUsage_h
21 #define MemUsage_h
22 
23 #include <set>
24 
25 
29 #undef D_MEMUSAGE
30 
37 class MemUsage
38 {
39 protected:
40  typedef std::set <MemUsage *> data;
41  static data* m_mu_instances;
42 
43  MemUsage () {
44  if ( ! m_mu_instances )
45  {
46  m_mu_instances = new data;
47  }
48  m_mu_instances->insert (this);
49  }
50 
51  virtual ~MemUsage () {
52  m_mu_instances->erase (this);
53  }
54 public:
56  static void MuDump ();
58  // ready to be printed in gdb
59  static void MuDumpVal (const char *name);
60 
61  virtual std::size_t mem_size () const { return sizeof (*this); }
62 };
63 
64 // this makes it easier for gdb.
65 void MuDump ();
66 void MuDumpVal (const char *name);
67 
68 #endif
static void MuDumpVal(const char *name)
for a given class, dump its instances&#39; addresses,
Definition: MemUsage.cc:80
static void MuDump()
dump all classes and nuber of their instances
Definition: MemUsage.cc:42
virtual std::size_t mem_size() const
Definition: MemUsage.h:61
static data * m_mu_instances
Definition: MemUsage.h:41
enters the component to the broker s list in the given order Y2Component int int current_level same as but for external components which may reside in different directories The level identifies the directory prefix from the list defined in pathsearch cc bool false for clients bool true for clients Catalog of component take it if we can stat it and it is not take it if we can t stat it and its line matches in current level only name
Definition: componentcreator.txt:34
virtual ~MemUsage()
Definition: MemUsage.h:51
std::set< MemUsage * > data
Definition: MemUsage.h:40
MemUsage()
Definition: MemUsage.h:43
Definition: MemUsage.h:37

Generated on a sunny day for yast2-core by doxygen 1.8.11