17 #ifndef __COMMON_RESOURCE_QUANTITIES_HPP__ 18 #define __COMMON_RESOURCE_QUANTITIES_HPP__ 23 #include <boost/container/small_vector.hpp> 99 template <
typename Key>
105 result += quantities;
114 const google::protobuf::Map<std::string, Value::Scalar>&
map);
122 typedef boost::container::small_vector_base<
124 typedef boost::container::small_vector_base<
130 const_iterator
begin();
131 const_iterator
end();
133 const_iterator
begin()
const {
return quantities.begin(); }
134 const_iterator
end()
const {
return quantities.end(); }
136 size_t size()
const {
return quantities.size(); };
138 bool empty()
const {
return quantities.empty(); }
142 Value::Scalar
get(
const std::string&
name)
const;
158 void add(
const std::string&
name,
const Value::Scalar& scalar);
159 void add(
const std::string&
name,
double value);
167 boost::container::small_vector<std::pair<std::string, Value::Scalar>, 7>
213 const google::protobuf::Map<std::string, Value::Scalar>&
map);
221 typedef boost::container::small_vector_base<
223 typedef boost::container::small_vector_base<
229 const_iterator
begin();
230 const_iterator
end();
232 const_iterator
begin()
const {
return limits.begin(); }
233 const_iterator
end()
const {
return limits.end(); }
235 size_t size()
const {
return limits.size(); };
237 bool empty()
const {
return limits.empty(); }
263 void set(
const std::string&
name,
const Value::Scalar& scalar);
271 boost::container::small_vector<std::pair<std::string, Value::Scalar>, 7>
281 #endif // __COMMON_RESOURCE_QUANTITIES_HPP__ std::ostream & operator<<(std::ostream &stream, const Attribute &attribute)
bool operator!=(const ResourceQuantities &quantities) const
bool contains(const ResourceQuantities &quantities) const
bool empty() const
Definition: resource_quantities.hpp:138
Definition: option.hpp:29
size_t size() const
Definition: resource_quantities.hpp:136
Definition: resource_quantities.hpp:192
ResourceQuantities operator-(const ResourceQuantities &quantities) const
size_t size() const
Definition: resource_quantities.hpp:235
static ResourceQuantities fromResources(const Resources &resources)
boost::container::small_vector_base< std::pair< std::string, Value::Scalar > >::const_iterator const_iterator
Definition: resource_quantities.hpp:224
Definition: resource_quantities.hpp:63
bool empty() const
Definition: resource_quantities.hpp:237
Definition: resources.hpp:83
const_iterator begin() const
Definition: resource_quantities.hpp:133
ResourceQuantities & operator-=(const ResourceQuantities &quantities)
Future< Nothing > add(const T &metric)
Definition: metrics.hpp:95
Definition: hashmap.hpp:38
ResourceQuantities operator+(const ResourceQuantities &quantities) const
boost::container::small_vector_base< std::pair< std::string, Value::Scalar > >::const_iterator const_iterator
Definition: resource_quantities.hpp:125
static ResourceQuantities fromScalarResources(const Resources &resources)
static ResourceQuantities fromScalarResource(const Resource &resource)
friend class ResourceLimits
Definition: resource_quantities.hpp:156
boost::container::small_vector_base< std::pair< std::string, Value::Scalar > >::const_iterator iterator
Definition: resource_quantities.hpp:123
#define foreachvalue(VALUE, ELEMS)
Definition: foreach.hpp:77
static Try< ResourceQuantities > fromString(const std::string &text)
const_iterator end() const
Definition: resource_quantities.hpp:134
ResourceQuantities & operator=(const ResourceQuantities &that)=default
Iterable< V > map(F &&f, const Iterable< U, Us... > &input)
Definition: lambda.hpp:46
bool operator==(const ResourceQuantities &quantities) const
boost::container::small_vector_base< std::pair< std::string, Value::Scalar > >::const_iterator iterator
Definition: resource_quantities.hpp:222
ResourceQuantities & operator+=(const ResourceQuantities &quantities)
static ResourceQuantities sum(const hashmap< Key, ResourceQuantities > &map)
Definition: resource_quantities.hpp:100
const_iterator begin() const
Definition: resource_quantities.hpp:232
constexpr const char * name
Definition: shell.hpp:41
const_iterator end() const
Definition: resource_quantities.hpp:233