diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-07-24 01:44:23 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-07-24 01:44:23 +0300 |
commit | 4d56ab79e5691cc41755bcc40f4c2125beee347e (patch) | |
tree | db273cf5da935c20759a5af7f29cae217762e4ae /contrib/libs/apache/avro/api/Layout.hh | |
parent | 574b79287767a711217816f3c0719095e56f2b66 (diff) | |
download | ydb-4d56ab79e5691cc41755bcc40f4c2125beee347e.tar.gz |
Update contrib/libs/apache/avro to 1.11.0
Diffstat (limited to 'contrib/libs/apache/avro/api/Layout.hh')
-rw-r--r-- | contrib/libs/apache/avro/api/Layout.hh | 41 |
1 files changed, 13 insertions, 28 deletions
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 |