more stable atdna type canonicalization; recursive DNA subclassing

This commit is contained in:
Jack Andersen
2015-06-22 12:52:09 -10:00
parent 490c6d53f5
commit 071d91a671
5 changed files with 193 additions and 99 deletions

View File

@@ -53,6 +53,8 @@ struct DNA
template <size_t align>
struct Align {};
struct Delete {};
virtual void read(IStreamReader&)=0;
virtual void write(IStreamWriter&) const=0;
};
@@ -62,6 +64,12 @@ struct DNA
void read(Athena::io::IStreamReader&); \
void write(Athena::io::IStreamWriter&) const; \
/** Macro to automatically declare read/write methods and prevent outputting implementation */
#define DECL_EXPLICIT_DNA \
void read(Athena::io::IStreamReader&); \
void write(Athena::io::IStreamWriter&) const; \
Delete __dna_delete;
/** Macro to supply count variable to atdna and mute it for other compilers */
#ifdef __clang__
#define DNA_COUNT(cnt) sizeof(cnt)