The TestEncoder class (in testEnc.h and testEnc.cxx) is implemented similarly to the decoder class, but it also contains checking functions in addition to encoding functions.
#pragma once
#if DtHLA
#define DtDECLARE_TEST_ATTR_CHECKER(attrName) \
DtDECLARE_ATTR_CHECKER(TestStateRepository, attrName)
#define DtDECLARE_TEST_ATTR_ENCODER(attrName) \
DtDECLARE_ATTR_ENCODER(TestStateRepository, attrName)
#define DtDEFINE_SIMPLE_TEST_ATTR_ENCODER( \
attrName, netType, inspector) \
DtDEFINE_SIMPLE_ATTR_ENCODER(TestEncoder, \
TestStateRepository, attrName, netType, inspector)
#define DtDEFINE_SIMPLE_TEST_ATTR_CHECKER( \
attrName, inspector) \
DtDEFINE_SIMPLE_ATTR_CHECKER(TestEncoder, \
TestStateRepository, \
attrName, inspector)
class TestEncoder : public DtHlaStateEncoder
{
public:
TestEncoder(
DtObjClassDesc* classDesc);
virtual ~TestEncoder();
protected:
DtDECLARE_TEST_ATTR_ENCODER(
Number);
DtDECLARE_TEST_ATTR_ENCODER(Vector);
DtDECLARE_TEST_ATTR_CHECKER(
Number);
DtDECLARE_TEST_ATTR_CHECKER(Vector);
};
#endif
#if DtHLA
#include "testEnc.h"
TestEncoder::TestEncoder(
DtObjClassDesc* classDesc) :
DtHlaStateEncoder(exConn, classDesc)
{
DtADD_ATTR_ENCODER(Vector);
DtADD_ATTR_CHECKER(Vector);
}
TestEncoder::~TestEncoder()
{
}
DtDEFINE_SIMPLE_TEST_ATTR_ENCODER(
DtDEFINE_SIMPLE_TEST_ATTR_ENCODER(
DtDEFINE_SIMPLE_TEST_ATTR_CHECKER(
DtDEFINE_SIMPLE_TEST_ATTR_CHECKER(
Vector, vector);
#endif