Skip to content

Commit

Permalink
Collapse "helix::core" namespace to top-level "helix" namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
penberg committed May 7, 2016
1 parent 1726c1c commit 7930cf2
Show file tree
Hide file tree
Showing 22 changed files with 63 additions and 82 deletions.
6 changes: 1 addition & 5 deletions include/helix/helix.hh
Expand Up @@ -29,8 +29,6 @@ public:
{ }
};

namespace core {

enum class trade_sign {
buyer_initiated,
seller_initiated,
Expand Down Expand Up @@ -99,7 +97,7 @@ public:

virtual void subscribe(const std::string& symbol, size_t max_orders) = 0;

virtual void register_callback(core::event_callback callback) = 0;
virtual void register_callback(event_callback callback) = 0;

virtual size_t process_packet(const net::packet_view& packet) = 0;
};
Expand All @@ -110,5 +108,3 @@ public:
};

}

}
6 changes: 3 additions & 3 deletions include/helix/nasdaq/binaryfile.hh
Expand Up @@ -20,7 +20,7 @@ namespace helix {
namespace nasdaq {

template<typename Handler>
class binaryfile_session : public core::session {
class binaryfile_session : public session {
Handler _handler;
public:
explicit binaryfile_session(void* data);
Expand All @@ -29,7 +29,7 @@ public:

virtual void subscribe(const std::string& symbol, size_t max_orders) override;

virtual void register_callback(core::event_callback callback) override;
virtual void register_callback(event_callback callback) override;

virtual size_t process_packet(const net::packet_view& packet) override;
};
Expand All @@ -53,7 +53,7 @@ void binaryfile_session<Handler>::subscribe(const std::string& symbol, size_t ma
}

template<typename Handler>
void binaryfile_session<Handler>::register_callback(core::event_callback callback)
void binaryfile_session<Handler>::register_callback(event_callback callback)
{
_handler.register_callback(callback);
}
Expand Down
8 changes: 4 additions & 4 deletions include/helix/nasdaq/itch50_handler.hh
Expand Up @@ -29,9 +29,9 @@ namespace nasdaq {
class itch50_handler {
private:
//! Callback function for processing events.
core::event_callback _process_event;
event_callback _process_event;
//! A map of order books by order book ID.
std::unordered_map<uint64_t, helix::core::order_book> order_book_id_map;
std::unordered_map<uint64_t, helix::order_book> order_book_id_map;
//! A set of symbols that we are interested in.
std::set<std::string> _symbols;
//! A map of pre-allocation size by symbol.
Expand All @@ -40,7 +40,7 @@ public:
itch50_handler();
bool is_rth_timestamp(uint64_t timestamp) const;
void subscribe(std::string sym, size_t max_orders);
void register_callback(core::event_callback callback);
void register_callback(event_callback callback);
size_t process_packet(const net::packet_view& packet);
private:
template<typename T>
Expand All @@ -66,7 +66,7 @@ private:
void process_msg(const itch50_noii* m);
void process_msg(const itch50_rpii* m);
//! Generate a sweep event if execution cleared a price level.
core::event_mask sweep_event(const core::execution&) const;
event_mask sweep_event(const execution&) const;
};

}
Expand Down
4 changes: 2 additions & 2 deletions include/helix/nasdaq/itch50_protocol.hh
Expand Up @@ -8,12 +8,12 @@ namespace helix {

namespace nasdaq {

class itch50_protocol : public core::protocol {
class itch50_protocol : public protocol {
std::string _name;
public:
explicit itch50_protocol(std::string name);
static bool supports(const std::string& name);
virtual core::session* new_session(void *) override;
virtual session* new_session(void *) override;
};

}
Expand Down
6 changes: 3 additions & 3 deletions include/helix/nasdaq/moldudp.hh
Expand Up @@ -28,7 +28,7 @@ namespace helix {
namespace nasdaq {

template<typename Handler>
class moldudp_session : public core::session {
class moldudp_session : public session {
Handler _handler;
uint32_t _seq_num;
public:
Expand All @@ -38,7 +38,7 @@ public:

virtual void subscribe(const std::string& symbol, size_t max_orders) override;

virtual void register_callback(core::event_callback callback) override;
virtual void register_callback(event_callback callback) override;

virtual size_t process_packet(const net::packet_view& packet) override;

Expand All @@ -64,7 +64,7 @@ void moldudp_session<Handler>::subscribe(const std::string& symbol, size_t max_o
}

template<typename Handler>
void moldudp_session<Handler>::register_callback(core::event_callback callback)
void moldudp_session<Handler>::register_callback(event_callback callback)
{
_handler.register_callback(callback);
}
Expand Down
6 changes: 3 additions & 3 deletions include/helix/nasdaq/moldudp64.hh
Expand Up @@ -21,7 +21,7 @@ namespace helix {
namespace nasdaq {

template<typename Handler>
class moldudp64_session : public core::session {
class moldudp64_session : public session {
Handler _handler;
uint64_t _seq_num;
public:
Expand All @@ -31,7 +31,7 @@ public:

virtual void subscribe(const std::string& symbol, size_t max_orders) override;

virtual void register_callback(core::event_callback callback) override;
virtual void register_callback(event_callback callback) override;

virtual size_t process_packet(const net::packet_view& packet) override;
};
Expand All @@ -56,7 +56,7 @@ void moldudp64_session<Handler>::subscribe(const std::string& symbol, size_t max
}

template<typename Handler>
void moldudp64_session<Handler>::register_callback(core::event_callback callback)
void moldudp64_session<Handler>::register_callback(event_callback callback)
{
_handler.register_callback(callback);
}
Expand Down
10 changes: 5 additions & 5 deletions include/helix/nasdaq/nordic_itch_handler.hh
Expand Up @@ -39,11 +39,11 @@ class nordic_itch_handler {
//! Milliseconds since @time_sec.
uint64_t time_msec;
//! Callback function for processing events.
core::event_callback _process_event;
event_callback _process_event;
//! A map of order books by order book ID.
std::unordered_map<uint64_t, helix::core::order_book> order_book_id_map;
std::unordered_map<uint64_t, helix::order_book> order_book_id_map;
//! A map of order books by order ID.
std::unordered_map<uint64_t, helix::core::order_book&> order_id_map;
std::unordered_map<uint64_t, helix::order_book&> order_id_map;
//! A set of symbols that we are interested in.
std::set<std::string> _symbols;
//! A map of pre-allocation size by symbol.
Expand All @@ -52,7 +52,7 @@ public:
nordic_itch_handler();
bool is_rth_timestamp(uint64_t timestamp) const;
void subscribe(std::string sym, size_t max_orders);
void register_callback(core::event_callback callback);
void register_callback(event_callback callback);
size_t process_packet(const net::packet_view& packet);
private:
template<typename T>
Expand All @@ -74,7 +74,7 @@ private:
void process_msg(const itch_broken_trade* m);
void process_msg(const itch_noii* m);
//! Generate a sweep event if execution cleared a price level.
core::event_mask sweep_event(const core::execution&) const;
event_mask sweep_event(const execution&) const;
//! Timestamp in milliseconds
uint64_t timestamp() const;
};
Expand Down
4 changes: 2 additions & 2 deletions include/helix/nasdaq/nordic_itch_protocol.hh
Expand Up @@ -8,12 +8,12 @@ namespace helix {

namespace nasdaq {

class nordic_itch_protocol : public core::protocol {
class nordic_itch_protocol : public protocol {
std::string _name;
public:
static bool supports(const std::string& name);
explicit nordic_itch_protocol(std::string name);
virtual core::session* new_session(void *) override;
virtual session* new_session(void *) override;
};

}
Expand Down
6 changes: 3 additions & 3 deletions include/helix/nasdaq/soupfile.hh
Expand Up @@ -18,7 +18,7 @@ namespace helix {
namespace nasdaq {

template<typename Handler>
class soupfile_session : public core::session {
class soupfile_session : public session {
Handler _handler;
public:
explicit soupfile_session(void* data);
Expand All @@ -27,7 +27,7 @@ public:

virtual void subscribe(const std::string& symbol, size_t max_orders) override;

virtual void register_callback(core::event_callback callback) override;
virtual void register_callback(event_callback callback) override;

virtual size_t process_packet(const net::packet_view& packet) override;
};
Expand All @@ -51,7 +51,7 @@ void soupfile_session<Handler>::subscribe(const std::string& symbol, size_t max_
}

template<typename Handler>
void soupfile_session<Handler>::register_callback(core::event_callback callback)
void soupfile_session<Handler>::register_callback(event_callback callback)
{
_handler.register_callback(callback);
}
Expand Down
4 changes: 0 additions & 4 deletions include/helix/order_book.hh
Expand Up @@ -21,8 +21,6 @@

namespace helix {

namespace core {

/// \addtogroup order-book
/// @{

Expand Down Expand Up @@ -167,5 +165,3 @@ private:
/// @}

}

}
10 changes: 5 additions & 5 deletions include/helix/parity/pmd_handler.hh
Expand Up @@ -26,11 +26,11 @@ namespace parity {
//
class pmd_handler {
//! Callback function for processing events.
core::event_callback _process_event;
event_callback _process_event;
//! A map of order books by order book ID.
std::unordered_map<std::string, helix::core::order_book> _order_book_id_map;
std::unordered_map<std::string, helix::order_book> _order_book_id_map;
//! A map of order books by order ID.
std::unordered_map<uint64_t, helix::core::order_book&> _order_id_map;
std::unordered_map<uint64_t, helix::order_book&> _order_id_map;
//! A set of symbols that we are interested in.
std::set<std::string> _symbols;
//! Number of seconds since midnight when the trading session started.
Expand All @@ -39,7 +39,7 @@ public:
pmd_handler();
bool is_rth_timestamp(uint64_t timestamp) const;
void subscribe(std::string sym, size_t max_orders);
void register_callback(core::event_callback callback);
void register_callback(event_callback callback);
size_t process_packet(const net::packet_view& packet);
private:
template<typename T>
Expand All @@ -52,7 +52,7 @@ private:
void process_msg(const pmd_order_deleted* m);
void process_msg(const pmd_broken_trade* m);
//! Generate a sweep event if execution cleared a price level.
core::event_mask sweep_event(const core::execution&) const;
event_mask sweep_event(const execution&) const;
uint64_t to_timestamp(uint64_t nanoseconds) const;
};

Expand Down
4 changes: 2 additions & 2 deletions include/helix/parity/pmd_protocol.hh
Expand Up @@ -11,13 +11,13 @@ namespace helix {

namespace parity {

class pmd_protocol : public core::protocol {
class pmd_protocol : public protocol {
std::string _name;
public:
static bool supports(const std::string& name);

explicit pmd_protocol(std::string name);
virtual core::session* new_session(void *) override;
virtual session* new_session(void *) override;
};

}
Expand Down
4 changes: 0 additions & 4 deletions src/event.cc
Expand Up @@ -2,8 +2,6 @@

namespace helix {

namespace core {

event::event(event_mask mask, uint64_t timestamp, order_book* ob, trade* t)
: _mask{mask}
, _timestamp{timestamp}
Expand Down Expand Up @@ -48,5 +46,3 @@ event make_trade_event(uint64_t timestamp, trade* t, event_mask mask)
}

}

}

0 comments on commit 7930cf2

Please sign in to comment.