mirror of
https://github.com/libAthena/athena.git
synced 2025-12-09 13:38:03 +00:00
more stable atdna type canonicalization; recursive DNA subclassing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user