41 typedef std::vector<Item>
Items;
59 : items_(other.items_)
69 return items_.empty();
82 items_.reserve(capacity);
88 return items_.begin();
92 ConstIterator
end()
const 98 ConstIterator
find(
const Item& item)
const 100 return std::find(items_.begin(), items_.end(), item);
110 if (end() == find(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);
290 return ConstIterator(items_.begin());
296 return ConstIterator(items_.end());
301 ConstIterator
find(
const Item& item)
const 303 return ConstIterator(std::find_if(items_.begin(), items_.end(), ItemLocator(item)));
316 if (end() == find(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;
TinySet(const TinySet &other)
Initializes the set as a copy of the other one.
size_t size() const
Returns the number of items in the set.
Key Item
Aliases set item type.
size_t size() const
Returns the number of items in the set.
bool erase(const Item &item)
Removes the given item from the set.
bool empty() const
Indicates whether the set is empty.
void swap(TinySet &other)
Swaps content with the other instance.
TinyStrSet(size_t capacity)
Initializes the empty set capacious enough to store the given number of items.
ConstIterator end() const
Provides iterating facilities.
void clear()
Brings the set to the blank (empty) state.
TinyStrSetIterator & operator++()
Advances the instance to the next item in the collection.
TinyStrSet()
Initializes the empty set.
std::vector< Item > Items
Aliases internal representation.
~TinyStrSet()
Destructs the internal storage.
Items::const_iterator ItemIterator
Aliases iterator over the internal store.
TinySet(size_t capacity)
Initializes the empty set and configures the internal storage to be enough capacious to store the giv...
StrRef operator*() const
Provides access to the underlying object.
ConstIterator end() const
Provides iterating facilities.
TinySet()
Initializes the empty set.
Implements TinySet for StrRef class.
void clear()
Brings the set to the blank state.
void swap(TinyStrSet &other)
Exchanges content with the other instance.
~TinySet()
Cleans everything up.
#define ONIXS_CMEMDH_LTWT
bool insert(const Item &item)
Inserts the given item into the set.
bool erase(const Item &item)
Removes the given item from the set.
bool operator!=(const TinyStrSetIterator &other) const
Compares with the other instance.
MboBook & copy(MboBook &target, const MboBook &source)
Copies content of MBO book to the other one.
bool operator==(const TinyStrSetIterator &other) const
Compares with the other instance.
void toStr(std::string &str, const Message &message)
Serializes FIX message into tag=value format.
TinyStrSet(const TinyStrSet &other)
Initializes as a copy of the other instance.
ConstIterator find(const Item &item) const
Tells whether the set contains given item.
ConstIterator find(const Item &item) const
Looks for the given item and returns iterator pointing to the found entry or to nowhere.
void reserve(size_t capacity)
Makes the internal storage capacious enough to store the given number of items.
Class implementing set optimized for storing small number of items.
Provides efficient way of accessing text-based values without copying content of the text being refer...
Items::const_iterator ConstIterator
Aliases iterator over set items.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
bool empty() const
Indicates whether the set is empty.
StrRef Item
Items of collection.
TinyStrSetIterator(const ItemIterator &iterator)
Initializes from iterator over the internal storage.
TinyStrSetIterator()
Initializes the iterator pointing to nowhere.
Implements iterator for the TinyStrSet class.
StrRef toStrRef(const std::string &str)
Constructs StrRef instance over std::string content.
TinySet & operator=(const TinySet &other)
Re-initializes the instance as a copy of the other one.
~TinyStrSetIterator()
Cleans everything up.
ConstIterator begin() const
Provides iterating facilities.
void reserve(size_t capacity)
Makes the internal storage capacious enough to store the given number of items.
TinyStrSetIterator & operator=(const TinyStrSetIterator &other)
Re-initializes as a copy of the other instance.
ConstIterator begin() const
Provides iterating facilities.
bool insert(const Item &item)
Inserts the given item into the set.
std::vector< std::string > Items
Aliases for internal representation.
TinyStrSetIterator(const TinyStrSetIterator &other)
Initializes the instance as a copy of the other one.
TinyStrSetIterator ConstIterator
Aliases iterator type.
#define ONIXS_CMEMDH_NAMESPACE_END