Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CCmpExample.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2013 Wildfire Games.
2  * ...the usual copyright header...
3  */
4 
5 #include "precompiled.h"
6 
8 #include "ICmpExample.h"
9 
10 // ... any other includes needed ...
11 
12 class CCmpExample : public ICmpExample
13 {
14 public:
15  static void ClassInit(CComponentManager& componentManager)
16  {
17  // ...
18  }
19 
21 
22  // ... member variables ...
23 
24  static std::string GetSchema()
25  {
26  return "<ref name='anything'/>";
27  }
28 
29  virtual void Init(const CParamNode& paramNode)
30  {
31  // ...
32  }
33 
34  virtual void Deinit()
35  {
36  // ...
37  }
38 
39  virtual void Serialize(ISerializer& serialize)
40  {
41  // ...
42  }
43 
44  virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
45  {
46  // ...
47  }
48 
49  virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
50  {
51  // ...
52  }
53 
54  // ... Implementation of interface functions: ...
55  virtual int DoWhatever(int x, int y)
56  {
57  return x+y;
58  }
59 };
60 
An entity initialisation parameter node.
Definition: ParamNode.h:112
#define REGISTER_COMPONENT_TYPE(cname)
Definition: Component.h:30
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
Serialization interface; see serialization overview.
Definition: ISerializer.h:120
static std::string GetSchema()
Definition: CCmpExample.cpp:24
virtual void Deserialize(const CParamNode &paramNode, IDeserializer &deserialize)
Definition: CCmpExample.cpp:44
virtual void Serialize(ISerializer &serialize)
Definition: CCmpExample.cpp:39
virtual void HandleMessage(const CMessage &msg, bool global)
Definition: CCmpExample.cpp:49
Documentation to describe what this interface and its associated component types are for...
Definition: ICmpExample.h:29
#define DEFAULT_COMPONENT_ALLOCATOR(cname)
Definition: Component.h:44
virtual int DoWhatever(int x, int y)
Documentation for each method.
Definition: CCmpExample.cpp:55
static void ClassInit(CComponentManager &componentManager)
Definition: CCmpExample.cpp:15
virtual void Init(const CParamNode &paramNode)
Definition: CCmpExample.cpp:29
virtual void Deinit()
Definition: CCmpExample.cpp:34
Deserialization interface; see serialization overview.
Definition: IDeserializer.h:34