25 std::lock_guard<std::mutex> lk(mutex_);
26 return (findExpressionInternal(subnet_id, expression));
28 return (findExpressionInternal(subnet_id, expression));
34 auto it = expressions_.find(subnet_id);
35 if (it != expressions_.end()) {
36 expression = it->second;
51 if (expression_str.empty()) {
58 }
catch (
const std::exception& ex) {
60 << expression_str <<
"] : " << ex.what());
70 std::lock_guard<std::mutex> lk(mutex_);
71 expressions_[subnet_id] = expression;
73 expressions_[subnet_id] = expression;
80 std::lock_guard<std::mutex> lk(mutex_);
98 std::lock_guard<std::mutex> lk(mutex_);
99 return (expressions_.size());
101 return (expressions_.size());
105boost::posix_time::ptime
108 std::lock_guard<std::mutex> lk(mutex_);
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
boost::posix_time::ptime getModificationTime() const
Returns timestamp.
void updateModificationTime()
Sets timestamp to the current time.
void clear()
Delete all the entries in the cache.
dhcp::ExpressionPtr parseAndCacheExpression(const dhcp::SubnetID &subnet_id, const std::string &expression_str, uint32_t family)
Parses an expression string and caches for the given subnet.
void cacheExpression(const dhcp::SubnetID &subnet_id, dhcp::ExpressionPtr &expression)
Adds (or replaces) the expression for a given subnet to the cache.
size_t size()
Returns number of entries in the cache.
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)...
bool findExpression(const dhcp::SubnetID &subnet_id, dhcp::ExpressionPtr &expression)
Fetches the expression for a given subnet.
Evaluation context, an interface to the expression evaluation.
bool parseString(const std::string &str, ParserType type=PARSER_BOOL)
Run the parser on the string specified.
@ PARSER_STRING
expression is expected to evaluate to string
isc::dhcp::Expression expression_
Parsed expression (output tokens are stored here)
static MultiThreadingMgr & instance()
Returns a single instance of Multi Threading Manager.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< Expression > ExpressionPtr
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
std::vector< TokenPtr > Expression
This is a structure that holds an expression converted to RPN.
Defines the logger used by the top-level component of kea-lfc.