![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The compile-time check behind ATL_ASSERT_BROKER(Client). More...
Classes | |
| struct | PlainCallback |
| A completion handler with no associated executor (a plain callback). More... | |
| struct | MoveOnlyCallback |
| A plain callback that cannot be copied. More... | |
Functions | |
| InstrumentId | probe_instrument () |
| Returns the placeholder instrument the checks call operations with. | |
| template<typename Client, typename Token> | |
| void | call_claimed_async_verbs (BrokerSession< Client > &session, const typename BrokerSession< Client >::Ref &ref) |
| Calls every operation an asynchronous session's capabilities claim; compiled, never run. | |
| template<typename Client> | |
| void | call_claimed_blocking_verbs (BlockingSession< Client > &session, const typename BlockingSession< Client >::Ref &ref) |
| Calls every operation a blocking session's capabilities claim; compiled, never run. | |
| template<typename Client> | |
| constexpr bool | claimed_verbs_compile () |
| Compiles the operation checks for a client. | |
The compile-time check behind ATL_ASSERT_BROKER(Client).
It calls every operation the client's capabilities claim, through a real session, with a plain callback, a move-only callback and use_future (or directly, for a blocking client), and reads every capability constant. Nothing runs. A missing member, a thunk with the wrong signature or one that copies its completion token, or an unanswered capability fails the build with the compiler's own message. Assert it once, in any one source file (a test is a good place):
It cannot prove run-time behaviour: that an asynchronous call completes exactly once and on the right executor, or that a claimed capability is true of the broker.
| void algotradelib::conformance::call_claimed_async_verbs | ( | BrokerSession< Client > & | session, |
| const typename BrokerSession< Client >::Ref & | ref ) |
Calls every operation an asynchronous session's capabilities claim; compiled, never run.
| Client | The broker client type. |
| Token | The completion token type; a fresh one is moved into each call. |
| session | The session. |
| ref | An order reference. |
Definition at line 79 of file broker_verbs.hpp.
Referenced by call_claimed_async_verbs(), and claimed_verbs_compile().
| void algotradelib::conformance::call_claimed_blocking_verbs | ( | BlockingSession< Client > & | session, |
| const typename BlockingSession< Client >::Ref & | ref ) |
Calls every operation a blocking session's capabilities claim; compiled, never run.
| Client | The broker client type. |
| session | The session. |
| ref | An order reference. |
Definition at line 135 of file broker_verbs.hpp.
Referenced by call_claimed_blocking_verbs(), and claimed_verbs_compile().
|
constexpr |
Compiles the operation checks for a client.
| Client | The broker client type. |
Definition at line 191 of file broker_verbs.hpp.
Referenced by claimed_verbs_compile().
|
inline |
Returns the placeholder instrument the checks call operations with.
Definition at line 69 of file broker_verbs.hpp.
Referenced by call_claimed_async_verbs(), call_claimed_blocking_verbs(), and probe_instrument().