The following classes in the PUP framework were used in implementing debugging support in charm.
class PUP::er - This class is the abstract superclass of all the other classes in the framework. The pup method of a particular class takes a reference to a PUP::er as parameter. This class has methods for dealing with all the basic C++ data types. All these methods are expressed in terms of a generic pure virtual method. Subclasses only need to provide the generic method.
class PUP::toText - This is a subclass of the PUP::toTextUtil class which is a subclass of the PUP::er class. It copies the data of an object to a C string, including the terminating NULL.
class PUP::sizerText - This is a subclass of the PUP::toTextUtil class which is a subclass of the PUP::er class. It returns the number of characters including the terminating NULL and is used by the PUP::toText object to allocate space for building the C string.
The code below shows a simple class declaration that includes a pup method.
class foo {
private:
bool isBar;
int x;
char y;
unsigned long z;
float q[3];
public:
void pup(PUP::er &p) {
p(isBar);
p(x);p(y);p(z);
p(q,3);
}
};
November 07, 2009
CharmDebug Homepage
Charm Homepage