blob: d85b2ef0d3fa1e3980a0de4cf6baa11989de8737 [file] [log] [blame]
#ifndef THIRD_PARTY_MILOTIC_EXTERNAL_CC_HFT_ADAPTER_DATA_SOURCE_H_
#define THIRD_PARTY_MILOTIC_EXTERNAL_CC_HFT_ADAPTER_DATA_SOURCE_H_
#include <memory>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/time/time.h"
#include "tlbmc/types/identifier.proto.h"
#include "tlbmc/types/payload.proto.h"
#include "tlbmc/types/subscription_params.proto.h"
namespace milotic_hft {
class DataSource {
public:
virtual ~DataSource() = default;
// Configures the data source for the given `identifier` with the given
// `sampling_interval_ms`.
// Returns an error if the data source cannot be configured.
virtual absl::Status Configure(const Identifier& identifier,
int sampling_interval_ms) = 0;
// Resets the data source to the default configuration for the given
// `identifier`.
virtual absl::Status ResetToDefault(const Identifier& identifier) = 0;
// Collects the data from the data source for the given `identifier` since the
// `start_time`.
// Returns an error if the data source is cannot serve the data.
virtual absl::StatusOr<Payload> Collect(const Identifier& identifier,
absl::Time start_time) const = 0;
};
} // namespace milotic_hft
#endif // THIRD_PARTY_MILOTIC_EXTERNAL_CC_HFT_ADAPTER_DATA_SOURCE_H_