Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
FIX: move redundant functionality out of scope
Browse files Browse the repository at this point in the history
Certain functionality could almost never be applied
directly. It is either venue specific or brings so
little value that it is very unlikely to be used at
all. Keeping such functionality as a part of the
library code is very confusing as it shadows another
part which really brings the value and does all the
vital job.

This patch should introduce a series of changes that
are supposed to restructure libtrading FIX code and
make it clear.

The general idea is to divide the whole functionality
into two parts - the core, a higly optimized part
applicable to everybody's needs as is i.e. without
any modification; and the so called general part -
functionality applicable to the general FIX engine
i.e. the one which follows vanilla FIX specification.
One can think of the latter part in two different ways:
either as an API to some ideal (not necessary existent)
FIX engine or as a reference for anyone who wants to
implement their own real application. Following this
idea the patch moves a part of the FIX functionality
under the '/tools' which is considered to be a place
for examples and very often replace documentation
which we lack of at the moment. If we decide that
certain functionality is not a part a core anymore,
we will factor it out as well. We will keep it under
the '/tools' until the next step is done.

The next step is to extend dialect data structure
with operations which trading venues support in real
life e.g. logon, logout, test request etc

We would then provide a basic implementation of those
methods which users are free to rewrite. It would
prevent code duplicate on the one hand and makes it
very clear to users what they need to implement.

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
  • Loading branch information
mstanichenko committed Jul 26, 2015
1 parent fe21a82 commit 3cc4274
Show file tree
Hide file tree
Showing 10 changed files with 473 additions and 460 deletions.
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -89,6 +89,7 @@ DEFINES =
INCLUDES += $(shell sh -c 'xml2-config --cflags')
INCLUDES += $(shell sh -c 'pkg-config --cflags glib-2.0')
INCLUDES += -Ilib/stringencoders
INCLUDES += -Itools/include

EXTRA_LIBS += $(shell sh -c 'xml2-config --libs')
EXTRA_LIBS += $(shell sh -c 'pkg-config --libs glib-2.0')$
Expand All @@ -115,16 +116,20 @@ endif

market_EXTRA_DEPS += lib/die.o
market_EXTRA_DEPS += tools/sim/engine.o
market_EXTRA_DEPS += tools/fix/fix_common.o
market_EXTRA_LIBS += -lm

trader_EXTRA_DEPS += lib/die.o
trader_EXTRA_DEPS += tools/fix/fix_common.o

fix_client_EXTRA_DEPS += lib/die.o
fix_client_EXTRA_DEPS += tools/fix/test.o
fix_client_EXTRA_DEPS += tools/fix/fix_common.o
fix_client_EXTRA_LIBS += -lm

fix_server_EXTRA_DEPS += lib/die.o
fix_server_EXTRA_DEPS += tools/fix/test.o
fix_server_EXTRA_DEPS += tools/fix/fix_common.o

fast_client_EXTRA_DEPS += lib/die.o
fast_client_EXTRA_DEPS += tools/fast/test.o
Expand All @@ -137,6 +142,7 @@ fast_parser_EXTRA_DEPS += lib/die.o
fast_parser_EXTRA_DEPS += tools/fast/test.o

forts_EXTRA_DEPS += lib/die.o
forts_EXTRA_DEPS += tools/fix/fix_common.o

tape_EXTRA_DEPS += tools/tape/builtin-check.o

Expand Down
13 changes: 0 additions & 13 deletions include/libtrading/proto/fix_session.h
Expand Up @@ -104,19 +104,6 @@ int fix_session_time_update_realtime(struct fix_session *self, struct timespec *
int fix_session_time_update(struct fix_session *self);
int fix_session_send(struct fix_session *self, struct fix_message *msg, unsigned long flags);
int fix_session_recv(struct fix_session *self, struct fix_message **msg, unsigned long flags);
bool fix_session_keepalive(struct fix_session *session, struct timespec *now);
bool fix_session_admin(struct fix_session *session, struct fix_message *msg);
int fix_session_logon(struct fix_session *session);
int fix_session_logout(struct fix_session *session, const char *text);
int fix_session_heartbeat(struct fix_session *session, const char *test_req_id);
int fix_session_test_request(struct fix_session *session);
int fix_session_resend_request(struct fix_session *session, unsigned long bgn, unsigned long end);
int fix_session_reject(struct fix_session *session, unsigned long refseqnum, char *text);
int fix_session_sequence_reset(struct fix_session *session, unsigned long msg_seq_num, unsigned long new_seq_num, bool gap_fill);
int fix_session_order_cancel_request(struct fix_session *session, struct fix_field *fields, long nr_fields);
int fix_session_order_cancel_replace(struct fix_session *session, struct fix_field *fields, long nr_fields);
int fix_session_new_order_single(struct fix_session *session, struct fix_field* fields, long nr_fields);
int fix_session_execution_report(struct fix_session *session, struct fix_field *fields, long nr_fields);

enum fix_send_flag {
FIX_SEND_FLAG_PRESERVE_MSG_NUM = 1UL << 0, // lower 16 bits
Expand Down

0 comments on commit 3cc4274

Please sign in to comment.