4 #include <launchdarkly/data_sources/data_source_status_error_info.hpp>
5 #include <launchdarkly/data_sources/data_source_status_error_kind.hpp>
9 namespace launchdarkly::common::data_sources {
11 template <
typename TDataSourceState>
14 using ErrorKind = DataSourceStatusErrorKind;
16 using DateTime = std::chrono::time_point<std::chrono::system_clock>;
17 using DataSourceState = TDataSourceState;
23 [[nodiscard]] DataSourceState
State()
const {
return state_; }
42 [[nodiscard]] DateTime
StateSince()
const {
return state_since_; }
57 [[nodiscard]] std::optional<ErrorInfo>
LastError()
const {
63 std::optional<ErrorInfo> last_error)
65 state_since_(state_since),
66 last_error_(std::move(last_error)) {}
68 ~DataSourceStatusBase() =
default;
69 DataSourceStatusBase(DataSourceStatusBase
const& item) =
default;
70 DataSourceStatusBase(DataSourceStatusBase&& item) noexcept =
default;
71 DataSourceStatusBase& operator=(DataSourceStatusBase
const&) =
delete;
72 DataSourceStatusBase& operator=(DataSourceStatusBase&&) =
delete;
75 DataSourceState state_;
76 DateTime state_since_;
77 std::optional<ErrorInfo> last_error_;
Definition: data_source_status_base.hpp:12
DateTime StateSince() const
Definition: data_source_status_base.hpp:42
DataSourceState State() const
Definition: data_source_status_base.hpp:23
std::optional< ErrorInfo > LastError() const
Definition: data_source_status_base.hpp:57
Definition: data_source_status_error_info.hpp:14