Message.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef FIX40_MESSAGES_H
  2. #define FIX40_MESSAGES_H
  3. #include "../Message.h"
  4. #include "../Group.h"
  5. namespace FIX40
  6. {
  7. class Header : public FIX::Header
  8. {
  9. public:
  10. FIELD_SET(*this, FIX::BeginString);
  11. FIELD_SET(*this, FIX::BodyLength);
  12. FIELD_SET(*this, FIX::MsgType);
  13. FIELD_SET(*this, FIX::SenderCompID);
  14. FIELD_SET(*this, FIX::TargetCompID);
  15. FIELD_SET(*this, FIX::OnBehalfOfCompID);
  16. FIELD_SET(*this, FIX::DeliverToCompID);
  17. FIELD_SET(*this, FIX::SecureDataLen);
  18. FIELD_SET(*this, FIX::SecureData);
  19. FIELD_SET(*this, FIX::MsgSeqNum);
  20. FIELD_SET(*this, FIX::SenderSubID);
  21. FIELD_SET(*this, FIX::TargetSubID);
  22. FIELD_SET(*this, FIX::OnBehalfOfSubID);
  23. FIELD_SET(*this, FIX::DeliverToSubID);
  24. FIELD_SET(*this, FIX::PossDupFlag);
  25. FIELD_SET(*this, FIX::PossResend);
  26. FIELD_SET(*this, FIX::SendingTime);
  27. FIELD_SET(*this, FIX::OrigSendingTime);
  28. };
  29. class Trailer : public FIX::Trailer
  30. {
  31. public:
  32. FIELD_SET(*this, FIX::SignatureLength);
  33. FIELD_SET(*this, FIX::Signature);
  34. FIELD_SET(*this, FIX::CheckSum);
  35. };
  36. class Message : public FIX::Message
  37. {
  38. public:
  39. Message( const FIX::MsgType& msgtype )
  40. : FIX::Message(
  41. FIX::BeginString("FIX.4.0"), msgtype )
  42. {}
  43. Message(const FIX::Message& m) : FIX::Message(m) {}
  44. Message(const Message& m) : FIX::Message(m) {}
  45. Header& getHeader() { return (Header&)m_header; }
  46. const Header& getHeader() const { return (Header&)m_header; }
  47. Trailer& getTrailer() { return (Trailer&)m_trailer; }
  48. const Trailer& getTrailer() const { return (Trailer&)m_trailer; }
  49. };
  50. }
  51. #endif