Kea: isc::lease_cmds::BindingVariableCache Class Reference

| Kea 3.2.0-git

isc::lease_cmds::BindingVariableCache Class Reference

BindingVariableCache stores binding variables. More...

`#include <binding_variables.h>`

Inheritance diagram for isc::lease_cmds::BindingVariableCache:
[legend]

## 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 &timestamp)
| 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.

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ BindingVariableCache()

isc::lease_cmds::BindingVariableCache::BindingVariableCache | ( |  | ) |

Constructor.

Definition at line 110 of file binding_variables.cc.

## ◆ ~BindingVariableCache()

virtual isc::lease_cmds::BindingVariableCache::~BindingVariableCache | ( |  | ) |
| virtualdefault

Destructor.

## Member Function Documentation

## ◆ add()

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.

Parameters

  variable | pointer to the variable to store.

Returns
  true if the variable was added, false otherwise.

Definition at line 115 of file binding_variables.cc.

## ◆ clear()

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().

Here is the call graph for this function:

## ◆ getAll()

BindingVariableListPtr isc::lease_cmds::BindingVariableCache::getAll | ( |  | ) |

Fetches all of the binding variables in the order they were added to the cache.

Returns
  Pointer to a list of the BindingVariables.

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.

## ◆ getByName()

BindingVariablePtr isc::lease_cmds::BindingVariableCache::getByName | ( | const std::string & | name | ) |

Fetches a binding variable by name.

Returns
  A pointer to the variable or an empty pointer if no match is found.

Definition at line 159 of file binding_variables.cc.

## ◆ getBySource()

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.

Returns
  Pointer to a list of the BindingVariables.

Definition at line 168 of file binding_variables.cc.

## ◆ getLastFlushTime()

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().

Here is the call graph for this function:

## ◆ size()

size_t isc::lease_cmds::BindingVariableCache::size | ( |  | ) |

Returns number of entries in the cache.

Definition at line 131 of file binding_variables.cc.

The documentation for this class was generated from the following files:

- binding_variables.h
- binding_variables.cc