ManaPlus
Public Member Functions
MemoryCounter Class Reference

#include <memorycounter.h>

Inheritance diagram for MemoryCounter:
Action AmbientLayer Animation AtlasItem Map MapHeights MapLayer ObjectsLayer Resource SpecialLayer TextureAtlas

Public Member Functions

 MemoryCounter ()
 
virtual ~MemoryCounter ()
 
int calcMemory (const int level) const
 
virtual int calcMemoryLocal () const
 
virtual int calcMemoryChilds (const int level) const
 
virtual std::string getCounterName () const
 

Detailed Description

Definition at line 29 of file memorycounter.h.

Constructor & Destructor Documentation

◆ MemoryCounter()

MemoryCounter::MemoryCounter ( )

Definition at line 28 of file memorycounter.cpp.

29 {
30 }

◆ ~MemoryCounter()

virtual MemoryCounter::~MemoryCounter ( )
inlinevirtual

Definition at line 38 of file memorycounter.h.

39  { }

Member Function Documentation

◆ calcMemory()

int MemoryCounter::calcMemory ( const int  level) const

Definition at line 37 of file memorycounter.cpp.

38 {
39  const int sumLocal = calcMemoryLocal();
40  const int sumChilds = calcMemoryChilds(level);
42  level,
43  sumLocal,
44  sumChilds);
45  return sumLocal + sumChilds;
46 }
virtual std::string getCounterName() const
Definition: memorycounter.h:48
virtual int calcMemoryLocal() const
virtual int calcMemoryChilds(const int level) const
static void printMemory(const std::string &name, const int level, const int localSum, const int childsSum)

References calcMemoryChilds(), calcMemoryLocal(), getCounterName(), and MemoryManager::printMemory().

Referenced by Action::calcMemoryChilds(), AtlasResource::calcMemoryChilds(), TextureAtlas::calcMemoryChilds(), Map::calcMemoryChilds(), MapLayer::calcMemoryChilds(), and SpriteDef::calcMemoryChilds().

◆ calcMemoryChilds()

int MemoryCounter::calcMemoryChilds ( const int  level) const
virtual

Reimplemented in SpriteDef, MapLayer, Map, TextureAtlas, AtlasResource, and Action.

Definition at line 48 of file memorycounter.cpp.

49 {
50  return 0;
51 }

Referenced by calcMemory().

◆ calcMemoryLocal()

int MemoryCounter::calcMemoryLocal ( ) const
virtual

◆ getCounterName()

virtual std::string MemoryCounter::getCounterName ( ) const
inlinevirtual

Reimplemented in SoundEffect, SDLMusic, Resource, WalkLayer, SpecialLayer, ObjectsLayer, MapLayer, MapHeights, Map, TextureAtlas, AtlasItem, Animation, AmbientLayer, and Action.

Definition at line 48 of file memorycounter.h.

49  { return "unknown"; }

Referenced by calcMemory().


The documentation for this class was generated from the following files: