Skip to content

Commit

Permalink
Rename impl namespace to be simple. (Impl implies 'hidden implementat…
Browse files Browse the repository at this point in the history
…ion details'.)
  • Loading branch information
Dale Wilson committed Feb 20, 2017
1 parent be49052 commit a73032c
Show file tree
Hide file tree
Showing 23 changed files with 107 additions and 107 deletions.
4 changes: 2 additions & 2 deletions examples/depth_feed_publisher/depth_feed_publisher.mpc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

project(depth_feed_publisher) : QuickFASTApplication, liquibook_book, liquibook_impl, liquibook_exe {
project(depth_feed_publisher) : QuickFASTApplication, liquibook_book, liquibook_simple, liquibook_exe {
requires += example_pubsub
Source_Files {
publisher_main.cpp
Expand All @@ -13,7 +13,7 @@ project(depth_feed_publisher) : QuickFASTApplication, liquibook_book, liquibook_
exename = *
}

project(depth_feed_subscriber) : QuickFASTApplication, liquibook_book, liquibook_impl, liquibook_exe {
project(depth_feed_subscriber) : QuickFASTApplication, liquibook_book, liquibook_simple, liquibook_exe {
requires += example_pubsub
Source_Files {
subscriber_main.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/mt_order_entry/mt_order_entry.mpc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2017 Object Computing, Inc.
// All rights reserved.
// See the file license.txt for licensing information.
project(*) : liquibook_book, liquibook_impl, liquibook_exe {
project(*) : liquibook_book, liquibook_simple, liquibook_exe {
requires += example_manual
exename = *
}
5 changes: 0 additions & 5 deletions mpc/liquibook_impl.mpb

This file was deleted.

5 changes: 5 additions & 0 deletions mpc/liquibook_simple.mpb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project : liquibook {
libs += liquibook_simple
after += liquibook_simple
}

2 changes: 1 addition & 1 deletion mpc/liquibook_test.mpb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
project : liquibook, liquibook_exe, liquibook_book, liquibook_impl{
project : liquibook, liquibook_exe, liquibook_book, liquibook_simple{
exeout = $(LIQUIBOOK_ROOT)/bin/test
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/impl/simple_order.cpp → src/simple/simple_order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <iostream>

namespace liquibook { namespace impl {
namespace liquibook { namespace simple {

uint32_t SimpleOrder::last_order_id_(0);

Expand Down
2 changes: 1 addition & 1 deletion src/impl/simple_order.h → src/simple/simple_order.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "book/order.h"
#include "book/types.h"

namespace liquibook { namespace impl {
namespace liquibook { namespace simple {

enum OrderState {
os_new,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "book/depth_order_book.h"
#include <iostream>

namespace liquibook { namespace impl {
namespace liquibook { namespace simple {

// @brief binding of DepthOrderBook template with SimpleOrder* order pointer.
template <int SIZE = 5>
Expand Down
2 changes: 1 addition & 1 deletion test/latency/liquibook_latency.mpc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
project (lt_order_book) : liquibook_book, liquibook_impl, liquibook_test {
project (lt_order_book) : liquibook_book, liquibook_simple, liquibook_test {
exename = *
}
12 changes: 6 additions & 6 deletions test/latency/lt_order_book.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2012, 2013 Object Computing, Inc.
// All rights reserved.
// See the file license.txt for licensing information.
#include "impl/simple_order_book.h"
#include "simple/simple_order_book.h"
#include "book/types.h"
#include <book/clock_gettime.h>

Expand All @@ -12,9 +12,9 @@
using namespace liquibook;
using namespace liquibook::book;

typedef impl::SimpleOrderBook<5> FullDepthOrderBook;
typedef impl::SimpleOrderBook<1> BboOrderBook;
typedef book::OrderBook<impl::SimpleOrder*> NoDepthOrderBook;
typedef simple::SimpleOrderBook<5> FullDepthOrderBook;
typedef simple::SimpleOrderBook<1> BboOrderBook;
typedef book::OrderBook<simple::SimpleOrder*> NoDepthOrderBook;

void build_histogram(timespec* timestamps, int count) {
timespec* prev = nullptr;
Expand Down Expand Up @@ -82,7 +82,7 @@ int run_test(TypedOrderBook& order_book, TypedOrder** orders,
template <class TypedOrderBook>
bool build_and_run_test(uint32_t num_to_try, bool dry_run = false) {
TypedOrderBook order_book;
impl::SimpleOrder** orders = new impl::SimpleOrder*[num_to_try + 1];
simple::SimpleOrder** orders = new simple::SimpleOrder*[num_to_try + 1];
timespec* timestamps = new timespec[num_to_try + 1];

for (uint32_t i = 0; i < num_to_try; ++i) {
Expand Down Expand Up @@ -113,7 +113,7 @@ bool build_and_run_test(uint32_t num_to_try, bool dry_run = false) {
Price price = (rand() % 10) + delta;

Quantity qty = ((rand() % 10) + 1) * 100;
orders[i] = new impl::SimpleOrder(is_buy, price, qty);
orders[i] = new simple::SimpleOrder(is_buy, price, qty);
}
orders[num_to_try] = nullptr; // Final null

Expand Down
2 changes: 1 addition & 1 deletion test/perf/liquibook_perf.mpc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
project (pt_order_book) : liquibook_book, liquibook_impl, liquibook_test {
project (pt_order_book) : liquibook_book, liquibook_simple, liquibook_test {
exename = *
}
12 changes: 6 additions & 6 deletions test/perf/pt_order_book.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2012, 2013 Object Computing, Inc.
// All rights reserved.
// See the file license.txt for licensing information.
#include "impl/simple_order_book.h"
#include "simple/simple_order_book.h"
#include "book/types.h"

#include <iostream>
Expand All @@ -12,9 +12,9 @@
using namespace liquibook;
using namespace liquibook::book;

typedef impl::SimpleOrderBook<5> FullDepthOrderBook;
typedef impl::SimpleOrderBook<1> BboOrderBook;
typedef book::OrderBook<impl::SimpleOrder*> NoDepthOrderBook;
typedef simple::SimpleOrderBook<5> FullDepthOrderBook;
typedef simple::SimpleOrderBook<1> BboOrderBook;
typedef book::OrderBook<simple::SimpleOrder*> NoDepthOrderBook;

template <class TypedOrderBook, class TypedOrder>
int run_test(TypedOrderBook& order_book, TypedOrder** orders, clock_t end) {
Expand All @@ -36,7 +36,7 @@ template <class TypedOrderBook>
bool build_and_run_test(uint32_t dur_sec, uint32_t num_to_try) {
std::cout << "trying run of " << num_to_try << " orders";
TypedOrderBook order_book;
impl::SimpleOrder** orders = new impl::SimpleOrder*[num_to_try + 1];
simple::SimpleOrder** orders = new simple::SimpleOrder*[num_to_try + 1];

for (uint32_t i = 0; i <= num_to_try; ++i) {
bool is_buy((i % 2) == 0);
Expand Down Expand Up @@ -66,7 +66,7 @@ bool build_and_run_test(uint32_t dur_sec, uint32_t num_to_try) {
Price price = (rand() % 10) + delta;

Quantity qty = ((rand() % 10) + 1) * 100;
orders[i] = new impl::SimpleOrder(is_buy, price, qty);
orders[i] = new simple::SimpleOrder(is_buy, price, qty);
}
orders[num_to_try] = nullptr; // Final null

Expand Down
4 changes: 2 additions & 2 deletions test/unit/depth_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#pragma once

#include "book/order_book.h"
#include "impl/simple_order_book.h"
#include "impl/simple_order.h"
#include "simple/simple_order_book.h"
#include "simple/simple_order.h"

using namespace liquibook::book;

Expand Down
8 changes: 4 additions & 4 deletions test/unit/ut_all_or_none.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace liquibook {

using impl::SimpleOrder;
using simple::SimpleOrder;
typedef FillCheck<SimpleOrder*> SimpleFillCheck;

namespace {
Expand Down Expand Up @@ -886,7 +886,7 @@ BOOST_AUTO_TEST_CASE(TestReplaceAonBidSmallerMatch)
{
SimpleFillCheck fc2(&ask0, qty1, prc1 * qty1);
BOOST_CHECK(replace_and_verify(
order_book, &bid1, -(int32_t)qty1, PRICE_UNCHANGED, impl::os_complete, qty1));
order_book, &bid1, -(int32_t)qty1, PRICE_UNCHANGED, simple::os_complete, qty1));
}

// Verify depth
Expand Down Expand Up @@ -933,7 +933,7 @@ BOOST_AUTO_TEST_CASE(TestReplaceAonBidPriceMatch)
SimpleFillCheck fc1(&ask0, qty1, prc1 * qty1);
SimpleFillCheck fc2(&ask1, qty1, prc2 * qty1);
BOOST_CHECK(replace_and_verify(
order_book, &bid1, qtyNone, prc2, impl::os_complete, qty2));
order_book, &bid1, qtyNone, prc2, simple::os_complete, qty2));
}

// Verify depth
Expand Down Expand Up @@ -978,7 +978,7 @@ BOOST_AUTO_TEST_CASE(TestReplaceBidLargerMatchAon)
{
SimpleFillCheck fc2(&ask0, qty2, qty2 * prc1);
BOOST_CHECK(replace_and_verify(
order_book, &bid1, qty1, PRICE_UNCHANGED, impl::os_complete, qty2));
order_book, &bid1, qty1, PRICE_UNCHANGED, simple::os_complete, qty2));
}

// Verify depth
Expand Down
44 changes: 22 additions & 22 deletions test/unit/ut_bbo_order_book.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "book/depth_constants.h"
#include "changed_checker.h"
#include "book/order_book.h"
#include "impl/simple_order.h"
#include "impl/simple_order_book.h"
#include "simple/simple_order.h"
#include "simple/simple_order_book.h"
#include "depth_check.h"
#include "ut_utils.h"

Expand All @@ -20,7 +20,7 @@ namespace liquibook {
using book::DepthLevel;
using book::OrderBook;
using book::OrderTracker;
using impl::SimpleOrder;
using simple::SimpleOrder;

typedef OrderTracker<SimpleOrder*> SimpleTracker;
typedef test::ChangedChecker<5> ChangedChecker;
Expand Down Expand Up @@ -928,7 +928,7 @@ BOOST_AUTO_TEST_CASE(TestBboCancelBid)
BOOST_CHECK(dc.verify_ask(1251, 1, 100));

// Cancel bid
BOOST_CHECK(cancel_and_verify(order_book, &bid0, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid0, simple::os_cancelled));

// Verify depth
dc.reset();
Expand Down Expand Up @@ -965,7 +965,7 @@ BOOST_AUTO_TEST_CASE(TestBboCancelAskAndMatch)
BOOST_CHECK(dc.verify_ask(1251, 1, 100));

// Cancel bid
BOOST_CHECK(cancel_and_verify(order_book, &ask0, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &ask0, simple::os_cancelled));

// Verify depth
dc.reset();
Expand All @@ -985,7 +985,7 @@ BOOST_AUTO_TEST_CASE(TestBboCancelAskAndMatch)
BOOST_CHECK(dc.verify_ask( 0, 0, 0));

// Cancel bid
BOOST_CHECK(cancel_and_verify(order_book, &bid0, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid0, simple::os_cancelled));

// Verify depth
dc.reset();
Expand Down Expand Up @@ -1034,7 +1034,7 @@ BOOST_AUTO_TEST_CASE(TestBboCancelBidFail)
BOOST_CHECK(dc.verify_bid( 0, 0, 0));

// Cancel a filled order
BOOST_CHECK(cancel_and_verify(order_book, &bid0, impl::os_complete));
BOOST_CHECK(cancel_and_verify(order_book, &bid0, simple::os_complete));

// Verify depth
dc.reset();
Expand Down Expand Up @@ -1081,7 +1081,7 @@ BOOST_AUTO_TEST_CASE(TestBboCancelAskFail)
BOOST_CHECK(dc.verify_bid(1250, 1, 100));

// Cancel a filled order
BOOST_CHECK(cancel_and_verify(order_book, &ask0, impl::os_complete));
BOOST_CHECK(cancel_and_verify(order_book, &ask0, simple::os_complete));

// Verify depth
dc.reset();
Expand Down Expand Up @@ -1154,26 +1154,26 @@ BOOST_AUTO_TEST_CASE(TestBboCancelBidRestore)
BOOST_CHECK(dc.verify_ask(1250, 1, 500));

// Cancel a bid level (erase)
BOOST_CHECK(cancel_and_verify(order_book, &bid3, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid3, simple::os_cancelled));

// Verify depth
dc.reset();
BOOST_CHECK(dc.verify_bid(1249, 3, 500));
BOOST_CHECK(dc.verify_ask(1250, 1, 500));

// Cancel common bid levels (not erased)
BOOST_CHECK(cancel_and_verify(order_book, &bid7, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid4, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid7, simple::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid4, simple::os_cancelled));

// Verify depth
dc.reset();
BOOST_CHECK(dc.verify_bid(1249, 3, 500));
BOOST_CHECK(dc.verify_ask(1250, 1, 500));

// Cancel the best bid level (erased)
BOOST_CHECK(cancel_and_verify(order_book, &bid1, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid0, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid2, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid1, simple::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid0, simple::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &bid2, simple::os_cancelled));

// Verify depth
dc.reset();
Expand Down Expand Up @@ -1246,24 +1246,24 @@ BOOST_AUTO_TEST_CASE(TestBboCancelAskRestore)
BOOST_CHECK(dc.verify_ask(1250, 1, 500));

// Cancel an ask level (erase)
BOOST_CHECK(cancel_and_verify(order_book, &ask1, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &ask1, simple::os_cancelled));

// Verify depth
dc.reset();
BOOST_CHECK(dc.verify_bid(1249, 3, 500));
BOOST_CHECK(dc.verify_ask(1250, 1, 500));

// Cancel common ask levels (not erased)
BOOST_CHECK(cancel_and_verify(order_book, &ask2, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &ask6, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &ask2, simple::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &ask6, simple::os_cancelled));

// Verify depth
dc.reset();
BOOST_CHECK(dc.verify_bid(1249, 3, 500));
BOOST_CHECK(dc.verify_ask(1250, 1, 500));

// Cancel the best ask level (erased)
BOOST_CHECK(cancel_and_verify(order_book, &ask0, impl::os_cancelled));
BOOST_CHECK(cancel_and_verify(order_book, &ask0, simple::os_cancelled));

// Verify depth
dc.reset();
Expand Down Expand Up @@ -1615,7 +1615,7 @@ BOOST_AUTO_TEST_CASE(TestBboReplaceSizeDecreaseCancel)

// Replace size - cancel
BOOST_CHECK(replace_and_verify(
order_book, &ask0, -175, PRICE_UNCHANGED, impl::os_cancelled));
order_book, &ask0, -175, PRICE_UNCHANGED, simple::os_cancelled));

// Verify orders
BOOST_CHECK_EQUAL(125, ask0.order_qty());
Expand All @@ -1628,7 +1628,7 @@ BOOST_AUTO_TEST_CASE(TestBboReplaceSizeDecreaseCancel)

// Replace size - reduce level
BOOST_CHECK(replace_and_verify(
order_book, &bid1, -100, PRICE_UNCHANGED, impl::os_accepted));
order_book, &bid1, -100, PRICE_UNCHANGED, simple::os_accepted));

// Verify orders
BOOST_CHECK_EQUAL(300, bid1.order_qty());
Expand All @@ -1641,7 +1641,7 @@ BOOST_AUTO_TEST_CASE(TestBboReplaceSizeDecreaseCancel)

// Replace size - cancel and erase level
BOOST_CHECK(replace_and_verify(
order_book, &bid1, -200, PRICE_UNCHANGED, impl::os_cancelled));
order_book, &bid1, -200, PRICE_UNCHANGED, simple::os_cancelled));

// Verify orders
BOOST_CHECK_EQUAL(100, bid1.order_qty());
Expand Down Expand Up @@ -1695,7 +1695,7 @@ BOOST_AUTO_TEST_CASE(TestBboReplaceSizeDecreaseTooMuch)
// Verify ask0 state
BOOST_CHECK_EQUAL(0, ask0.open_qty());
BOOST_CHECK_EQUAL(200, ask0.order_qty());
BOOST_CHECK_EQUAL(impl::os_cancelled, ask0.state());
BOOST_CHECK_EQUAL(simple::os_cancelled, ask0.state());

// Verify depth unchanged
dc.reset();
Expand Down
2 changes: 1 addition & 1 deletion test/unit/ut_immediate_or_cancel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace liquibook {

using impl::SimpleOrder;
using simple::SimpleOrder;
typedef FillCheck<SimpleOrder*> SimpleFillCheck;

OrderConditions IOC(oc_immediate_or_cancel);
Expand Down
4 changes: 2 additions & 2 deletions test/unit/ut_listeners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#include "ut_utils.h"
#include "changed_checker.h"
#include "book/order_book.h"
#include "impl/simple_order.h"
#include "simple/simple_order.h"

namespace liquibook {

using book::OrderBook;
using impl::SimpleOrder;
using simple::SimpleOrder;

typedef SimpleOrder* OrderPtr;
typedef OrderBook<OrderPtr> TypedOrderBook;
Expand Down
Loading

0 comments on commit a73032c

Please sign in to comment.