libbio
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
bio::Cached< STORE_TYPE, LOOKUP_TYPE, LOOKUP_FUNCTION > Class Template Reference

#include <Cached.h>

Inheritance diagram for bio::Cached< STORE_TYPE, LOOKUP_TYPE, LOOKUP_FUNCTION >:
Inheritance graph
[legend]
Collaboration diagram for bio::Cached< STORE_TYPE, LOOKUP_TYPE, LOOKUP_FUNCTION >:
Collaboration graph
[legend]

Public Member Functions

 Cached (LOOKUP_TYPE lookup, STORE_TYPE invalidValue, LOOKUP_FUNCTION LookupFunction)
 
virtual ~Cached ()
 
virtual void Flush ()
 
friend::std::ostream & operator<< (std::ostream &out, const Cached &t)
 
- Public Member Functions inherited from bio::AbstractCached
 AbstractCached ()
 
virtual ~AbstractCached ()
 
void Register ()
 
void Deregister ()
 
- Public Member Functions inherited from bio::TransparentWrapper< STORE_TYPE >
 TransparentWrapper (STORE_TYPE t)
 
 TransparentWrapper (const TransparentWrapper< STORE_TYPE > &other)
 
 ~TransparentWrapper ()
 
 operator STORE_TYPE ()
 
TransparentWrapper< STORE_TYPE > & operator= (const STORE_TYPE &t)
 
TransparentWrapper< STORE_TYPE > & operator= (const TransparentWrapper< STORE_TYPE > &other)
 
bool operator== (const STORE_TYPE &t) const
 
bool operator== (const TransparentWrapper &other) const
 
bool operator!= (const STORE_TYPE &t) const
 
bool operator!= (const TransparentWrapper &other) const
 
bool operator<= (const STORE_TYPE &t) const
 
bool operator<= (const TransparentWrapper &other) const
 
bool operator>= (const STORE_TYPE &t) const
 
bool operator>= (const TransparentWrapper &other) const
 
bool operator< (const STORE_TYPE &t) const
 
bool operator< (const TransparentWrapper &other) const
 
bool operator> (const STORE_TYPE &t) const
 
bool operator> (const TransparentWrapper &other) const
 
STORE_TYPEoperator++ ()
 
STORE_TYPE operator++ (int)
 
STORE_TYPEoperator-- ()
 
STORE_TYPE operator-- (int)
 
STORE_TYPE operator+= (const STORE_TYPE &t)
 
STORE_TYPE operator+= (const TransparentWrapper &other)
 
STORE_TYPE operator-= (const STORE_TYPE &t)
 
STORE_TYPE operator-= (const TransparentWrapper &other)
 
STORE_TYPE operator+ (const STORE_TYPE &t) const
 
STORE_TYPE operator+ (const TransparentWrapper &other) const
 
STORE_TYPE operator- (const STORE_TYPE &t) const
 
STORE_TYPE operator- (const TransparentWrapper &other) const
 
STORE_TYPE operator*= (const STORE_TYPE &t)
 
STORE_TYPE operator*= (const TransparentWrapper &other)
 
STORE_TYPE operator/= (const STORE_TYPE &t)
 
STORE_TYPE operator/= (const TransparentWrapper &other)
 
STORE_TYPE operator* (const STORE_TYPE &t) const
 
STORE_TYPE operator* (const TransparentWrapper &other) const
 
STORE_TYPE operator/ (const STORE_TYPE &t) const
 
STORE_TYPE operator/ (const TransparentWrapper &other) const
 
friend::std::ostream & operator<< (std::ostream &out, const TransparentWrapper &t)
 
STORE_TYPEoperator-> ()
 
const STORE_TYPEoperator-> () const
 

Protected Attributes

LOOKUP_TYPE mLookup
 
LOOKUP_FUNCTION mLookupFunction
 

Additional Inherited Members

- Public Types inherited from bio::TransparentWrapper< STORE_TYPE >
typedef STORE_TYPE Type
 
- Public Attributes inherited from bio::TransparentWrapper< STORE_TYPE >
STORE_TYPE mT
 

Detailed Description

template<typename STORE_TYPE, typename LOOKUP_TYPE, typename LOOKUP_FUNCTION>
class bio::Cached< STORE_TYPE, LOOKUP_TYPE, LOOKUP_FUNCTION >

Cached<> objects store some kind of type along with a trivial lookup system.
These objects must be provided a lookup function as well as what to lookup.

Template Parameters
STORE_TYPE

Constructor & Destructor Documentation

◆ Cached()

bio::Cached< STORE_TYPE, LOOKUP_TYPE, LOOKUP_FUNCTION >::Cached ( LOOKUP_TYPE  lookup,
STORE_TYPE  invalidValue,
LOOKUP_FUNCTION  LookupFunction 
)
inline
Parameters
lookup
invalidValue
LookupFunction

◆ ~Cached()

Member Function Documentation

◆ Flush()

Remove whatever *this has cached and re-look up the newest value.
THIS MUST BE IMPLEMENTED BY CHILDREN.
Issue: Singleton methods are incompatible with global functions, since we don't know which we're using, we can't implement even a default, apparently.
This should be changed in a future release. Right now, *this is abstract.

Reimplemented from bio::AbstractCached.

Reimplemented in bio::CachedId< ID_TYPE >.

◆ operator<<()

friend::std::ostream & bio::Cached< STORE_TYPE, LOOKUP_TYPE, LOOKUP_FUNCTION >::operator<< ( std::ostream &  out,
const Cached< STORE_TYPE, LOOKUP_TYPE, LOOKUP_FUNCTION > &  t 
)
inline

For full transparency, this method must be added to all children.
(We don't have Class<> logic to save us from this nightmare at the common/ level).

Parameters
out
t
Returns
out

Member Data Documentation

◆ mLookup

◆ mLookupFunction


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