OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DBTableWalker Class Reference

#include <db_table_walker.h>

Collaboration diagram for DBTableWalker:

Classes

class  Walker
 
class  Worker
 

Public Types

typedef boost::function< bool(DBTablePartBase
*, DBEntryBase *)> 
WalkFn
 
typedef boost::function< void(DBTableBase *)> WalkCompleteFn
 
typedef int WalkId
 

Public Member Functions

 DBTableWalker (int task_id=-1)
 
WalkId WalkTable (DBTable *table, const DBRequestKey *key_start, WalkFn walker, WalkCompleteFn walk_complete, bool postpone_walk=false)
 
void WalkCancel (WalkId id)
 
void WalkResume (WalkId id)
 
int task_id () const
 

Static Public Member Functions

static void SetIterationToYield (int count)
 

Static Public Attributes

static const int kIterationToYield = 1024
 
static const WalkId kInvalidWalkerId = -1
 

Private Types

typedef std::vector< Walker * > WalkerList
 
typedef boost::dynamic_bitset WalkerMap
 

Private Member Functions

void PurgeWalker (WalkId id)
 

Static Private Member Functions

static int GetIterationToYield ()
 

Private Attributes

int task_id_
 
tbb::mutex walkers_mutex_
 
WalkerList walkers_
 
WalkerMap walker_map_
 

Static Private Attributes

static int max_iteration_to_yield_ = kIterationToYield
 

Detailed Description

Definition at line 18 of file db_table_walker.h.

Member Typedef Documentation

typedef boost::function<void(DBTableBase *)> DBTableWalker::WalkCompleteFn

Definition at line 29 of file db_table_walker.h.

typedef std::vector<Walker *> DBTableWalker::WalkerList
private

Definition at line 81 of file db_table_walker.h.

typedef boost::dynamic_bitset DBTableWalker::WalkerMap
private

Definition at line 84 of file db_table_walker.h.

typedef boost::function<bool(DBTablePartBase *, DBEntryBase *)> DBTableWalker::WalkFn

Definition at line 26 of file db_table_walker.h.

typedef int DBTableWalker::WalkId

Definition at line 31 of file db_table_walker.h.

Constructor & Destructor Documentation

DBTableWalker::DBTableWalker ( int  task_id = -1)

Definition at line 201 of file db_table_walker.cc.

Here is the call graph for this function:

Member Function Documentation

static int DBTableWalker::GetIterationToYield ( )
inlinestaticprivate

Definition at line 59 of file db_table_walker.h.

void DBTableWalker::PurgeWalker ( WalkId  id)
private

Definition at line 245 of file db_table_walker.cc.

Here is the call graph for this function:

static void DBTableWalker::SetIterationToYield ( int  count)
inlinestatic

Definition at line 52 of file db_table_walker.h.

int DBTableWalker::task_id ( ) const
inline

Definition at line 50 of file db_table_walker.h.

void DBTableWalker::WalkCancel ( WalkId  id)

Definition at line 234 of file db_table_walker.cc.

void DBTableWalker::WalkResume ( WalkId  id)

Definition at line 240 of file db_table_walker.cc.

DBTableWalker::WalkId DBTableWalker::WalkTable ( DBTable table,
const DBRequestKey key_start,
WalkFn  walker,
WalkCompleteFn  walk_complete,
bool  postpone_walk = false 
)

Definition at line 208 of file db_table_walker.cc.

Here is the call graph for this function:

Member Data Documentation

const WalkId DBTableWalker::kInvalidWalkerId = -1
static

Definition at line 34 of file db_table_walker.h.

const int DBTableWalker::kIterationToYield = 1024
static

Definition at line 33 of file db_table_walker.h.

int DBTableWalker::max_iteration_to_yield_ = kIterationToYield
staticprivate

Definition at line 57 of file db_table_walker.h.

int DBTableWalker::task_id_
private

Definition at line 90 of file db_table_walker.h.

WalkerMap DBTableWalker::walker_map_
private

Definition at line 93 of file db_table_walker.h.

WalkerList DBTableWalker::walkers_
private

Definition at line 92 of file db_table_walker.h.

tbb::mutex DBTableWalker::walkers_mutex_
private

Definition at line 91 of file db_table_walker.h.


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