1 #ifndef SG_API2_SHARED_COMMANDS_H
2 #define SG_API2_SHARED_COMMANDS_H
3 #include <sharedDefines.h>
4 #include <boost/shared_ptr.hpp>
5 #define EXCHANGE_ID_BASE 10000000
7 #define GET_SYMBOL_ID(scripCode, exchangeId) ((exchangeId)*EXCHANGE_ID_BASE + scripCode)
9 #define GET_SCRIP_CODE(symbolId) (symbolId % EXCHANGE_ID_BASE)
11 #define GET_EXCHANGE_ID(symbolId) ((CMD::ExchangeId)(symbolId/EXCHANGE_ID_BASE))
13 #define IS_CTP_EXCHANGE(symbolId) \
14 ((GET_EXCHANGE_ID(symbolId) == CMD::ExchangeId_CTP) || \
15 (GET_EXCHANGE_ID(symbolId) == CMD::ExchangeId_CTP_CFFEX) || \
16 (GET_EXCHANGE_ID(symbolId) == CMD::ExchangeId_CTP_CZCE) || \
17 (GET_EXCHANGE_ID(symbolId) == CMD::ExchangeId_CTP_DCE) || \
18 (GET_EXCHANGE_ID(symbolId) == CMD::ExchangeId_CTP_SHFE))
25 char _Account[ACCOUNT_FIELD_SIZE];
26 SIGNED_LONG _TraderId;
27 UNSIGNED_LONG _LocationId;
28 UNSIGNED_CHARACTER _AccountType;
32 std::string dump()
const;
37 const UNSIGNED_LONG &locationId,
38 const SIGNED_LONG &traderId
41 void initialize(
const char *account,
43 const UNSIGNED_LONG &locationId,
44 const SIGNED_LONG &traderId
46 void setAccountId(
const char *accountId);
47 void setAccountType(
char type);
48 void setLocationId(UNSIGNED_LONG locationId);
49 void setTraderId(SIGNED_LONG traderId);
51 const char *getAccountId()
const;
52 const char getAccountType()
const;
53 SIGNED_LONG getTraderId()
const;
54 UNSIGNED_LONG getLocationId()
const;
Definition: sharedCommands.h:23