![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Where blocking broker clients share a market's trading calendar, across threads and processes. More...
#include <algotradelib/src/network/calendar_cache.hpp>
Public Member Functions | |
| virtual Result< std::optional< TradingCalendar > > | load (const std::string &name)=0 |
| Reads the calendar stored under a name. | |
| virtual std::optional< BrokerError > | publish (const std::string &name, const TradingCalendar &calendar)=0 |
| Stores a calendar under a name, replacing what was stored. | |
Where blocking broker clients share a market's trading calendar, across threads and processes.
Give one to KisBlockingClient: KIS asks that its holiday inquiry be made at most once a day, and one inquiry takes up to 20 pages. The client reuses a stored calendar received on the same day in Seoul; see KisBlockingClient::calendar.
Each function returns storage failures, rather than throwing them, as calendar_cache_error (an allocation can still throw). Stored contents that cannot be read as a calendar are no calendar, not an error. received_at_ is stored and returned as given. An implementation must allow calls from several threads at once.
Definition at line 23 of file calendar_cache.hpp.
|
pure virtual |
Reads the calendar stored under a name.
| name | The name, such as kis-kr. |
Implemented in algotradelib::network::FileCalendarCache.
|
pure virtual |
Stores a calendar under a name, replacing what was stored.
| name | The name. |
| calendar | The calendar. |
Implemented in algotradelib::network::FileCalendarCache.