Program Listing for File aggregation.h
↰ Return to documentation for file (/home/docs/checkouts/readthedocs.org/user_builds/opentelemetry-cpp/checkouts/v1.8.1/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation.h
)
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/sdk/metrics/data/metric_data.h"
#include "opentelemetry/sdk/metrics/data/point_data.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