42 typedef std::vector<Item>
Items;
60 : items_(other.items_)
70 return items_.empty();
83 items_.reserve(capacity);
89 return items_.begin();
101 return std::find(items_.begin(), items_.end(), item);
113 items_.push_back(item);
127 typename Items::iterator
const found = std::find(items_.begin(), items_.end(), item);
129 if (items_.end() == found)
146 std::swap(items_, other.items_);
172 typedef std::vector<std::string>
Items;
182 : iterator_(other.iterator_)
188 : iterator_(iterator)
204 return iterator_ == other.iterator_;
210 return iterator_ != other.iterator_;
216 iterator_ = other.iterator_;
231 ItemIterator iterator_;
262 : items_(other.items_)
272 return items_.empty();
278 return items_.size();
285 items_.reserve(capacity);
304 return ConstIterator(std::find_if(items_.begin(), items_.end(), ItemLocator(item)));
333 const ItemIterator found = std::find_if(items_.begin(), items_.end(), ItemLocator(item));
335 if (items_.end() == found)
352 std::swap(items_, other.items_);
356 typedef std::vector<std::string> Items;
358 typedef Items::const_iterator ItemConstIterator;
360 typedef Items::iterator ItemIterator;
372 bool operator()(
const std::string& other)
const
374 return sought_ == other;
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
#define ONIXS_CMEMDH_LTWT
#define ONIXS_CMEMDH_NAMESPACE_END
void reserve(size_t capacity)
size_t size() const
Returns the number of items in the set.
void swap(TinySet &other)
Swaps content with the other instance.
std::vector< Item > Items
bool empty() const
Indicates whether the set is empty.
ConstIterator end() const
Provides iterating facilities.
~TinySet()
Cleans everything up.
TinySet(const TinySet &other)
Initializes the set as a copy of the other one.
bool insert(const Item &item)
ConstIterator find(const Item &item) const
Tells whether the set contains given item.
void clear()
Brings the set to the blank state.
ConstIterator begin() const
Provides iterating facilities.
bool erase(const Item &item)
Items::const_iterator ConstIterator
TinySet & operator=(const TinySet &other)
TinySet()
Initializes the empty set.
Implements iterator for the TinyStrSet class.
bool operator!=(const TinyStrSetIterator &other) const
Compares with the other instance.
TinyStrSetIterator & operator=(const TinyStrSetIterator &other)
Re-initializes as a copy of the other instance.
std::vector< std::string > Items
Aliases for internal representation.
TinyStrSetIterator(const TinyStrSetIterator &other)
Initializes the instance as a copy of the other one.
TinyStrSetIterator & operator++()
Messaging::StrRef operator*() const
Provides access to the underlying object.
Items::const_iterator ItemIterator
Aliases iterator over the internal store.
~TinyStrSetIterator()=default
Cleans everything up.
TinyStrSetIterator()
Initializes the iterator pointing to nowhere.
bool operator==(const TinyStrSetIterator &other) const
Compares with the other instance.
TinyStrSetIterator(const ItemIterator &iterator)
Initializes from iterator over the internal storage.
void reserve(size_t capacity)
size_t size() const
Returns the number of items in the set.
Messaging::StrRef Item
Items of collection.
TinyStrSet(size_t capacity)
TinyStrSetIterator ConstIterator
Aliases iterator type.
bool empty() const
Indicates whether the set is empty.
ConstIterator end() const
Provides iterating facilities.
void swap(TinyStrSet &other)
Exchanges content with the other instance.
TinyStrSet(const TinyStrSet &other)
Initializes as a copy of the other instance.
~TinyStrSet()
Destructs the internal storage.
bool insert(const Item &item)
ConstIterator find(const Item &item) const
TinyStrSet()
Initializes the empty set.
void clear()
Brings the set to the blank (empty) state.
ConstIterator begin() const
Provides iterating facilities.
bool erase(const Item &item)
std::basic_string_view< Char > StrRef
StrRef toStrRef(const std::string &str)
Constructs a StrRef instance over th std::string content.
void toStr(std::string &, Int8)
Serializes given integer into a string.
MboBook & copy(MboBook &target, const MboBook &source)
Copies content of MBO book to the other one.