VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Creating the Encoder Class

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.


/*********************************************************************
** Copyright (c) 1992-2010 VT MAK
** All rights reserved.
*********************************************************************/
#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)
{
public:
DtExerciseConn* exConn,
DtObjClassDesc* classDesc);
virtual ~TestEncoder();
protected:
};
#endif

/*********************************************************************
** Copyright (c) 1992-2010 VT MAK
** All rights reserved.
*********************************************************************/
#if DtHLA
#include "testEnc.h"
#include "testSR.h"
DtExerciseConn* exConn,
DtObjClassDesc* classDesc) :
DtHlaStateEncoder(exConn, classDesc)
{
// Register the individual encoding and checking functions for Test's
// attributes with the object. The encoding functions have names like
// encodeNumber, while checking functions have names like needNumber. The
// macros expands to look like this:
// addEncoder("Number", (DtAttributeEncoder) encodeNumber);
// addChecker("Number", (DtAttributeChecker) needNumber);
}
{
}
// Encoding functions
Number, DtNetU32, number);
Vector, DtNet64Vector, vector);
// Checking functions
Number, number);
Vector, vector);
#endif

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)