athena/atdna/test.hpp

90 lines
2.0 KiB
C++
Raw Normal View History

2016-03-04 23:00:12 +00:00
#include <athena/DNAYaml.hpp>
2015-08-03 01:42:47 +00:00
2016-03-04 23:00:12 +00:00
using namespace athena;
typedef io::DNA<Big> BigDNA;
2015-08-03 01:42:47 +00:00
enum ETest : atUint8
{
ZERO,
ONE,
TWO,
THREE
};
template <ETest EVal>
struct AT_SPECIALIZE_PARMS(ETest::ZERO, ETest::ONE, ETest::TWO, ETest::THREE)
TESTSubFile : public BigDNA
2015-08-03 01:42:47 +00:00
{
AT_DECL_DNA
Value<ETest> varE = EVal;
2015-08-03 01:42:47 +00:00
Value<atUint32> sub1;
Value<atUint32> sub2;
};
struct TESTSubClassFile : public TESTSubFile<ETest::ONE>
2015-08-03 01:42:47 +00:00
{
AT_DECL_DNA
2015-08-03 01:42:47 +00:00
Value<atUint32> sub3;
Value<atUint16> sub4;
2015-08-03 01:42:47 +00:00
};
struct TESTSubSubClassFile : public TESTSubClassFile
{
AT_DECL_DNA
2015-08-03 01:42:47 +00:00
Value<atUint32> sub5;
Value<atUint32> sub6;
};
template <class Var32Tp, int Var32Val>
struct AT_SPECIALIZE_PARMS(atUint16, 42, atUint32, 87, atUint32, 2)
TESTFile : public BigDNA
2015-08-03 01:42:47 +00:00
{
AT_DECL_DNA
2015-08-03 01:42:47 +00:00
Value<bool> varBool;
AT_OVERRIDE_RCRC32(12345678) Value<Var32Tp> x4_var32 = Var32Val;
AT_OVERRIDE_RCRC32(deadbabe) Value<atUint16> x8_var16;
2015-08-03 01:42:47 +00:00
Value<atVec3f> vec3;
Value<atVec4f> vec4;
struct TESTNestedSubFile : public BigDNA
{
AT_DECL_DNA
2015-08-03 01:42:47 +00:00
Value<atUint32> nestSub1;
Value<atUint32> nestSub2;
} nestedSubFile;
using TESTSubFileUsing = TESTSubFile<ETest::TWO>;
TESTSubFileUsing subFile;
2015-08-03 01:42:47 +00:00
Align<4> align;
template <class NestedTp, int NestedVal>
struct AT_SPECIALIZE_PARMS(atInt32, 36, atInt64, 96)
TESTTemplateSubFile : public BigDNA
2015-08-03 01:42:47 +00:00
{
AT_DECL_DNA
Value<NestedTp> explSub1 = NestedVal;
Value<Var32Tp> explSub2 = Var32Val;
};
TESTTemplateSubFile<atInt32, 36> nestedTemplate1;
TESTTemplateSubFile<atInt64, 96> nestedTemplate2;
2015-08-03 01:42:47 +00:00
Value<atUint32, Little> arrCount[2];
2015-08-03 01:42:47 +00:00
Vector<atUint32, DNA_COUNT(arrCount[0])> array;
Value<atUint32> arrAltCount;
Vector<atUint32, DNA_COUNT(arrAltCount)> arrayAlt;
2015-08-03 01:42:47 +00:00
Seek<21, Current> seek;
Value<atUint32> arrCount2;
Vector<TESTSubFile<ETest::ZERO>, DNA_COUNT(arrCount[1] + arrCount2)> array2;
2015-08-03 01:42:47 +00:00
Value<atUint32> bufSz;
Buffer<DNA_COUNT(bufSz)> buf;
String<32> str;
WString<64> wstr;
};