blob: e9e08878e88fbeb94f9a7f66cfb1e772220e404a [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 with the given subscription parameters.
// This method can be called multiple times to update the subscription
// parameters.
virtual absl::Status Configure(const SubscriptionParams& params) = 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_