Public Member Functions | Public Attributes
vcg::Controller< Token > Class Template Reference

#include <controller.h>

List of all members.

Public Member Functions

void addCache (Cache< Token > *cache)
 called before the cache is started to add a cache in the chain
bool addToken (Token *token)
 insert the token in the cache if not already present (actual insertion is done on updatePriorities)
 Controller ()
void finish ()
void flush ()
 empty all caches AND REMOVES ALL TOKENS!
bool isWaiting ()
bool newData ()
void pause ()
template<class FUNCTOR >
void removeTokens (FUNCTOR functor)
 WARNING: migh stall for the time needed to drop tokens from cache.
void resume ()
void setMaxTokens (int m)
 if more tokens than m present in the provider, lowest priority ones will be removed
void start ()
 start the various cache threads.
void stop ()
 stops the cache threads
void updatePriorities ()
 ~Controller ()

Public Attributes

std::vector< Cache< Token > * > caches
 should be protected
bool paused
Provider< Tokenprovider
 should be protected
bool stopped
 all cache threads are stopped
std::vector< Token * > tokens
 tokens waiting to be added, should be private

Detailed Description

template<class Token>
class vcg::Controller< Token >

Definition at line 11 of file controller.h.


Constructor & Destructor Documentation

template<class Token >
vcg::Controller< Token >::Controller ( ) [inline]

Definition at line 27 of file controller.h.

template<class Token >
vcg::Controller< Token >::~Controller ( ) [inline]

Definition at line 28 of file controller.h.


Member Function Documentation

template<class Token >
void vcg::Controller< Token >::addCache ( Cache< Token > *  cache) [inline]

called before the cache is started to add a cache in the chain

The order in which the caches are added is from the lowest to the highest.

Definition at line 32 of file controller.h.

template<class Token >
bool vcg::Controller< Token >::addToken ( Token token) [inline]

insert the token in the cache if not already present (actual insertion is done on updatePriorities)

Definition at line 42 of file controller.h.

template<class Token >
void vcg::Controller< Token >::finish ( ) [inline]

Definition at line 116 of file controller.h.

template<class Token >
void vcg::Controller< Token >::flush ( ) [inline]

empty all caches AND REMOVES ALL TOKENS!

Definition at line 158 of file controller.h.

template<class Token >
bool vcg::Controller< Token >::isWaiting ( ) [inline]

Definition at line 172 of file controller.h.

template<class Token >
bool vcg::Controller< Token >::newData ( ) [inline]

Definition at line 164 of file controller.h.

template<class Token >
void vcg::Controller< Token >::pause ( ) [inline]

Definition at line 121 of file controller.h.

template<class Token >
template<class FUNCTOR >
void vcg::Controller< Token >::removeTokens ( FUNCTOR  functor) [inline]

WARNING: migh stall for the time needed to drop tokens from cache.

Definition at line 52 of file controller.h.

template<class Token >
void vcg::Controller< Token >::resume ( ) [inline]

Definition at line 140 of file controller.h.

template<class Token >
void vcg::Controller< Token >::setMaxTokens ( int  m) [inline]

if more tokens than m present in the provider, lowest priority ones will be removed

Definition at line 62 of file controller.h.

template<class Token >
void vcg::Controller< Token >::start ( ) [inline]

start the various cache threads.

Definition at line 83 of file controller.h.

template<class Token >
void vcg::Controller< Token >::stop ( ) [inline]

stops the cache threads

Definition at line 94 of file controller.h.

template<class Token >
void vcg::Controller< Token >::updatePriorities ( ) [inline]

ensure that added tokens are processed and existing ones have their priority updated. potential bug! update is done on the heaps, if something is in transit...

Definition at line 69 of file controller.h.


Member Data Documentation

template<class Token >
std::vector<Cache<Token> *> vcg::Controller< Token >::caches

should be protected

Definition at line 25 of file controller.h.

template<class Token >
bool vcg::Controller< Token >::paused

threads still running, but no door is open in caches, transfers might still be going on!

Definition at line 17 of file controller.h.

template<class Token >
Provider<Token> vcg::Controller< Token >::provider

should be protected

Definition at line 23 of file controller.h.

template<class Token >
bool vcg::Controller< Token >::stopped

all cache threads are stopped

Definition at line 19 of file controller.h.

template<class Token >
std::vector<Token *> vcg::Controller< Token >::tokens

tokens waiting to be added, should be private

Definition at line 14 of file controller.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:10