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
Provides efficient way of accessing text-based values without copying content of the text being refer...
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.
TinySet(size_t capacity)
Initializes the empty set and configures the internal storage to be enough capacious to store the giv...
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)
Inserts the given item into the set.
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)
Removes the given item from the set.
Items::const_iterator ConstIterator
TinySet & operator=(const TinySet &other)
Re-initializes the instance as a copy of the other one.
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++()
Advances the instance to the next item in the collection.
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)
Makes the internal storage capacious enough to store the given number of items.
StrRef Item
Items of collection.
size_t size() const
Returns the number of items in the set.
TinyStrSet(size_t capacity)
Initializes the empty set capacious enough to store the given number of items.
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)
Inserts the given item into the set.
ConstIterator find(const Item &item) const
Looks for the given item and returns iterator pointing to the found entry or to nowhere.
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)
Removes the given item from the set.
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.