Granada  1.54.0
Structured layer on top of C++ REST SDK for building server applications in C++. Granada implements sessions, server side plug-in framework, C++ OAuth 2.0 server, data storage access, server script running, server browsing.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Protected Attributes | List of all members
granada::cache::SharedMapIterator Class Reference

#include <shared_map_cache_driver.h>

Inheritance diagram for granada::cache::SharedMapIterator:
granada::cache::CacheHandlerIterator

Public Member Functions

 SharedMapIterator ()
 
 SharedMapIterator (const std::string &expression, SharedMapCacheDriver *cache)
 
virtual ~SharedMapIterator ()
 
virtual void set (const std::string &expression) override
 
virtual const bool has_next ()
 
virtual const std::string next ()
 
- Public Member Functions inherited from granada::cache::CacheHandlerIterator
 CacheHandlerIterator ()
 
 CacheHandlerIterator (const std::string &expression)
 
virtual ~CacheHandlerIterator ()
 

Protected Attributes

SharedMapCacheDrivercache_
 
std::vector< std::string > keys_
 
std::vector< std::string >
::iterator 
it_
 
- Protected Attributes inherited from granada::cache::CacheHandlerIterator
std::string expression_
 

Detailed Description

Tool for iterate over cache keys with a given pattern.

Constructor & Destructor Documentation

granada::cache::SharedMapIterator::SharedMapIterator ( )
inline

Constructor

granada::cache::SharedMapIterator::SharedMapIterator ( const std::string &  expression,
SharedMapCacheDriver cache 
)

Constructor.

Parameters
expressionExpression used to match keys.
                 Example of expression:

                   session:value:*
                   => will retrieve all the keys that start with
                   session:values: stored in the cache.

                   *:value:*
                   => will retrieve all the keys that contain
                   ":value:"
cachePointer to the cache where to search the keys.
virtual granada::cache::SharedMapIterator::~SharedMapIterator ( )
inlinevirtual

Destructor

Member Function Documentation

virtual const bool granada::cache::SharedMapIterator::has_next ( )
virtual

Return true if there is another value with same pattern, false if there is not.

Returns
True | False

Implements granada::cache::CacheHandlerIterator.

virtual const std::string granada::cache::SharedMapIterator::next ( )
virtual

Return the next key found with the given pattern.

Returns
[description]

Implements granada::cache::CacheHandlerIterator.

virtual void granada::cache::SharedMapIterator::set ( const std::string &  expression)
overridevirtual

Set the iterator, useful to reuse it.

Parameters
expressionFilter pattern/expression. Example: session:TOKEN46464 => will SCAN or KEYS keys that match the given expression.

Reimplemented from granada::cache::CacheHandlerIterator.

Member Data Documentation

SharedMapCacheDriver* granada::cache::SharedMapIterator::cache_
protected

Cache containing the keys to iterate.

std::vector<std::string>::iterator granada::cache::SharedMapIterator::it_
protected

Iterator.

std::vector<std::string> granada::cache::SharedMapIterator::keys_
protected

Vector for storing found keys.


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