Fix memory leaks in trace projections and summary
[charm.git] / src / ck-core / ckmessage.h
blobcf10dc7bb743ee2c04ffff8e324e8f3b4196867f
1 #if !defined(CKMESSAGE_H)
2 #define CKMESSAGE_H
4 #include <pup.h>
6 /**
7 * CkMessage is the superclass of all Charm++ messages.
8 * Typically, a message foo inherits from CMessage_foo, which
9 * inherits from CkMessage. In the internals of Charm++,
10 * messages are often represented by bare "void *"s, which is
11 * silly and dangerous.
13 class CkMessage {
14 //Don't use these: use CkCopyMsg
15 CkMessage(const CkMessage &);
16 void operator=(const CkMessage &);
17 public:
18 CkMessage() {}
19 void operator delete(void *ptr) { CkFreeMsg(ptr); }
21 /* This pup routine only packs the message itself, *not* the
22 message header. Use CkPupMessage instead of calling this directly. */
23 void pup(PUP::er &p);
25 /// This is used to display message contents in the debugger.
26 static void ckDebugPup(PUP::er &p,void *msg);
28 class CMessage_CkMessage {
29 public:
30 static int __idx;
33 /// CkArgMsg is passed to the mainchare's constructor.
34 class CkArgMsg : public CkMessage {
35 public:
36 int argc;
37 char **argv;
40 #endif