std::string toString() const;
+ void swap(Value&);
+
friend bool operator==(const Value&, const Value&);
template< typename T >
using type = boost::mpl::contains<ValueVariant::types, typename std::decay< T >::type>;
};
+
+
+ bool operator!=(const ResourceAttributes::Value&, const ResourceAttributes::Value&);
+
template< typename T >
typename std::enable_if< ResourceAttributes::is_supported_type< T >::value, bool >::type
operator==(const ResourceAttributes::Value& lhs, const T& rhs)
}
template< typename T >
+ typename std::enable_if< ResourceAttributes::is_supported_type< T >::value, bool >::type
+ operator!=(const T& lhs, const ResourceAttributes::Value& rhs)
+ {
+ return !(rhs == lhs);
+ }
+
+ bool operator!=(const char*, const ResourceAttributes::Value&);
+
+ template< typename T >
bool operator==(const T& lhs, const ResourceAttributes::Value& rhs)
{
return rhs == lhs;
bool operator==(const char* lhs, const ResourceAttributes::Value& rhs);
+ bool operator!=(const ResourceAttributes&, const ResourceAttributes&);
+
class ResourceAttributes::KeyValuePair
{
private:
namespace
{
- class ToStringVisitor : public boost::static_visitor<std::string>
+ class ToStringVisitor: public boost::static_visitor< std::string >
{
public:
ToStringVisitor() = default;
namespace Service
{
+ bool operator!=(const ResourceAttributes::Value& lhs, const ResourceAttributes::Value& rhs)
+ {
+ return !(lhs == rhs);
+ }
+
+ bool operator!=(const char* lhs, const ResourceAttributes::Value& rhs)
+ {
+ return !(rhs == lhs);
+ }
+
+
bool operator==(const char* lhs, const ResourceAttributes::Value& rhs)
{
return rhs == lhs;
return lhs.m_values == rhs.m_values;
}
+ bool operator!=(const ResourceAttributes& lhs, const ResourceAttributes& rhs)
+ {
+ return !(lhs == rhs);
+ }
+
ResourceAttributes::Value::Value() :
m_data{ new ValueVariant{} }
{
return boost::apply_visitor(ToStringVisitor(), *m_data);
}
+ void ResourceAttributes::Value::swap(Value& rhs)
+ {
+ m_data.swap(rhs.m_data);
+ }
+
auto ResourceAttributes::KeyValuePair::KeyVisitor::operator() (iterator* iter) const
-> result_type {
return iter->m_cur->first;
return iter->m_cur->second;
}
- auto ResourceAttributes::KeyValuePair::ConstValueVisitor::operator() (const_iterator* iter) const
- -> result_type {
+ auto ResourceAttributes::KeyValuePair::ConstValueVisitor::operator() (const_iterator* iter)
+ const -> result_type {
return iter->m_cur->second;
}
}
- ResourceAttributes::KeyValuePair::KeyValuePair(boost::variant<iterator*, const_iterator*>&& ref) :
+ ResourceAttributes::KeyValuePair::KeyValuePair(boost::variant<iterator*,
+ const_iterator*>&& ref) :
m_iterRef{ ref }
{
}
{
}
- ResourceAttributes::const_iterator::const_iterator(const ResourceAttributes::iterator& iter) :
+ ResourceAttributes::const_iterator::const_iterator(
+ const ResourceAttributes::iterator& iter) :
m_cur{ iter.m_cur }, m_keyValuePair{ this }
{
}
- auto ResourceAttributes::const_iterator::operator=(const ResourceAttributes::iterator& iter) -> const_iterator& {
+ auto ResourceAttributes::const_iterator::operator=(const ResourceAttributes::iterator& iter)
+ -> const_iterator& {
m_cur = iter.m_cur;
return *this;
}
}
void replaceAttributeValueRecursively(ResourceAttributes::Value& dest,
- const ResourceAttributes::Value& value)
+ const ResourceAttributes::Value& value)
{
static_assert(ResourceAttributes::is_supported_type< ResourceAttributes >::value,
"ResourceAttributes doesn't have ResourceAttributes recursively.");