![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
A date a broker stated, did not state, or stated in a form that could not be read. More...
#include <algotradelib/src/core/instrument.hpp>
Public Types | |
| enum class | State { NOT_STATED , STATED , UNREADABLE } |
| What the broker's field said. More... | |
Public Member Functions | |
| StatedDate ()=default | |
| Constructs a date the broker did not state. | |
| State | state () const noexcept |
| Returns what the broker's field said. | |
| const Date & | date () const |
| Returns the date. | |
Static Public Member Functions | |
| static StatedDate | stated (Date date) |
| Makes a stated date. | |
| static StatedDate | unreadable () |
| Makes an unreadable date. | |
Friends | |
| bool | operator== (const StatedDate &lhs, const StatedDate &rhs) |
| Compares two values: the same state, and the same date when stated. | |
| bool | operator!= (const StatedDate &lhs, const StatedDate &rhs) |
| Compares two values for inequality. | |
A date a broker stated, did not state, or stated in a form that could not be read.
Name the state before reading the date:
It does not convert to bool or to std::optional<Date>, so "no date" and "unreadable date" cannot be confused.
Definition at line 380 of file instrument.hpp.
|
strong |
What the broker's field said.
| Enumerator | |
|---|---|
| NOT_STATED | No date: absent, null, or the broker's empty spelling. |
| STATED | A date that was read. |
| UNREADABLE | Something that is not a readable calendar date. |
Definition at line 383 of file instrument.hpp.
|
default |
Constructs a date the broker did not state.
Referenced by operator!=, operator==, stated(), and unreadable().
|
inline |
Returns the date.
| std::logic_error | unless state() is STATED. |
Definition at line 428 of file instrument.hpp.
Referenced by algotradelib::Instrument::dates_exclude(), and stated().
|
inlinenoexcept |
Returns what the broker's field said.
Definition at line 421 of file instrument.hpp.
Referenced by algotradelib::Instrument::dates_exclude().
|
inlinestatic |
Makes a stated date.
| date | The date. |
Definition at line 400 of file instrument.hpp.
|
inlinestatic |
Makes an unreadable date.
Definition at line 411 of file instrument.hpp.
|
friend |
Compares two values for inequality.
| lhs | The first value. |
| rhs | The second value. |
Definition at line 451 of file instrument.hpp.
|
friend |
Compares two values: the same state, and the same date when stated.
| lhs | The first value. |
| rhs | The second value. |
Definition at line 441 of file instrument.hpp.