A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/concurrent__map_8hpp_source.html below:

NCBI C++ ToolKit: src/app/netcache/concurrent_map.hpp Source File

1 #ifndef NETCACHE__CONCURRENT_MAP__HPP 2 #define NETCACHE__CONCURRENT_MAP__HPP 48 template

<

class

Value>

51  template

<

class

Other>

71  class

Comparator = less<Key>,

108  typedef typename

Allocator::template rebind<SNode>::other

TNodeAlloc

;

109  typedef typename

Allocator::template rebind<SLeafNode>::other

TLeafAlloc

;

176

ret_value =

x_Value

(node, key_index);

298  if

(key_ref && key_ref->

ref_cnt

.

Add

(-1) == 0)

309  if

(!to_ref || to_ref->

ref_cnt

.

Add

(-1) != 0)

321  if

(left_ref ==

NULL

)

327  if

(right_ref ==

NULL

)

333  if

(right_ref ==

NULL

)

335  else if

(left_ref ==

NULL

)

346  return reinterpret_cast<SLeafNode

*

>

(node)->values[index];

357  while

(low_bound != high_bound) {

358  unsigned int

mid = (low_bound + high_bound) / 2;

368  if

(key_ref !=

NULL

)

372  while

(index > 0 && node->

keys

[index - 1] ==

NULL

) {

383  while

(index < kCntChildsInNode && node->status[index] ==

eValueDeleted

);

405  size_t

sz_ptrs = (right_index - ins_index) *

sizeof

(

void

*);

406  size_t

sz_statuses = (right_index - ins_index) *

sizeof

(

EValueStatus

);

407  memmove

(&node->

keys

[ins_index + 1], &node->

keys

[ins_index], sz_ptrs);

409

node->

keys

[ins_index] = key_ref;

412  for

(

int i

= right_index;

i

> ins_index; --

i

)

421

ins_index = index - 1;

422  unsigned int

left_index = ins_index - 1;

428  size_t

sz_ptrs = (ins_index - left_index) *

sizeof

(

void

*);

429  size_t

sz_statuses = (ins_index - left_index) *

sizeof

(

EValueStatus

);

430  memmove

(&node->

keys

[left_index], &node->

keys

[left_index + 1], sz_ptrs);

432

node->

keys

[ins_index] = key_ref;

435  for

(

int i

= left_index;

i

< ins_index; ++

i

)

448

ins_index = index - 1;

466

node->

keys

[

i

] = max_key;

509  for

(

int

node_ind = 0; node_ind + 1 > 0; ) {

510  SNode

* node = node_stack[node_ind];

522

ind_in_node[node_ind] = ++child_ind;

524

node_stack [node_ind] = child;

525

ind_in_node[node_ind] = 0;

651  SNode

* wait_child_value)

660

|| node->

keys

[index] != wait_key_ref

661

|| node->

childs

[index] != wait_child_value)

708

value_ptr = &

x_Value

(node, index);

742  bool

success =

false

;

807  SNode

* last_node = add_node;

810

last_node->

childs

[0] = next_node;

813

last_node = next_node;

855

ins_index = key_index;

861

node->

childs

[ins_index] = value_node;

872  const size_t

sz_right_ptrs = (

kCntChildsInNode

- left_cnt) *

sizeof

(

void

*);

874

memcpy(&right_node->

keys

[left_cnt], &node->

keys

[left_cnt], sz_right_ptrs);

875

memcpy(&right_node->

status

[left_cnt], &node->

status

[left_cnt], sz_right_stats);

883

memcpy(&right_node->

childs

[left_cnt], &node->

childs

[left_cnt], sz_right_ptrs);

885

memcpy(&node->

keys

[left_cnt], &right_node->

keys

[0], left_cnt *

sizeof

(

void

*));

890

memset(&node->

childs

[left_cnt],

NULL

, sz_right_ptrs);

936

&& node->

childs

[right_index] == left_node);

937

node->

childs

[right_index] = right_node;

955

call_ctx.

tree_path

[new_height] = new_root;

956  while

(call_ctx.

cur_level

!= old_height + 1) {

965  "Concurrent map is too deep"

);

970

call_ctx.

tree_path

[new_height] = new_root;

void Delete(SNode *node) const

CFinalNodeDeleter(TTree *tree)

void x_ExchangeNodeLocks(SCallContext &call_ctx, SNode *node_to_lock) const

void x_FinalizeCallContext(SCallContext &call_ctx) const

CConcurrentMap & operator=(const CConcurrentMap &)

Allocator::template rebind< SLeafNode >::other TLeafAlloc

void x_UnlockCurNode(SCallContext &call_ctx) const

TNodeIndex x_GetNextIndex(SNode *node, TNodeIndex index) const

void x_AddRegularSplit(SCallContext &call_ctx)

CAtomicCounter m_CntNodes

bool x_IsKeyLess(const TKey &left_key, const TKey &right_key) const

bool x_EraseIf(const TKey &key, EValueStatus status)

bool PassivateKey(const TKey &key)

TValue & x_Value(SNode *node, TNodeIndex index) const

TTreeHeight GetTreeHeight(void) const

bool x_CreatePathToLeaf(SCallContext &call_ctx)

void x_GetRootAndHeight(SNode *&node, TTreeHeight &height, bool add_ref) const

CConcurrentMap(const CConcurrentMap &)

bool x_IsNodeToBeDeleted(SNode *node) const

SNode * x_LockCurNode(SCallContext &call_ctx, ERWLockType lock_type) const

TDeferredDeleter m_NodesDeleter

CAtomicCounter m_CntLeafNodes

TNodeIndex x_LockNodeAndWaitKey(SCallContext &call_ctx, SRefedKey *wait_key_ref, SNode *wait_child_value)

void x_AssignKeyRef(SRefedKey *&to_ref, SRefedKey *from_ref)

bool x_IsKeyLess(const SRefedKey *left_ref, const SRefedKey *right_ref) const

bool x_LockLeafNode(SCallContext &call_ctx, ERWLockType lock_type) const

bool x_IsKeyLess(const SRefedKey *left_ref, const TKey &right_key) const

bool x_DiveAndFindKey(SCallContext &call_ctx, ERWLockType leaf_lock_type, TNodeIndex &key_index) const

CAtomicCounter m_CntRootRefs

TNodeIndex x_FindContainingIndex(SNode *node, const TKey &key) const

void x_DeleteEmptyNodes(SCallContext &call_ctx)

void x_ScanForInsertSpace(SNode *node, TNodeIndex &index, TNodeIndex &ins_index)

void x_AssignKeyRef(SRefedKey *&to_ref, const TKey &key)

void x_CheckRootSplit(SCallContext &call_ctx)

@ eValuePassive

Must be 0.

TNodeIndex x_AddNodeKey(SCallContext &call_ctx, SNode *node, SRefedKey *key_ref, SNode *value_node)

bool x_SetValueStatus(const TKey &key, EValueStatus status)

void x_MoveOneLevelUp(SCallContext &call_ctx) const

friend class CFinalNodeDeleter

bool x_DiveAndCreateValue(SCallContext &call_ctx, const TValue &value, TNodeIndex &key_index, TValue *&value_ptr)

TNodeIndex x_FindKeyIndex(SNode *node, const SRefedKey *key_ref) const

bool ActivateKey(const TKey &key)

bool x_DiveToNextLevel(SCallContext &call_ctx) const

void x_DeleteNode(SNode *node)

void x_FindInsertSpace(SNode *node, TNodeIndex &index, TNodeIndex &ins_index)

Allocator::template rebind< SRefedKey >::other TRefedKeyAlloc

void Put(const TKey &key, const TValue &value)

void x_AddNewRoot(SCallContext &call_ctx)

void x_FinalDeleteNode(SNode *node)

Uint4 GetCntNodes(void) const

bool x_IsKeyLess(const TKey &left_key, const SRefedKey *right_ref) const

bool PutOrGet(const TKey &key, const TValue &value, EGetValueType get_type, TValue &ret_value)

void x_DeleteKey(SCallContext &call_ctx, TNodeIndex key_index)

Delete key from the tree.

Uint4 GetCntValues(void) const

Uint4 GetCntLeafNodes(void) const

TRefedKeyAlloc m_RefedKeyAlloc

bool x_CanShrinkTree(void) const

bool EraseIfPassive(const TKey &key)

void x_SplitNode(SCallContext &call_ctx, SNode *node)

bool x_DiveToLeafLevel(SCallContext &call_ctx) const

void x_InitializeCallContext(SCallContext &call_ctx) const

SNode * x_CreateNode(SRefedKey *max_key, TTreeHeight tree_level)

TNodeIndex x_FindKeyIndex(SNode *node, const TKey &key) const

void Clear(void)

Caller is responsible to not make this call concurrent with any other method call (the same as callin...

CConcurrentMap< TKey, TValue, TComparator, TKeyAlloc, kCntChildsInNode, kMaxTreeHeight, kDeletionDelay, kDelStoreCapacity > TTree

bool x_IsKeyFound(SNode *node, const TKey &key, TNodeIndex index) const

void x_PropagateSplit(SCallContext &call_ctx)

bool Get(const TKey &key, TValue &value) const

void x_ChangeRoot(SNode *new_root, TTreeHeight new_height)

Allocator::template rebind< SNode >::other TNodeAlloc

void x_AddKeyRef(SRefedKey *key_ref, Uint4 cnt_ref=1)

CNCDeferredDeleter< SNode *, CFinalNodeDeleter, kDeletionDelay, kDelStoreCapacity > TDeferredDeleter

void x_DerefKey(SRefedKey *key_ref)

map< TKey, TValue, TComparator > TMap

void x_MoveOneLevelDown(SCallContext &call_ctx, TNodeIndex index) const

CAtomicCounter m_CntValues

TValue * x_InsertLeafValue(SCallContext &call_ctx, SNode *node, TNodeIndex key_index, const TValue &value)

bool Erase(const TKey &key)

Concept for allocating, resizing and freeing memory block.

void Set(TValue new_value) THROWS_NONE

Set atomic counter value.

TValue Add(int delta) THROWS_NONE

Atomically add value (=delta), and return new counter value.

TValue Get(void) const THROWS_NONE

Get atomic counter value.

#define DIAG_COMPILE_INFO

Make compile time diagnostic information object to use in CNcbiDiag and CException.

static void DiagTrouble(const CDiagCompileInfo &info, const char *message=NULL)

Display trouble error message.

uint8_t Uint1

1-byte (8-bit) unsigned integer

uint32_t Uint4

4-byte (32-bit) unsigned integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

#define NCBI_SCHED_YIELD()

ERWLockType

Type of locking provided by CYieldingRWLock.

const struct ncbi::grid::netcache::search::fields::KEY key

const GenericPointer< typename T::ValueType > T2 value

GenericValue< UTF8<> > Value

GenericValue with UTF8 encoding.

Multi-threading – atomic pointer exchange function.

#define NCBI_PACKED_ENUM_END()

#define NCBI_PACKED_ENUM_TYPE(type)

SNode * tree_path[kMaxTreeHeight+1]

SCallContext(const TKey &key)

TValue values[kCntChildsInNode]

SRefedKey * keys[kCntChildsInNode]

EValueStatus status[kCntChildsInNode]

SNode * childs[kCntChildsInNode]

SConstructAllocator< Other > other

static Value * allocate(void)

static void deallocate(Value *value)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4