Skip to content

Commit

Permalink
Reduce template arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamtheschmitzer committed Apr 8, 2013
1 parent e866289 commit ffa8226
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/book/bbo_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
namespace liquibook { namespace book {

/// @brief generic listener of top-of-book events
template <class OrderBook, class DepthTracker >
template <class OrderBook>
class BboListener {
public:
/// @brief callback for top of book change
virtual void on_bbo_change(const OrderBook* book,
const DepthTracker* depth) = 0;
virtual void on_bbo_change(
const OrderBook* book,
const typename OrderBook::DepthTracker* depth) = 0;
};

} }
Expand Down
7 changes: 4 additions & 3 deletions src/book/depth_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
namespace liquibook { namespace book {

/// @brief listener of depth events
template <class OrderBook, class DepthTracker >
template <class OrderBook>
class DepthListener {
public:
/// @brief callback for change in tracked aggregated depth
virtual void on_depth_change(const OrderBook* book,
const DepthTracker* depth) = 0;
virtual void on_depth_change(
const OrderBook* book,
const typename OrderBook::DepthTracker* depth) = 0;
};

} }
Expand Down
4 changes: 2 additions & 2 deletions src/book/depth_order_book.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class DepthOrderBook : public OrderBook<OrderPtr> {
public:
typedef Depth<SIZE> DepthTracker;
typedef DepthOrderBook<OrderPtr, SIZE> MyClass;
typedef BboListener<MyClass, DepthTracker > TypedBboListener;
typedef DepthListener<MyClass, DepthTracker > TypedDepthListener;
typedef BboListener<MyClass > TypedBboListener;
typedef DepthListener<MyClass > TypedDepthListener;
typedef Callback<OrderPtr> DobCallback;

/// @brief construct
Expand Down

0 comments on commit ffa8226

Please sign in to comment.