#include <cachemethod.h>
Inheritance diagram for TPProto::CacheMethod:

Public Member Functions | |
| CacheMethod () | |
| Default Constructor. | |
| CacheMethod (const CacheMethod &rhs) | |
| Copy Constructor, sets all fields to NULL. Subclasses should call this, and initialise any fields it might have. | |
| virtual | ~CacheMethod () |
| Destructor, virtual. | |
| virtual void | update ()=0 |
| Called when the client wants to update the cache. Can do nothing. | |
| void | setCache (Cache *c) |
| Sets the Cache object this CacheMethod is for. CacheMethods can (and need to) use the Cache to get useful information. | |
| void | setProtocolLayer (ProtocolLayer *pl) |
| Sets the ProtocolLayer to use. | |
| virtual void | getById (uint32_t id)=0 |
| Gets a item from the cache by Id. | |
| virtual void | markInvalid (uint32_t id)=0 |
| Marks an item as invalid. If a method wishes to it can refetch it from the server. The pointer to the frame should not be consided valid, and does not get deleted by the CacheMethod. | |
| void | getAllIds (const IdSetCallback &cb) |
| Gets all the ids. | |
| boost::signals::connection | watchAllIds (const IdSetCallback &cb) |
| virtual CacheMethod * | clone ()=0 |
| Returns an empty clone of this CacheMethod. body should be return new CacheMethodNameCopyConstructor(this);. | |
Protected Member Functions | |
| virtual void | getIdList ()=0 |
| void | newIdList (std::set< uint32_t > list) |
| void | existingList (std::set< uint32_t > list) |
Protected Attributes | |
| Cache * | cache |
| The Cache this CacheMethod will use. | |
| ProtocolLayer * | protocol |
| The ProtocolLayer that will be used. | |
| IdSetSignal | waiters |
| IdSetSignal | watchers |
| void TPProto::CacheMethod::setCache | ( | Cache * | c | ) |
Sets the Cache object this CacheMethod is for. CacheMethods can (and need to) use the Cache to get useful information.
| c | The Cache this cache method will be used for. |
| void TPProto::CacheMethod::setProtocolLayer | ( | ProtocolLayer * | pl | ) |
| virtual void TPProto::CacheMethod::getById | ( | uint32_t | id | ) | [pure virtual] |
Gets a item from the cache by Id.
Returned by call to Cache::newItem or Cache::existingItem
| id | The Id of the item to get. |
Implemented in TPProto::CacheNoneMethod.
| virtual void TPProto::CacheMethod::markInvalid | ( | uint32_t | id | ) | [pure virtual] |
Marks an item as invalid. If a method wishes to it can refetch it from the server. The pointer to the frame should not be consided valid, and does not get deleted by the CacheMethod.
| id | The id of the item that is invalid. |
Implemented in TPProto::CacheNoneMethod.
| void TPProto::CacheMethod::getAllIds | ( | const IdSetCallback & | cb | ) |
Gets all the ids.
| cb | The callback to send the set of ids to.. |
1.5.1