MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ib_counter_t< Type, N, Indexer > Class Template Reference

#include <ut0counter.h>

Public Member Functions

bool validate () UNIV_NOTHROW
void inc () UNIV_NOTHROW
void add (Type n) UNIV_NOTHROW
void add (size_t index, Type n) UNIV_NOTHROW
void dec () UNIV_NOTHROW
void sub (Type n) UNIV_NOTHROW
void sub (size_t index, Type n) UNIV_NOTHROW
 operator Type () const UNIV_NOTHROW

Detailed Description

template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
class ib_counter_t< Type, N, Indexer >

Class for using fuzzy counters. The counter is not protected by any

mutex and the results are not guaranteed to be 100% accurate but close enough. Creates an array of counters and separates each element by the CACHE_LINE_SIZE bytes

Definition at line 111 of file ut0counter.h.

Member Function Documentation

template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
void ib_counter_t< Type, N, Indexer >::add ( Type  n)
inline

If you can't use a good index id.

Parameters
n- is the amount to increment

Definition at line 139 of file ut0counter.h.

Here is the caller graph for this function:

template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
void ib_counter_t< Type, N, Indexer >::add ( size_t  index,
Type  n 
)
inline
Use this if you can use a unique indentifier, saves a

call to get_rnd_index().

Parameters
i- index into a slot
n- amount to increment

Definition at line 151 of file ut0counter.h.

template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
void ib_counter_t< Type, N, Indexer >::dec ( )
inline

If you can't use a good index id. Decrement by 1.

Definition at line 160 of file ut0counter.h.

Here is the caller graph for this function:

template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
void ib_counter_t< Type, N, Indexer >::inc ( )
inline

If you can't use a good index id. Increment by 1.

Definition at line 135 of file ut0counter.h.

Here is the caller graph for this function:

template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
void ib_counter_t< Type, N, Indexer >::sub ( Type  n)
inline

If you can't use a good index id.

Parameters
-n is the amount to decrement

Definition at line 164 of file ut0counter.h.

Here is the caller graph for this function:

template<typename Type, int N = IB_N_SLOTS, template< typename, int > class Indexer = thread_id_indexer_t>
void ib_counter_t< Type, N, Indexer >::sub ( size_t  index,
Type  n 
)
inline
Use this if you can use a unique indentifier, saves a

call to get_rnd_index().

Parameters
i- index into a slot
n- amount to decrement

Definition at line 176 of file ut0counter.h.


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