|  | Kea 3.1.0
    | 
BindingVariableCache stores binding variables. More...
#include <binding_variables.h>
| Public Member Functions | |
| BindingVariableCache () | |
| Constructor. | |
| virtual | ~BindingVariableCache ()=default | 
| Destructor. | |
| bool | add (BindingVariablePtr variable) | 
| Adds (or replaces) the variable in the cache. | |
| void | clear () | 
| Delete all the entries in the cache. | |
| BindingVariableListPtr | getAll () | 
| Fetches all of the binding variables in the order they were added to the cache. | |
| BindingVariablePtr | getByName (const std::string &name) | 
| Fetches a binding variable by name. | |
| BindingVariableListPtr | getBySource (const BindingVariable::Source &source) | 
| Fetches all of the binding variables in the order they were added to the cache that use a specific source. | |
| boost::posix_time::ptime | getLastFlushTime () | 
| Returns the last time the cache was flushed (or the time it was created if it has never been flushed). | |
| size_t | size () | 
| Returns number of entries in the cache. | |
| Public Member Functions inherited from isc::data::BaseStampedElement | |
| BaseStampedElement () | |
| Constructor. | |
| uint64_t | getId () const | 
| Returns element's database identifier. | |
| boost::posix_time::ptime | getModificationTime () const | 
| Returns timestamp. | |
| void | setId (const uint64_t id) | 
| Sets element's database identifier. | |
| void | setModificationTime (const boost::posix_time::ptime ×tamp) | 
| Sets timestamp to the explicitly provided value. | |
| void | updateModificationTime () | 
| Sets timestamp to the current time. | |
| Additional Inherited Members | |
| Protected Attributes inherited from isc::data::BaseStampedElement | |
| uint64_t | id_ | 
| Database identifier of the configuration element. | |
| boost::posix_time::ptime | timestamp_ | 
| Holds timestamp value. | |
BindingVariableCache stores binding variables.
Wrapper around the variable container that provides thread-safe access and time-stamped management. The later is available if/when supported scopes beyond global are added.
Definition at line 194 of file binding_variables.h.
| isc::lease_cmds::BindingVariableCache::BindingVariableCache | ( | ) | 
Constructor.
Definition at line 110 of file binding_variables.cc.
| 
 | virtualdefault | 
Destructor.
| bool isc::lease_cmds::BindingVariableCache::add | ( | BindingVariablePtr | variable | ) | 
Adds (or replaces) the variable in the cache.
Variables must be unique by name. If the variable to be added is a duplicate, the add fails and the function returns false.
| variable | pointer to the variable to store. | 
Definition at line 115 of file binding_variables.cc.
| void isc::lease_cmds::BindingVariableCache::clear | ( | ) | 
Delete all the entries in the cache.
Definition at line 122 of file binding_variables.cc.
References isc::data::BaseStampedElement::updateModificationTime().
| BindingVariableListPtr isc::lease_cmds::BindingVariableCache::getAll | ( | ) | 
Fetches all of the binding variables in the order they were added to the cache.
For now we'll return the pointer, w/o making a copy of the variable itself. We never updates variables so we should be OK.
Definition at line 143 of file binding_variables.cc.
| BindingVariablePtr isc::lease_cmds::BindingVariableCache::getByName | ( | const std::string & | name | ) | 
Fetches a binding variable by name.
Definition at line 159 of file binding_variables.cc.
| BindingVariableListPtr isc::lease_cmds::BindingVariableCache::getBySource | ( | const BindingVariable::Source & | source | ) | 
Fetches all of the binding variables in the order they were added to the cache that use a specific source.
Definition at line 168 of file binding_variables.cc.
| boost::posix_time::ptime isc::lease_cmds::BindingVariableCache::getLastFlushTime | ( | ) | 
Returns the last time the cache was flushed (or the time it was created if it has never been flushed).
Definition at line 137 of file binding_variables.cc.
References isc::data::BaseStampedElement::getModificationTime().
| size_t isc::lease_cmds::BindingVariableCache::size | ( | ) | 
Returns number of entries in the cache.
Definition at line 131 of file binding_variables.cc.