WSF
MessageDefines.hpp File Reference
#include "FieldAccessorTypes.hpp"
#include "FieldTypes.hpp"
#include "MessageSizeChecker.hpp"
#include "Messages.hpp"
#include "UtMemory.hpp"
#include "MessageDefines_Details.hpp"
Include dependency graph for MessageDefines.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WsfL16::Messages::WordFinder< INIT_TYPE, SUB_WORD, WORD_TYPE_TAG, CORRECT_SUB_TYPE >
struct  WsfL16::Messages::WordFinder< INIT_TYPE, SUB_WORD, ContinuationBase, 1 >
struct  WsfL16::Messages::WordFinder< INIT_TYPE, SUB_WORD, ExtensionBase, 1 >

Namespaces

namespace  WsfL16
 This file should be included prior to defining a message. Currently there is a limit of 32 fields per message.
namespace  WsfL16::Messages

Macros

#define DEFINE_VIRTUAL_TRANSERS__()
 Define a virtual TransferI() for each message.
#define DEFINE_INITIAL(_LABEL_, _SUB_LABEL_)
 This should be used at the top of the public: section of each Initial message.
#define DEFINE_EXTENSION(_LABEL_, _SUB_LABEL_, _EXT_NUM_)
 This should be used at the top of the public: section of each Extension message.
#define DEFINE_CONTINUATION(_LABEL_, _SUB_LABEL_, _CONT_NUM_)
 This should be used at the top of the public: section of each Continuation message.
#define DEFINE_CONT_CASE__(NUM)
 MessageDefines_Details.hpp contains code generated using a script: MessageDefines_Generate.py.
#define DEFINE_CONT_CASE2__(N1, N2)
#define DEFINE_CONT_CASE4__(N1, N2, N3, N4)
#define DEFINE_CONT_CASE8__(N1, N2, N3, N4, N5, N6, N7, N8)
#define DEFINE_CONT_DEFS(NUM)
#define DEFINE_CONT_DEFS2(N1, N2)
#define DEFINE_CONT_DEFS3(N1, N2, N3)
#define DEFINE_CONT_DEFS4(N1, N2, N3, N4)
#define DEFINE_CONT_DEFS8(N1, N2, N3, N4, N5, N6, N7, N8)
#define DEFINE_CONTINUATIONS12(N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N11, N12)
#define DEFINE_CONTINUATIONS11(N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N11)
#define DEFINE_CONTINUATIONS10(N1, N2, N3, N4, N5, N6, N7, N8, N9, N10)
#define DEFINE_CONTINUATIONS9(N1, N2, N3, N4, N5, N6, N7, N8, N9)
#define DEFINE_CONTINUATIONS8(N1, N2, N3, N4, N5, N6, N7, N8)
#define DEFINE_CONTINUATIONS7(N1, N2, N3, N4, N5, N6, N7)
#define DEFINE_CONTINUATIONS6(N1, N2, N3, N4, N5, N6)
#define DEFINE_CONTINUATIONS5(N1, N2, N3, N4, N5)
#define DEFINE_CONTINUATIONS4(N1, N2, N3, N4)
#define DEFINE_CONTINUATIONS3(N1, N2, N3)
#define DEFINE_CONTINUATIONS2(N1, N2)
#define DEFINE_CONTINUATIONS1(N1)
#define DEFINE_CONTINUATIONS0()
#define DEFINE_EXTENSIONS0()
#define DEFINE_EXTENSIONS1()
#define DEFINE_EXTENSIONS2()
#define DEFINE_EXTENSIONS3()

Functions

template<typename INIT_TYPE, typename SUB_WORD>
bool WsfL16::Messages::FindWordT (INIT_TYPE &aInitialWord, SUB_WORD *&aSubWord)

Macro Definition Documentation

◆ DEFINE_CONT_CASE2__

#define DEFINE_CONT_CASE2__ ( N1,
N2 )
Value:
#define DEFINE_CONT_CASE__(NUM)
MessageDefines_Details.hpp contains code generated using a script: MessageDefines_Generate....
Definition MessageDefines.hpp:103

◆ DEFINE_CONT_CASE4__

#define DEFINE_CONT_CASE4__ ( N1,
N2,
N3,
N4 )
Value:
#define DEFINE_CONT_CASE2__(N1, N2)
Definition MessageDefines.hpp:106

◆ DEFINE_CONT_CASE8__

#define DEFINE_CONT_CASE8__ ( N1,
N2,
N3,
N4,
N5,
N6,
N7,
N8 )
Value:
DEFINE_CONT_CASE4__(N1, N2, N3, N4) DEFINE_CONT_CASE4__(N5, N6, N7, N8)
#define DEFINE_CONT_CASE4__(N1, N2, N3, N4)
Definition MessageDefines.hpp:107

◆ DEFINE_CONT_CASE__

#define DEFINE_CONT_CASE__ ( NUM)
Value:
case NUM: \
return ut::make_unique<Continuation##NUM>();

MessageDefines_Details.hpp contains code generated using a script: MessageDefines_Generate.py.

A DEFINE_MEMBERS() macro should be used in each message type. Look at any message type for an example of how to use. This will define how the message reads and writes data, and check the message size to ensure it is 70 bits. !! You will get a compiler error if the message isn't 70 bits !!

The following #define's make type - specific functions for getting the continuation and extension words in a message.

◆ DEFINE_CONT_DEFS

#define DEFINE_CONT_DEFS ( NUM)
Value:
using Continuation##NUM##Type = Continuation##NUM;

◆ DEFINE_CONT_DEFS2

#define DEFINE_CONT_DEFS2 ( N1,
N2 )
Value:
#define DEFINE_CONT_DEFS(NUM)
Definition MessageDefines.hpp:111

◆ DEFINE_CONT_DEFS3

#define DEFINE_CONT_DEFS3 ( N1,
N2,
N3 )
Value:
#define DEFINE_CONT_DEFS2(N1, N2)
Definition MessageDefines.hpp:112

◆ DEFINE_CONT_DEFS4

#define DEFINE_CONT_DEFS4 ( N1,
N2,
N3,
N4 )
Value:

◆ DEFINE_CONT_DEFS8

#define DEFINE_CONT_DEFS8 ( N1,
N2,
N3,
N4,
N5,
N6,
N7,
N8 )
Value:
DEFINE_CONT_DEFS4(N1, N2, N3, N4) DEFINE_CONT_DEFS4(N5, N6, N7, N8)
#define DEFINE_CONT_DEFS4(N1, N2, N3, N4)
Definition MessageDefines.hpp:114

◆ DEFINE_CONTINUATION

#define DEFINE_CONTINUATION ( _LABEL_,
_SUB_LABEL_,
_CONT_NUM_ )
Value:
public: \
virtual ContinuationBase* Clone() const { return new Continuation##_CONT_NUM_(*this); } \
\
protected: \
static const unsigned int ___RequiredMessageSize = 63; \
\
public: \
static const unsigned int cCONTINUATION_NUMBER = _CONT_NUM_; \
virtual int GetLabel() const { return _CONT_NUM_; } \
virtual int GetUID() const { return (_LABEL_ * 100 + _SUB_LABEL_) * 1000 + _CONT_NUM_ * 10; } \
static const int cWORD_LABEL = _LABEL_; \
static const int cWORD_SUB_LABEL = _SUB_LABEL_; \
DEFINE_VIRTUAL_TRANSERS__()

This should be used at the top of the public: section of each Continuation message.

◆ DEFINE_CONTINUATIONS0

#define DEFINE_CONTINUATIONS0 ( )
Value:
std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override { return nullptr; }

Referenced by WsfL16::Messages::J9_1::Initial::DEFINE_MEMBERS9().

◆ DEFINE_CONTINUATIONS1

#define DEFINE_CONTINUATIONS1 ( N1)
Value:
DEFINE_CONT_DEFS(N1) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE__(N1) \
} \
return nullptr; \
}

Referenced by WsfL16::Messages::J7_1::Initial::DEFINE_MEMBERS17().

◆ DEFINE_CONTINUATIONS10

#define DEFINE_CONTINUATIONS10 ( N1,
N2,
N3,
N4,
N5,
N6,
N7,
N8,
N9,
N10 )
Value:
DEFINE_CONT_DEFS8(N1, N2, N3, N4, N5, N6, N7, N8) \
DEFINE_CONT_DEFS2(N9, N10) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE8__(N1, N2, N3, N4, N5, N6, N7, N8) DEFINE_CONT_CASE2__(N9, N10) \
} \
return nullptr; \
}
#define DEFINE_CONT_DEFS8(N1, N2, N3, N4, N5, N6, N7, N8)
Definition MessageDefines.hpp:115

◆ DEFINE_CONTINUATIONS11

#define DEFINE_CONTINUATIONS11 ( N1,
N2,
N3,
N4,
N5,
N6,
N7,
N8,
N9,
N10,
N11 )
Value:
DEFINE_CONT_DEFS8(N1, N2, N3, N4, N5, N6, N7, N8) \
DEFINE_CONT_DEFS3(N9, N10, N11) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE8__(N1, N2, N3, N4, N5, N6, N7, N8) DEFINE_CONT_CASE2__(N9, N10) DEFINE_CONT_CASE__(N11) \
} \
return nullptr; \
}

◆ DEFINE_CONTINUATIONS12

#define DEFINE_CONTINUATIONS12 ( N1,
N2,
N3,
N4,
N5,
N6,
N7,
N8,
N9,
N10,
N11,
N12 )
Value:
DEFINE_CONT_DEFS8(N1, N2, N3, N4, N5, N6, N7, N8) \
DEFINE_CONT_DEFS4(N9, N10, N11, N12) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE8__(N1, N2, N3, N4, N5, N6, N7, N8) DEFINE_CONT_CASE4__(N9, N10, N11, N12) \
} \
return nullptr; \
}

◆ DEFINE_CONTINUATIONS2

#define DEFINE_CONTINUATIONS2 ( N1,
N2 )
Value:
DEFINE_CONT_DEFS2(N1, N2) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE2__(N1, N2) \
} \
return nullptr; \
}

◆ DEFINE_CONTINUATIONS3

#define DEFINE_CONTINUATIONS3 ( N1,
N2,
N3 )
Value:
DEFINE_CONT_DEFS(N3) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE2__(N1, N2) DEFINE_CONT_CASE__(N3) \
} \
return nullptr; \
}

Referenced by WsfL16::Messages::J7_3::Initial::DEFINE_MEMBERS5().

◆ DEFINE_CONTINUATIONS4

#define DEFINE_CONTINUATIONS4 ( N1,
N2,
N3,
N4 )
Value:
DEFINE_CONT_DEFS4(N1, N2, N3, N4) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE4__(N1, N2, N3, N4) \
} \
return nullptr; \
}

◆ DEFINE_CONTINUATIONS5

#define DEFINE_CONTINUATIONS5 ( N1,
N2,
N3,
N4,
N5 )
Value:
DEFINE_CONT_DEFS4(N1, N2, N3, N4) \
DEFINE_CONT_DEFS(N5) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE4__(N1, N2, N3, N4) DEFINE_CONT_CASE__(N5) \
} \
return nullptr; \
}

◆ DEFINE_CONTINUATIONS6

#define DEFINE_CONTINUATIONS6 ( N1,
N2,
N3,
N4,
N5,
N6 )
Value:
DEFINE_CONT_DEFS4(N1, N2, N3, N4) \
DEFINE_CONT_DEFS2(N5, N6) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE4__(N1, N2, N3, N4) DEFINE_CONT_CASE2__(N5, N6) \
} \
return nullptr; \
}

◆ DEFINE_CONTINUATIONS7

#define DEFINE_CONTINUATIONS7 ( N1,
N2,
N3,
N4,
N5,
N6,
N7 )
Value:
DEFINE_CONT_DEFS4(N1, N2, N3, N4) \
DEFINE_CONT_DEFS3(N5, N6, N7) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE4__(N1, N2, N3, N4) DEFINE_CONT_CASE2__(N5, N6) DEFINE_CONT_CASE__(N7) \
} \
return nullptr; \
}

◆ DEFINE_CONTINUATIONS8

#define DEFINE_CONTINUATIONS8 ( N1,
N2,
N3,
N4,
N5,
N6,
N7,
N8 )
Value:
DEFINE_CONT_DEFS8(N1, N2, N3, N4, N5, N6, N7, N8) \
std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE8__(N1, N2, N3, N4, N5, N6, N7, N8) \
} \
return nullptr; \
}

◆ DEFINE_CONTINUATIONS9

#define DEFINE_CONTINUATIONS9 ( N1,
N2,
N3,
N4,
N5,
N6,
N7,
N8,
N9 )
Value:
DEFINE_CONT_DEFS8(N1, N2, N3, N4, N5, N6, N7, N8) \
DEFINE_CONT_DEFS(N9) std::unique_ptr<ContinuationBase> CreateContinuationWord(int lbl) override \
{ \
switch (lbl) \
{ \
DEFINE_CONT_CASE8__(N1, N2, N3, N4, N5, N6, N7, N8) DEFINE_CONT_CASE__(N9) \
} \
return nullptr; \
}

◆ DEFINE_EXTENSION

#define DEFINE_EXTENSION ( _LABEL_,
_SUB_LABEL_,
_EXT_NUM_ )
Value:
public: \
virtual ExtensionBase* Clone() const { return new Extension##_EXT_NUM_(*this); } \
\
protected: \
static const unsigned int ___RequiredMessageSize = 68; \
\
public: \
static const unsigned int cEXTENSION_NUMBER = _EXT_NUM_; \
virtual int GetExtensionNumber() const { return cEXTENSION_NUMBER; } \
virtual int GetUID() const { return (_LABEL_ * 100 + _SUB_LABEL_) * 1000 + _EXT_NUM_ + 1; } \
static const int cWORD_LABEL = _LABEL_; \
static const int cWORD_SUB_LABEL = _SUB_LABEL_; \
DEFINE_VIRTUAL_TRANSERS__()

This should be used at the top of the public: section of each Extension message.

◆ DEFINE_EXTENSIONS0

◆ DEFINE_EXTENSIONS1

◆ DEFINE_EXTENSIONS2

#define DEFINE_EXTENSIONS2 ( )
Value:
typedef Extension0 Extension0Type; \
typedef Extension1 Extension1Type; \
std::unique_ptr<ExtensionBase> CreateExtensionWord(int aEn) override \
{ \
switch (aEn) \
{ \
case 0: \
return ut::make_unique<Extension0>(); \
case 1: \
return ut::make_unique<Extension1>(); \
default: \
return nullptr; \
} \
}

Referenced by WsfL16::Messages::J12_7::Initial::DEFINE_MEMBERS8().

◆ DEFINE_EXTENSIONS3

#define DEFINE_EXTENSIONS3 ( )
Value:
typedef Extension0 Extension0Type; \
typedef Extension1 Extension1Type; \
typedef Extension2 Extension2Type; \
std::unique_ptr<ExtensionBase> CreateExtensionWord(int aEn) override \
{ \
switch (aEn) \
{ \
case 0: \
return ut::make_unique<Extension0>(); \
case 1: \
return ut::make_unique<Extension1>(); \
case 2: \
return ut::make_unique<Extension2>(); \
default: \
return nullptr; \
} \
}

◆ DEFINE_INITIAL

#define DEFINE_INITIAL ( _LABEL_,
_SUB_LABEL_ )
Value:
public: \
virtual InitialBase* Clone() const { return new Initial(*this); } \
\
protected: \
static const unsigned int ___RequiredMessageSize = 57; \
\
public: \
virtual void GetLabel(int& aLabel, int& aSubLabel) const \
{ \
aLabel = _LABEL_; \
aSubLabel = _SUB_LABEL_; \
} \
virtual int GetUID() const { return (_LABEL_ * 100 + _SUB_LABEL_) * 1000; } \
static const int cWORD_LABEL = _LABEL_; \
static const int cWORD_SUB_LABEL = _SUB_LABEL_; \
DEFINE_VIRTUAL_TRANSERS__()

This should be used at the top of the public: section of each Initial message.

◆ DEFINE_VIRTUAL_TRANSERS__

#define DEFINE_VIRTUAL_TRANSERS__ ( )
Value:
virtual void TransferI(MessageBitInput& aMR) { Transfer(aMR); } \
virtual void TransferO(MessageBitOutput& aMW) { Transfer(aMW); } \
virtual void CreateAccessor(MessageAccessorFiller& aMP) { Transfer(aMP); }

Define a virtual TransferI() for each message.

Copyrights Multiple, All Rights Reserved