Program Listing for File aggregation.h
↰ Return to documentation for file (/home/docs/checkouts/readthedocs.org/user_builds/opentelemetry-cpp/checkouts/latest/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation.h
)
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <memory>
#include "opentelemetry/sdk/metrics/data/metric_data.h"
#include "opentelemetry/version.h"
OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
namespace metrics
{
class Aggregation
{
public:
virtual void Aggregate(int64_t value, const PointAttributes &attributes = {}) noexcept = 0;
virtual void Aggregate(double value, const PointAttributes &attributes = {}) noexcept = 0;
virtual std::unique_ptr<Aggregation> Merge(const Aggregation &delta) const noexcept = 0;
virtual std::unique_ptr<Aggregation> Diff(const Aggregation &next) const noexcept = 0;
virtual PointType ToPoint() const noexcept = 0;
virtual ~Aggregation() = default;
};
} // namespace metrics
} // namespace sdk
OPENTELEMETRY_END_NAMESPACE