Parts of the new serialization code. Does not compile yet.

This commit is contained in:
JoelKatz
2012-09-25 16:48:24 -07:00
parent b653b7d1c8
commit c757d363af
13 changed files with 478 additions and 441 deletions

View File

@@ -1,16 +1,56 @@
#ifndef __FIELDNAMES__
#define __FIELDNAMES__
#include "SerializedTypes.h"
#include "SerializedObject.h"
enum SerializedTypeID
{
// special types
STI_DONE = -1,
STI_NOTPRESENT = 0,
#define TYPE(name, field, value) STI_##field = value,
#define FIELD(name, field, value)
#include "SerializeProto.h"
#undef TYPE
#undef FIELD
// high level types
STI_TRANSACTION = 100001,
STI_LEDGERENTRY = 100002,
STI_VALIDATION = 100003,
};
enum SOE_Flags
{
SOE_END = -1, // marks end of object
SOE_REQUIRED = 0, // required
SOE_OPTIONAL = 1, // optional
};
enum SOE_Field
{
sfInvalid = -1,
sfGeneric = 0,
#define FIELD(name, type, index) sf##name = (STI_##type << 16) | index,
#define TYPE(name, type, index)
#include "SerializeProto.h"
#undef FIELD
#undef TYPE
// test fields
sfTest1=100000, sfTest2, sfTest3, sfTest4
};
struct FieldName
{
SOE_Field field;
const char *fieldName;
SerializedTypeID fieldType;
int fieldValue;
int fieldID;
int fieldNum;
};
extern FieldName FieldNames[];
extern FieldName* getFieldName(SOE_Field);
extern FieldName* getFieldName(int type, int field);
#endif