Program Listing for File aggregation.h
↰ Return to documentation for file (/tmp/B.puc0r6hi/BUILD/opentelemetry-cpp-1.27.0-build/opentelemetry-cpp-1.27.0/sdk/include/opentelemetry/sdk/metrics/aggregation/aggregation.h)
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <stdint.h>
#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;
Aggregation() = default;
Aggregation(const Aggregation &) = delete;
Aggregation(Aggregation &&) = delete;
Aggregation &operator=(const Aggregation &) = delete;
Aggregation &operator=(Aggregation &&) = delete;
virtual ~Aggregation() = default;
};
} // namespace metrics
} // namespace sdk
OPENTELEMETRY_END_NAMESPACE