41 typedef std::vector<Item>
Items;
59 : items_(other.items_)
69 return items_.empty();
82 items_.reserve(capacity);
88 return items_.begin();
100 return std::find(items_.begin(), items_.end(), item);
112 items_.push_back(item);
126 typename Items::iterator
const found = std::find(items_.begin(), items_.end(), item);
128 if (items_.end() == found)
145 std::swap(items_, other.items_);
171 typedef std::vector<std::string>
Items;
181 : iterator_(other.iterator_)
187 : iterator_(iterator)
203 return iterator_ == other.iterator_;
209 return iterator_ != other.iterator_;
215 iterator_ = other.iterator_;
230 ItemIterator iterator_;
261 : items_(other.items_)
271 return items_.empty();
277 return items_.size();
284 items_.reserve(capacity);
303 return ConstIterator(std::find_if(items_.begin(), items_.end(), ItemLocator(item)));
318 items_.push_back(
toStr(item));
332 const ItemIterator found = std::find_if(items_.begin(), items_.end(), ItemLocator(item));
334 if (items_.end() == found)
351 std::swap(items_, other.items_);
355 typedef std::vector<std::string> Items;
357 typedef Items::const_iterator ItemConstIterator;
359 typedef Items::iterator ItemIterator;
366 ItemLocator(
const StrRef& sought)
371 bool operator()(
const std::string& other)
const
373 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++()
Items::const_iterator ItemIterator
Aliases iterator over the internal store.
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.
StrRef operator*() const
Provides access to the underlying object.
~TinyStrSetIterator()
Cleans everything up.
void reserve(size_t capacity)
StrRef Item
Items of collection.
size_t size() const
Returns the number of items in the set.
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)
MboBook & copy(MboBook &target, const MboBook &source)
Copies content of MBO book to the other one.
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
StrRef toStrRef(const std::string &str)
Constructs StrRef instance over std::string content.