![]() |
RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
Classes | |
| struct | Node |
Public Types | |
| typedef std::map< Key, Node > | Nodes |
| typedef std::multimap< Date, typename Nodes::iterator > | Timeouts |
| typedef Nodes::const_iterator | const_iterator |
| typedef Nodes::iterator | iterator |
Public Member Functions | |
| TimeoutMap (double defaultTimeout=-INFINITY) | |
| void | doThrowException (const std::string &reason) const |
| Node & | operator[] (const Key &key) |
| Node & | access (const Key &key, Date timeout) |
| Node & | insert (const Key &key, const Value &value, Date timeout) |
| Node & | insert (const Key &key, Value &&value, Date timeout) |
| Node & | update (const Key &key, Value &&value) |
| Node & | update (const Key &key, const Value &value) |
| void | updateTimeout (const Key &key, Date timeout) |
| template<typename Callback > | |
| void | expire (const Callback &callback, Date now=Date::now()) |
| void | expire (Date now=Date::now()) |
| bool | count (const Key &key) const |
| Value | get (const Key &key) const |
| iterator | find (const Key &key) |
| const_iterator | find (const Key &key) const |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| bool | erase (const Key &key) |
| void | erase (const typename Nodes::iterator &it) |
| void | updateTimeout (const iterator &it, Date timeout) |
| size_t | size () const |
| bool | empty () const |
| void | clear () |
Public Attributes | |
| double | defaultTimeout |
|
boost::function< void(const std::string &reason)> | throwException |
| Nodes | nodes |
| Timeouts | timeouts |
| Date | earliest |
Definition at line 22 of file timeout_map.h.
| typedef std::multimap<Date, typename Nodes::iterator> Datacratic::TimeoutMap< Key, Value >::Timeouts |
Ordered set of timeouts in submitted for auction loss messages.
Definition at line 216 of file timeout_map.h.
| Node& Datacratic::TimeoutMap< Key, Value >::access | ( | const Key & | key, |
| Date | timeout | ||
| ) | [inline] |
Return the given key or insert a default value if it doesn't exist. Updates the timeout to the given value.
Definition at line 66 of file timeout_map.h.
| bool Datacratic::TimeoutMap< Key, Value >::erase | ( | const Key & | key | ) | [inline] |
Remove the entry for the given key. Returns true if it was erased or false otherwise.
Definition at line 286 of file timeout_map.h.
| void Datacratic::TimeoutMap< Key, Value >::expire | ( | const Callback & | callback, |
| Date | now = Date::now() |
||
| ) | [inline] |
Call the callback on any which have expired, removing them from the map.
Definition at line 179 of file timeout_map.h.
| void Datacratic::TimeoutMap< Key, Value >::expire | ( | Date | now = Date::now() | ) | [inline] |
Remove any which have expired.
Definition at line 201 of file timeout_map.h.
| Node& Datacratic::TimeoutMap< Key, Value >::insert | ( | const Key & | key, |
| const Value & | value, | ||
| Date | timeout | ||
| ) | [inline] |
Insert the given key, value pair with the given timeout. Throws an exception if the key already exists.
Definition at line 85 of file timeout_map.h.
| Node& Datacratic::TimeoutMap< Key, Value >::insert | ( | const Key & | key, |
| Value && | value, | ||
| Date | timeout | ||
| ) | [inline] |
Insert the given key, value pair with the given timeout. Throws an exception if the key already exists.
Definition at line 108 of file timeout_map.h.
| Node& Datacratic::TimeoutMap< Key, Value >::operator[] | ( | const Key & | key | ) | [inline] |
Access the entry for the given node. If it already exists then return the existing entry; otherwise insert it with the default timeout.
Definition at line 47 of file timeout_map.h.
| Node& Datacratic::TimeoutMap< Key, Value >::update | ( | const Key & | key, |
| Value && | value | ||
| ) | [inline] |
Update the given key which must already exist.
Definition at line 128 of file timeout_map.h.
| Node& Datacratic::TimeoutMap< Key, Value >::update | ( | const Key & | key, |
| const Value & | value | ||
| ) | [inline] |
Update the given key which must already exist.
Definition at line 140 of file timeout_map.h.
1.7.6.1