Skip to content

Commit

Permalink
Merge pull request #163 from timkpaine/tkp/lints
Browse files Browse the repository at this point in the history
Fix lints changed by auto fixer
  • Loading branch information
timkpaine committed Nov 27, 2021
2 parents e0eeffd + c86b90b commit 257c2c7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
15 changes: 12 additions & 3 deletions aat/cpp/include/aat/core/order_book/order_book.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,18 @@ namespace core {

void setCallback(std::function<void(std::shared_ptr<Event>)> callback);

Instrument getInstrument() const { return instrument; }
ExchangeType getExchange() const { return exchange; }
std::function<void(std::shared_ptr<Event>)> getCallback() const { return callback; }
Instrument
getInstrument() const {
return instrument;
}
ExchangeType
getExchange() const {
return exchange;
}
std::function<void(std::shared_ptr<Event>)>
getCallback() const {
return callback;
}

void reset();

Expand Down
6 changes: 2 additions & 4 deletions aat/cpp/include/aat/python/binding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ PYBIND11_MODULE(binding, m) {
.def(py::init<Instrument&, ExchangeType&>())
.def(py::init<Instrument&, ExchangeType&, std::function<void(std::shared_ptr<Event>)>>())
.def("__repr__", &OrderBook::toString)
.def(
"__iter__", [](const OrderBook& o) { return py::make_iterator(o.begin(), o.end()); },
.def("__iter__", [](const OrderBook& o) { return py::make_iterator(o.begin(), o.end()); },
py::keep_alive<0, 1>()) /* Essential: keep object alive while iterator exists */
.def("setCallback", &OrderBook::setCallback)
.def_property("instrument", &OrderBook::getInstrument, nullptr)
Expand All @@ -122,8 +121,7 @@ PYBIND11_MODULE(binding, m) {
******************************/
py::class_<PriceLevel>(m, "_PriceLevelCpp")
.def(py::init<double, Collector&>())
.def(
"__iter__", [](const PriceLevel& pl) { return py::make_iterator(pl.cbegin(), pl.cend()); },
.def("__iter__", [](const PriceLevel& pl) { return py::make_iterator(pl.cbegin(), pl.cend()); },
py::keep_alive<0, 1>()) /* Essential: keep object alive while iterator exists */
.def("__getitem__", &PriceLevel::operator[])
.def("__bool__", &PriceLevel::operator bool)
Expand Down
6 changes: 3 additions & 3 deletions aat/cpp/src/core/order_book/order_book.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace aat {
namespace core {

OrderBookIterator&
OrderBookIterator::operator++() {
OrderBookIterator& OrderBookIterator::operator++() {
// TODO

return *this;
Expand Down Expand Up @@ -45,7 +44,8 @@ namespace core {
collector.setCallback(callback);
}

void OrderBook::reset() {
void
OrderBook::reset() {
buy_levels = std::vector<double>();
sell_levels = std::vector<double>();
buys = std::unordered_map<double, std::shared_ptr<PriceLevel>>();
Expand Down

0 comments on commit 257c2c7

Please sign in to comment.