fix8  version 1.4.0
Open Source C++ FIX Framework
tex_router_server Class Reference

Example server message router. Derives from fix8 generated router class. More...

#include <hftest.hpp>

Inheritance diagram for tex_router_server:
FIX8::TEX::Myfix_Router FIX8::TEX::Perf_Router FIX8::Router FIX8::Router

Public Member Functions

 tex_router_server (hf_session_server &session)
 
virtual bool operator() (const FIX8::TEX::NewOrderSingle *msg)
 
 tex_router_server (myfix_session_server &session)
 
virtual bool operator() (const FIX8::TEX::NewOrderSingle *msg) const
 
- Public Member Functions inherited from FIX8::TEX::Myfix_Router
 Myfix_Router ()
 
virtual ~Myfix_Router ()
 
virtual bool operator() (const class Message *msg) const
 
virtual bool operator() (const class Heartbeat *msg) const
 
virtual bool operator() (const class TestRequest *msg) const
 
virtual bool operator() (const class ResendRequest *msg) const
 
virtual bool operator() (const class Reject *msg) const
 
virtual bool operator() (const class SequenceReset *msg) const
 
virtual bool operator() (const class Logout *msg) const
 
virtual bool operator() (const class IOI *msg) const
 
virtual bool operator() (const class Advertisement *msg) const
 
virtual bool operator() (const class ExecutionReport *msg) const
 
virtual bool operator() (const class OrderCancelReject *msg) const
 
virtual bool operator() (const class Logon *msg) const
 
virtual bool operator() (const class DerivativeSecurityList *msg) const
 
virtual bool operator() (const class NewOrderMultileg *msg) const
 
virtual bool operator() (const class MultilegOrderCancelReplace *msg) const
 
virtual bool operator() (const class TradeCaptureReportRequest *msg) const
 
virtual bool operator() (const class TradeCaptureReport *msg) const
 
virtual bool operator() (const class OrderMassStatusRequest *msg) const
 
virtual bool operator() (const class QuoteRequestReject *msg) const
 
virtual bool operator() (const class RFQRequest *msg) const
 
virtual bool operator() (const class QuoteStatusReport *msg) const
 
virtual bool operator() (const class QuoteResponse *msg) const
 
virtual bool operator() (const class Confirmation *msg) const
 
virtual bool operator() (const class PositionMaintenanceRequest *msg) const
 
virtual bool operator() (const class PositionMaintenanceReport *msg) const
 
virtual bool operator() (const class RequestForPositions *msg) const
 
virtual bool operator() (const class RequestForPositionsAck *msg) const
 
virtual bool operator() (const class PositionReport *msg) const
 
virtual bool operator() (const class TradeCaptureReportRequestAck *msg) const
 
virtual bool operator() (const class TradeCaptureReportAck *msg) const
 
virtual bool operator() (const class AllocationReport *msg) const
 
virtual bool operator() (const class AllocationReportAck *msg) const
 
virtual bool operator() (const class ConfirmationAck *msg) const
 
virtual bool operator() (const class SettlementInstructionRequest *msg) const
 
virtual bool operator() (const class AssignmentReport *msg) const
 
virtual bool operator() (const class CollateralRequest *msg) const
 
virtual bool operator() (const class CollateralAssignment *msg) const
 
virtual bool operator() (const class CollateralResponse *msg) const
 
virtual bool operator() (const class News *msg) const
 
virtual bool operator() (const class CollateralReport *msg) const
 
virtual bool operator() (const class CollateralInquiry *msg) const
 
virtual bool operator() (const class NetworkCounterpartySystemStatusRequest *msg) const
 
virtual bool operator() (const class NetworkCounterpartySystemStatusResponse *msg) const
 
virtual bool operator() (const class UserRequest *msg) const
 
virtual bool operator() (const class UserResponse *msg) const
 
virtual bool operator() (const class CollateralInquiryAck *msg) const
 
virtual bool operator() (const class ConfirmationRequest *msg) const
 
virtual bool operator() (const class TradingSessionListRequest *msg) const
 
virtual bool operator() (const class TradingSessionList *msg) const
 
virtual bool operator() (const class SecurityListUpdateReport *msg) const
 
virtual bool operator() (const class AdjustedPositionReport *msg) const
 
virtual bool operator() (const class AllocationInstructionAlert *msg) const
 
virtual bool operator() (const class ExecutionAcknowledgement *msg) const
 
virtual bool operator() (const class ContraryIntentionReport *msg) const
 
virtual bool operator() (const class SecurityDefinitionUpdateReport *msg) const
 
virtual bool operator() (const class SettlementObligationReport *msg) const
 
virtual bool operator() (const class DerivativeSecurityListUpdateReport *msg) const
 
virtual bool operator() (const class TradingSessionListUpdateReport *msg) const
 
virtual bool operator() (const class MarketDefinitionRequest *msg) const
 
virtual bool operator() (const class MarketDefinition *msg) const
 
virtual bool operator() (const class MarketDefinitionUpdateReport *msg) const
 
virtual bool operator() (const class ApplicationMessageRequest *msg) const
 
virtual bool operator() (const class ApplicationMessageRequestAck *msg) const
 
virtual bool operator() (const class ApplicationMessageReport *msg) const
 
virtual bool operator() (const class OrderMassActionReport *msg) const
 
virtual bool operator() (const class Email *msg) const
 
virtual bool operator() (const class OrderMassActionRequest *msg) const
 
virtual bool operator() (const class UserNotification *msg) const
 
virtual bool operator() (const class StreamAssignmentRequest *msg) const
 
virtual bool operator() (const class StreamAssignmentReport *msg) const
 
virtual bool operator() (const class StreamAssignmentReportACK *msg) const
 
virtual bool operator() (const class PartyDetailsListRequest *msg) const
 
virtual bool operator() (const class PartyDetailsListReport *msg) const
 
virtual bool operator() (const class NewOrderSingle *msg) const
 
virtual bool operator() (const class NewOrderList *msg) const
 
virtual bool operator() (const class OrderCancelRequest *msg) const
 
virtual bool operator() (const class OrderCancelReplaceRequest *msg) const
 
virtual bool operator() (const class OrderStatusRequest *msg) const
 
virtual bool operator() (const class AllocationInstruction *msg) const
 
virtual bool operator() (const class ListCancelRequest *msg) const
 
virtual bool operator() (const class ListExecute *msg) const
 
virtual bool operator() (const class ListStatusRequest *msg) const
 
virtual bool operator() (const class ListStatus *msg) const
 
virtual bool operator() (const class AllocationInstructionAck *msg) const
 
virtual bool operator() (const class DontKnowTrade *msg) const
 
virtual bool operator() (const class QuoteRequest *msg) const
 
virtual bool operator() (const class Quote *msg) const
 
virtual bool operator() (const class SettlementInstructions *msg) const
 
virtual bool operator() (const class MarketDataRequest *msg) const
 
virtual bool operator() (const class MarketDataSnapshotFullRefresh *msg) const
 
virtual bool operator() (const class MarketDataIncrementalRefresh *msg) const
 
virtual bool operator() (const class MarketDataRequestReject *msg) const
 
virtual bool operator() (const class QuoteCancel *msg) const
 
virtual bool operator() (const class QuoteStatusRequest *msg) const
 
virtual bool operator() (const class MassQuoteAcknowledgement *msg) const
 
virtual bool operator() (const class SecurityDefinitionRequest *msg) const
 
virtual bool operator() (const class SecurityDefinition *msg) const
 
virtual bool operator() (const class SecurityStatusRequest *msg) const
 
virtual bool operator() (const class SecurityStatus *msg) const
 
virtual bool operator() (const class TradingSessionStatusRequest *msg) const
 
virtual bool operator() (const class TradingSessionStatus *msg) const
 
virtual bool operator() (const class MassQuote *msg) const
 
virtual bool operator() (const class BusinessMessageReject *msg) const
 
virtual bool operator() (const class BidRequest *msg) const
 
virtual bool operator() (const class BidResponse *msg) const
 
virtual bool operator() (const class ListStrikePrice *msg) const
 
virtual bool operator() (const class RegistrationInstructions *msg) const
 
virtual bool operator() (const class RegistrationInstructionsResponse *msg) const
 
virtual bool operator() (const class OrderMassCancelRequest *msg) const
 
virtual bool operator() (const class OrderMassCancelReport *msg) const
 
virtual bool operator() (const class NewOrderCross *msg) const
 
virtual bool operator() (const class CrossOrderCancelReplaceRequest *msg) const
 
virtual bool operator() (const class CrossOrderCancelRequest *msg) const
 
virtual bool operator() (const class SecurityTypeRequest *msg) const
 
virtual bool operator() (const class SecurityTypes *msg) const
 
virtual bool operator() (const class SecurityListRequest *msg) const
 
virtual bool operator() (const class SecurityList *msg) const
 
virtual bool operator() (const class DerivativeSecurityListRequest *msg) const
 
- Public Member Functions inherited from FIX8::Router
virtual ~Router ()
 Dtor. More...
 
virtual bool operator() (const Message *msg) const
 
virtual bool operator() (const Message *msg)
 
- Public Member Functions inherited from FIX8::TEX::Perf_Router
 Perf_Router ()
 
virtual ~Perf_Router ()
 
virtual bool operator() (const class Message *msg)
 
virtual bool operator() (const class Heartbeat *msg)
 
virtual bool operator() (const class TestRequest *msg)
 
virtual bool operator() (const class ResendRequest *msg)
 
virtual bool operator() (const class Reject *msg)
 
virtual bool operator() (const class SequenceReset *msg)
 
virtual bool operator() (const class Logout *msg)
 
virtual bool operator() (const class ExecutionReport *msg)
 
virtual bool operator() (const class Logon *msg)
 
virtual bool operator() (const class NewOrderSingle *msg)
 

Private Attributes

hf_session_server_session
 
myfix_session_server_session
 

Detailed Description

Example server message router. Derives from fix8 generated router class.

Your application must define a class similar to this in order to receive the appropriate callback when Message::process is called.

Definition at line 108 of file hftest.hpp.

Constructor & Destructor Documentation

tex_router_server::tex_router_server ( hf_session_server session)
inline

Ctor.

Parameters
sessionserver session

Definition at line 115 of file hftest.hpp.

115 : _session(session) {}
hf_session_server & _session
Definition: hftest.hpp:110
tex_router_server::tex_router_server ( myfix_session_server session)
inline

Ctor.

Parameters
sessionserver session

Definition at line 105 of file myfix.hpp.

105 : _session(session) {}
hf_session_server & _session
Definition: hftest.hpp:110

Member Function Documentation

bool tex_router_server::operator() ( const FIX8::TEX::NewOrderSingle msg) const
virtual

NewOrderSingle message handler. Here is where you provide your own methods for the messages you wish to handle. Only those messages that are of interest to you need to be implemented.

Parameters
msgNewOrderSingle message

Definition at line 398 of file harness.cpp.

399 {
400  return true;
401 }
bool tex_router_server::operator() ( const FIX8::TEX::NewOrderSingle msg)
virtual

NewOrderSingle message handler. Here is where you provide your own methods for the messages you wish to handle. Only those messages that are of interest to you need to be implemented.

Parameters
msgNewOrderSingle message

Definition at line 585 of file hftest.cpp.

References FIX8::MessageBase::copy_legal(), FIX8::TEX::ExecTransType_NEW(), FIX8::TEX::ExecType_NEW(), FIX8::MessageBase::get(), RandDev::getrandom(), FIX8::TEX::OrdStatus_CANCELED(), FIX8::TEX::OrdStatus_FILLED(), FIX8::TEX::OrdStatus_NEW(), FIX8::TEX::OrdStatus_PARTIALLY_FILLED(), and FIX8::TEX::OrdStatus_REJECTED().

586 {
587  static unsigned oid(0), eoid(0);
590  msg->get(qty);
591  msg->get(price);
592 
594  msg->copy_legal(er);
595 
596  ostringstream oistr;
597  oistr << "ord" << ++oid;
598  *er << new FIX8::TEX::OrderID(oistr.str())
600  unsigned ordResult(RandDev::getrandom(3));
601  switch (ordResult)
602  {
603  default:
604  case 0:
606  break;
607  case 1:
609  break;
610  case 2:
612  break;
613  }
614 
615  *er << new FIX8::TEX::LeavesQty(qty())
616  << new FIX8::TEX::CumQty(0.)
617  << new FIX8::TEX::AvgPx(0.)
618  << new FIX8::TEX::LastCapacity('5')
619  << new FIX8::TEX::ReportToExch('Y')
621  << new FIX8::TEX::ExecID(oistr.str());
622 
623  _session.send(er);
624 
625  if (ordResult == 0)
626  {
627  unsigned remaining_qty(qty()), cum_qty(0);
628  while (remaining_qty > 0)
629  {
630  unsigned trdqty(1 + RandDev::getrandom(remaining_qty));
631  remaining_qty -= trdqty;
632  cum_qty += trdqty;
634  msg->copy_legal(ner);
635  ostringstream eistr;
636  eistr << "exec" << ++eoid;
637 
638  *ner << new FIX8::TEX::ExecID(eistr.str())
639  << new FIX8::TEX::OrderID(oistr.str())
642  << new FIX8::TEX::LeavesQty(remaining_qty)
643  << new FIX8::TEX::CumQty(cum_qty)
645  << new FIX8::TEX::AvgPx(price());
646 
647  _session.send(ner);
648  }
649  }
650 
651  return true;
652 }
Field< Qty, 14 > CumQty
const char ExecTransType_NEW('0')
static T getrandom(const T range=0)
Definition: hftest.hpp:219
Field< char, 39 > OrdStatus
ExecutionReport (8), application, 326 fields, 16 groups.
Field< Boolean, 113 > ReportToExch
F8API unsigned copy_legal(MessageBase *to, bool force=false) const
Definition: message.cpp:275
const char OrdStatus_FILLED('2')
bool get(T &to) const
Definition: message.hpp:671
virtual F8API bool send(Message *msg, bool destroy=true, const unsigned custom_seqnum=0, const bool no_increment=false)
Definition: session.cpp:978
hf_session_server & _session
Definition: hftest.hpp:110
Field< char, 20 > ExecTransType
Definition: Perf_types.hpp:122
Field< price, 6 > AvgPx
Definition: Myfix_types.hpp:83
const char OrdStatus_CANCELED('4')
Field template. There will ONLY be partial template specialisations of this template.
Definition: field.hpp:256
Field< char, 29 > LastCapacity
const char OrdStatus_PARTIALLY_FILLED('1')
Field< f8String, 37 > OrderID
const char OrdStatus_REJECTED('8')
const char OrdStatus_NEW('0')
const char ExecType_NEW('0')
Field< Qty, 151 > LeavesQty
Field< f8String, 17 > ExecID
fp_type price
Definition: field.hpp:2024

Member Data Documentation

myfix_session_server& tex_router_server::_session
private

Definition at line 100 of file myfix.hpp.

hf_session_server& tex_router_server::_session
private

Definition at line 110 of file hftest.hpp.


The documentation for this class was generated from the following files: