.. _program_listing_file_include_opentelemetry_common_key_value_iterable.h: Program Listing for File key_value_iterable.h ============================================= |exhale_lsh| :ref:`Return to documentation for file ` (``include/opentelemetry/common/key_value_iterable.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "opentelemetry/common/attribute_value.h" #include "opentelemetry/nostd/function_ref.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE namespace common { class KeyValueIterable { public: virtual ~KeyValueIterable() = default; virtual bool ForEachKeyValue(nostd::function_ref callback) const noexcept = 0; virtual size_t size() const noexcept = 0; }; // // NULL object pattern empty iterable. // class NullKeyValueIterable : public KeyValueIterable { public: NullKeyValueIterable(){}; virtual bool ForEachKeyValue( nostd::function_ref) const noexcept { return true; }; virtual size_t size() const noexcept { return 0; } }; } // namespace common OPENTELEMETRY_END_NAMESPACE