From 4d56ab79e5691cc41755bcc40f4c2125beee347e Mon Sep 17 00:00:00 2001 From: robot-contrib <robot-contrib@yandex-team.com> Date: Sun, 24 Jul 2022 01:44:23 +0300 Subject: Update contrib/libs/apache/avro to 1.11.0 --- contrib/libs/apache/avro/api/Layout.hh | 41 +++++++++++----------------------- 1 file changed, 13 insertions(+), 28 deletions(-) (limited to 'contrib/libs/apache/avro/api/Layout.hh') diff --git a/contrib/libs/apache/avro/api/Layout.hh b/contrib/libs/apache/avro/api/Layout.hh index ffd810c8b0..56d2c1d9c7 100644 --- a/contrib/libs/apache/avro/api/Layout.hh +++ b/contrib/libs/apache/avro/api/Layout.hh @@ -19,8 +19,8 @@ #ifndef avro_Layout_hh__ #define avro_Layout_hh__ -#include <boost/noncopyable.hpp> #include "Config.hh" +#include <boost/noncopyable.hpp> /// \file Layout.hh /// @@ -28,54 +28,39 @@ namespace avro { class AVRO_DECL Layout : private boost::noncopyable { +protected: + explicit Layout(size_t offset = 0) : offset_(offset) {} - protected: - - Layout(size_t offset = 0) : - offset_(offset) - {} - - public: - +public: size_t offset() const { return offset_; } + virtual ~Layout() = default; - virtual ~Layout() {} - - private: - +private: const size_t offset_; }; class AVRO_DECL PrimitiveLayout : public Layout { - - public: - - PrimitiveLayout(size_t offset = 0) : - Layout(offset) - {} +public: + explicit PrimitiveLayout(size_t offset = 0) : Layout(offset) {} }; class AVRO_DECL CompoundLayout : public Layout { - public: - - CompoundLayout(size_t offset = 0) : - Layout(offset) - {} +public: + explicit CompoundLayout(size_t offset = 0) : Layout(offset) {} void add(std::unique_ptr<Layout> &layout) { layouts_.push_back(std::move(layout)); } - const Layout &at (size_t idx) const { + const Layout &at(size_t idx) const { return *layouts_.at(idx); } - private: - - std::vector<std::unique_ptr<Layout> > layouts_; +private: + std::vector<std::unique_ptr<Layout>> layouts_; }; } // namespace avro -- cgit v1.2.3