OpenSDN source code
TokenPool Class Reference

#include <flow_token.h>

Inheritance diagram for TokenPool:
Collaboration diagram for TokenPool:

Public Member Functions

 TokenPool (const std::string &name, Proto *proto, int count)
 
virtual ~TokenPool ()
 
virtual TokenPtr GetToken ()
 
int token_count () const
 
bool TokenCheck () const
 
uint64_t failures () const
 
void IncrementRestarts ()
 
uint64_t restarts () const
 

Protected Member Functions

void FreeToken ()
 
 DISALLOW_COPY_AND_ASSIGN (TokenPool)
 

Protected Attributes

std::string name_
 
int max_tokens_
 
int min_tokens_
 
int low_water_mark_
 
tbb::atomic< int > token_count_
 
uint64_t failures_
 
uint64_t restarts_
 
Protoproto_
 

Friends

class Token
 

Detailed Description

Definition at line 25 of file flow_token.h.

Constructor & Destructor Documentation

◆ TokenPool()

TokenPool::TokenPool ( const std::string &  name,
Proto proto,
int  count 
)

Definition at line 13 of file flow_token.cc.

◆ ~TokenPool()

TokenPool::~TokenPool ( )
virtual

Definition at line 21 of file flow_token.cc.

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

TokenPool::DISALLOW_COPY_AND_ASSIGN ( TokenPool  )
protected

◆ failures()

uint64_t TokenPool::failures ( ) const
inline

Definition at line 33 of file flow_token.h.

◆ FreeToken()

void TokenPool::FreeToken ( )
protected

Definition at line 24 of file flow_token.cc.

Here is the call graph for this function:

◆ GetToken()

TokenPtr TokenPool::GetToken ( )
virtual

Definition at line 41 of file flow_token.cc.

◆ IncrementRestarts()

void TokenPool::IncrementRestarts ( )
inline

Definition at line 34 of file flow_token.h.

◆ restarts()

uint64_t TokenPool::restarts ( ) const
inline

Definition at line 35 of file flow_token.h.

◆ token_count()

int TokenPool::token_count ( ) const
inline

Definition at line 31 of file flow_token.h.

◆ TokenCheck()

bool TokenPool::TokenCheck ( ) const

Definition at line 32 of file flow_token.cc.

Friends And Related Function Documentation

◆ Token

friend class Token
friend

Definition at line 37 of file flow_token.h.

Member Data Documentation

◆ failures_

uint64_t TokenPool::failures_
mutableprotected

Definition at line 47 of file flow_token.h.

◆ low_water_mark_

int TokenPool::low_water_mark_
protected

Definition at line 45 of file flow_token.h.

◆ max_tokens_

int TokenPool::max_tokens_
protected

Definition at line 43 of file flow_token.h.

◆ min_tokens_

int TokenPool::min_tokens_
protected

Definition at line 44 of file flow_token.h.

◆ name_

std::string TokenPool::name_
protected

Definition at line 42 of file flow_token.h.

◆ proto_

Proto* TokenPool::proto_
protected

Definition at line 49 of file flow_token.h.

◆ restarts_

uint64_t TokenPool::restarts_
protected

Definition at line 48 of file flow_token.h.

◆ token_count_

tbb::atomic<int> TokenPool::token_count_
protected

Definition at line 46 of file flow_token.h.


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