# My Project: Algo Class Reference

Loading...
Searching...
No Matches
Algo Class Reference

`#include <Algo.hh>`

Collaboration diagram for Algo:

## Public Member Functions

| Algo ()
void | initialize ()
void | generate_orders ()
void | process ()
void | send (trading::Order &)
bool | initialized ()
void | stop ()

## Private Attributes

std::queue< trading::Order > | _orders
std::atomic< bool > | _initialized {false}
std::atomic< bool > | _running {false}
std::shared_ptr< Publisher > | _pub
utils::ThreadSafeQueue< trading::Order > | _order_queue
utils::ThreadPool | _thread_pool
std::mutex | _send_mutex
std::jthread | _reader_thread
std::vector< std::jthread > | _worker_threads
std::vector< std::future< bool > > | _futures

## Constructor & Destructor Documentation

## Algo()

Algo::Algo | ( |  | ) |

## Member Function Documentation

## generate_orders()

void Algo::generate_orders | ( |  | ) |

References _orders, and readers::json::read_orders_from_json().

Here is the call graph for this function:

## initialize()

void Algo::initialize | ( |  | ) |

References _initialized, and _pub.

## initialized()

bool Algo::initialized | ( |  | ) |

References _initialized.

## process()

void Algo::process | ( |  | ) |

References _futures, _order_queue, _pub, _reader_thread, _send_mutex, _thread_pool, _worker_threads, and readers::json::read_orders_from_json().

Here is the call graph for this function:

## send()

void Algo::send | ( | trading::Order & | order | ) |

References _pub.

## stop()

void Algo::stop | ( |  | ) |

References _futures, _reader_thread, and _worker_threads.

## Member Data Documentation

## _futures

std::vector<std::future<bool> > Algo::_futures

private

Referenced by process(), and stop().

## _initialized

std::atomic<bool> Algo::_initialized {false}

private

Referenced by initialize(), and initialized().

## _order_queue

utils::ThreadSafeQueue<trading::Order> Algo::_order_queue

private

Referenced by process().

## _orders

std::queue<trading::Order> Algo::_orders

private

Referenced by generate_orders().

## _pub

std::shared_ptr<Publisher> Algo::_pub

private

Referenced by initialize(), process(), and send().

## _reader_thread

std::jthread Algo::_reader_thread

private

Referenced by process(), and stop().

## _running

std::atomic<bool> Algo::_running {false}

private

## _send_mutex

std::mutex Algo::_send_mutex

private

Referenced by process().

## _thread_pool

utils::ThreadPool Algo::_thread_pool

private

Referenced by process().

## _worker_threads

std::vector<std::jthread> Algo::_worker_threads

private

Referenced by process(), and stop().

The documentation for this class was generated from the following files:

- include/Algo.hh
- src/Algo.cc