ad_map_access
Restrictions.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2020 Intel Corporation
5  *
6  * SPDX-License-Identifier: MIT
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <iostream>
21 #include <memory>
22 #include <sstream>
27 namespace ad {
31 namespace map {
37 namespace restriction {
38 
43 {
47  typedef std::shared_ptr<Restrictions> Ptr;
48 
52  typedef std::shared_ptr<Restrictions const> ConstPtr;
53 
57  Restrictions() = default;
58 
62  ~Restrictions() = default;
63 
67  Restrictions(const Restrictions &other) = default;
68 
72  Restrictions(Restrictions &&other) = default;
73 
81  Restrictions &operator=(const Restrictions &other) = default;
82 
90  Restrictions &operator=(Restrictions &&other) = default;
91 
99  bool operator==(const Restrictions &other) const
100  {
101  return (conjunctions == other.conjunctions) && (disjunctions == other.disjunctions);
102  }
103 
111  bool operator!=(const Restrictions &other) const
112  {
113  return !operator==(other);
114  }
115 
118 };
119 
120 } // namespace restriction
121 } // namespace map
122 } // namespace ad
123 
127 #ifndef GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTIONS
128 #define GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTIONS
129 
132 namespace ad {
136 namespace map {
142 namespace restriction {
143 
153 inline std::ostream &operator<<(std::ostream &os, Restrictions const &_value)
154 {
155  os << "Restrictions(";
156  os << "conjunctions:";
157  os << _value.conjunctions;
158  os << ",";
159  os << "disjunctions:";
160  os << _value.disjunctions;
161  os << ")";
162  return os;
163 }
164 
165 } // namespace restriction
166 } // namespace map
167 } // namespace ad
168 
169 namespace std {
173 inline std::string to_string(::ad::map::restriction::Restrictions const &value)
174 {
175  stringstream sstream;
176  sstream << value;
177  return sstream.str();
178 }
179 } // namespace std
180 #endif // GEN_GUARD_AD_MAP_RESTRICTION_RESTRICTIONS
ad::map::restriction::Restrictions::Ptr
std::shared_ptr< Restrictions > Ptr
Smart pointer on Restrictions.
Definition: Restrictions.hpp:47
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::restriction::Restrictions
DataType Restrictions.
Definition: Restrictions.hpp:42
ad::map::restriction::Restrictions::operator!=
bool operator!=(const Restrictions &other) const
standard comparison operator
Definition: Restrictions.hpp:111
std::to_string
std::string to_string(::ad::map::access::GeometryStoreItem const &value)
overload of the std::to_string for GeometryStoreItem
Definition: GeometryStoreItem.hpp:183
ad::map::restriction::Restrictions::~Restrictions
~Restrictions()=default
standard destructor
ad::map::restriction::Restrictions::operator==
bool operator==(const Restrictions &other) const
standard comparison operator
Definition: Restrictions.hpp:99
ad::map::restriction::Restrictions::operator=
Restrictions & operator=(const Restrictions &other)=default
standard assignment operator
ad::map::restriction::Restrictions::Restrictions
Restrictions()=default
standard constructor
ad::map::restriction::Restrictions::ConstPtr
std::shared_ptr< Restrictions const > ConstPtr
Smart pointer on constant Restrictions.
Definition: Restrictions.hpp:52
RestrictionList.hpp
ad::map::restriction::RestrictionList
std::vector<::ad::map::restriction::Restriction > RestrictionList
DataType RestrictionList.
Definition: RestrictionList.hpp:42
ad::map::restriction::operator<<
std::ostream & operator<<(std::ostream &os, Restriction const &_value)
standard ostream operator
Definition: Restriction.hpp:157