DD::Image::Memory::MemoryInfo Class Reference

List of all members.

Public Types

enum  OwnerType { eNode, eOp, eKnob }

Public Member Functions

 MemoryInfo (const NodeI *node, size_t totalUsage)
 MemoryInfo (const Op *op, size_t totalUsage)
 MemoryInfo (const Knob *knob, size_t totalUsage)
size_t getTotalUsage () const
OwnerType getOwnerType () const
std::string getName () const
size_t getUserDataCount () const
const std::string & getUserDataName (size_t index) const
const std::string & getUserDataValue (size_t index) const
template<class T >
void addUserData (const std::string &name, const T &value)
void addUserData (const std::string &name, const std::stringstream &value)
const NodeI * getNode () const

Friends

std::ostream & operator<< (std::ostream &outstream, const MemoryInfo &memInfo)

Detailed Description

MemoryInfo class provides a mechanism to fill in information about how much memory a given MemoryHolder is using, attributing it to a given "owner".

There are currently three types of owner MemoryInfo's can be attributed to, these being Knobs, Nodes and Ops. If the memory is not part of these then it is acceptable to use NULL (although this means the a Node's memory usage will be incorrect)

In addition to the memory usage, a user can also add key/value pairs for additional information, which is included in the memory dump output.