Public Member Functions | Protected Member Functions | List of all members
novadaq::CachePolicy Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-03-03/NovaDAQUtilities/cxx/include/CachePolicy.h"

Inheritance diagram for novadaq::CachePolicy:
novadaq::TimedCachePolicy

Public Member Functions

 CachePolicy ()
 
virtual ~CachePolicy ()
 
void cacheUpdated ()
 
bool isExpired ()
 

Protected Member Functions

virtual void _markAsUpdated ()
 
virtual bool _checkIfExpired ()
 

Detailed Description

The base class for cache expiration policies. For convenience, this class provides an implementation of a "never expire" policy, so instances of this class can be used in cases in which no automatic expiration is desired.

Author
Kurt Biery
Version
Revision
1.1.34.1
Date
2019/09/27 00:07:20

Definition at line 16 of file CachePolicy.h.

Constructor & Destructor Documentation

novadaq::CachePolicy::CachePolicy ( )
inlineexplicit

Definition at line 20 of file CachePolicy.h.

20 {};
virtual novadaq::CachePolicy::~CachePolicy ( )
inlinevirtual

Definition at line 22 of file CachePolicy.h.

References _checkIfExpired(), _markAsUpdated(), cacheUpdated(), and isExpired().

22 {};

Member Function Documentation

bool novadaq::CachePolicy::_checkIfExpired ( )
protectedvirtual

Tests if the associated cache has expired based on the criteria in the policy.

Returns
true if the cache has expired, false if not.

Reimplemented in novadaq::TimedCachePolicy.

Definition at line 38 of file CachePolicy.cpp.

Referenced by isExpired(), and ~CachePolicy().

38  {
39  return false;
40 }
void novadaq::CachePolicy::_markAsUpdated ( )
protectedvirtual

Tells the policy that a cache update was done. This is used to reset the state of the policy to "unexpired" after an update.

Reimplemented in novadaq::TimedCachePolicy.

Definition at line 27 of file CachePolicy.cpp.

Referenced by cacheUpdated(), and ~CachePolicy().

27  {
28  // don't need to keep track of when the cache was updated since we
29  // never expire in this simple implementation
30 }
void novadaq::CachePolicy::cacheUpdated ( )

Tells the policy that a cache update was done. This is used to reset the state of the policy to "unexpired" after an update.

Definition at line 9 of file CachePolicy.cpp.

References _markAsUpdated().

Referenced by novadaq::Cache::_reloadIfNeeded(), and ~CachePolicy().

9  {
11 }
virtual void _markAsUpdated()
Definition: CachePolicy.cpp:27
bool novadaq::CachePolicy::isExpired ( )

Tests if the associated cache has expired based on the criteria in the policy.

Returns
true if the cache has expired, false if not.

Definition at line 19 of file CachePolicy.cpp.

References _checkIfExpired().

Referenced by novadaq::Cache::_reloadIfNeeded(), and ~CachePolicy().

19  {
20  return _checkIfExpired();
21 }
virtual bool _checkIfExpired()
Definition: CachePolicy.cpp:38

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