|
| 1 | +// |
| 2 | +// Copyright (c) 2024 Dmitry Arkhipov ([email protected]) |
| 3 | +// |
| 4 | +// Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | +// |
| 7 | +// Official repository: https://github.com/boostorg/json |
| 8 | +// |
| 9 | + |
| 10 | +#ifndef BOOST_JSON_BENCH_APACHE_BUILDS_HPP |
| 11 | +#define BOOST_JSON_BENCH_APACHE_BUILDS_HPP |
| 12 | + |
| 13 | +#include <boost/describe/class.hpp> |
| 14 | +#include <boost/optional/optional.hpp> |
| 15 | +#include <map> |
| 16 | +#include <string> |
| 17 | +#include <vector> |
| 18 | + |
| 19 | +namespace boost { |
| 20 | +namespace json { |
| 21 | +namespace apache_builds { |
| 22 | + |
| 23 | +struct label |
| 24 | +{ |
| 25 | + boost::optional<std::string> name; |
| 26 | +}; |
| 27 | +BOOST_DESCRIBE_STRUCT( label, (), (name) ) |
| 28 | + |
| 29 | +struct job |
| 30 | +{ |
| 31 | + std::string name; |
| 32 | + std::string url; |
| 33 | + std::string color; |
| 34 | +}; |
| 35 | +BOOST_DESCRIBE_STRUCT( job, (), (name, url, color) ) |
| 36 | + |
| 37 | +struct view |
| 38 | +{ |
| 39 | + std::string name; |
| 40 | + std::string url; |
| 41 | +}; |
| 42 | +BOOST_DESCRIBE_STRUCT( view, (), (name, url) ) |
| 43 | + |
| 44 | +struct builds |
| 45 | +{ |
| 46 | + std::vector<label> assignedLabels; |
| 47 | + std::string mode; |
| 48 | + std::string nodeDescription; |
| 49 | + std::string nodeName; |
| 50 | + std::size_t numExecutors; |
| 51 | + std::string description; |
| 52 | + std::vector<job> jobs; |
| 53 | + std::map<std::string, int> overallLoad; |
| 54 | + view primaryView; |
| 55 | + bool quietingDown; |
| 56 | + std::size_t slaveAgentPort; |
| 57 | + std::map<std::string, int> unlabeledLoad; |
| 58 | + bool useCrumbs; |
| 59 | + bool useSecurity; |
| 60 | + std::vector<view> views; |
| 61 | +}; |
| 62 | +BOOST_DESCRIBE_STRUCT( |
| 63 | + builds, |
| 64 | + (), |
| 65 | + ( assignedLabels, |
| 66 | + mode, |
| 67 | + nodeDescription, |
| 68 | + nodeName, |
| 69 | + numExecutors, |
| 70 | + description, |
| 71 | + jobs, |
| 72 | + overallLoad, |
| 73 | + primaryView, |
| 74 | + quietingDown, |
| 75 | + slaveAgentPort, |
| 76 | + unlabeledLoad, |
| 77 | + useCrumbs, |
| 78 | + useSecurity, |
| 79 | + views ) |
| 80 | +) |
| 81 | + |
| 82 | +} // namespace apache_builds |
| 83 | + |
| 84 | +struct apache_builds_support |
| 85 | +{ |
| 86 | + using type = apache_builds::builds; |
| 87 | + static constexpr char const* const name = "apache_builds.json"; |
| 88 | +}; |
| 89 | + |
| 90 | +} // namespace json |
| 91 | +} // namespace boost |
| 92 | + |
| 93 | +#endif // BOOST_JSON_BENCH_APACHE_BUILDS_HPP |
0 commit comments