-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRepresentation.h
More file actions
42 lines (34 loc) · 974 Bytes
/
Representation.h
File metadata and controls
42 lines (34 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Representation.h
*
* Created on: Jan 18, 2016
* Author: sabeyruw
*/
#ifndef REPRESENTATION_H_
#define REPRESENTATION_H_
#include "Node.h"
#include "Serializable.h"
#if !defined(EMBEDDED_MODE)
#include <mutex>
#endif
#define SERIALIZE_BUFFER(NAME, IN_OUT, SIZE) serializeBuffer(in, out, IN_OUT, SIZE);
// -- Representations
class Representation: public Node, public Serializable
{
public: void (*updateThis)(Node* , Node* );
public: Representation() : Node(), updateThis(0) {}
public: virtual ~Representation() {}
public: virtual void draw() const {}
public:
virtual void serialize(ObjectInput* in, ObjectOutput* out)
{
const size_t baseSize = sizeof(Representation);
unsigned char* p = (unsigned char*) this;
SERIALIZE_BUFFER(getName(), p + baseSize, getSize() - baseSize);
}
#if !defined(EMBEDDED_MODE)
public:
std::mutex sync;
#endif
};
#endif /* REPRESENTATION_H_ */