My Project  debian-1:4.1.1-p2+ds-4build1
Public Member Functions | Data Fields
NoroCacheNode Class Reference

#include <tgb_internal.h>

Public Member Functions

 NoroCacheNode ()
 
NoroCacheNodesetNode (int branch, NoroCacheNode *node)
 
NoroCacheNodegetBranch (int branch)
 
virtual ~NoroCacheNode ()
 
NoroCacheNodegetOrInsertBranch (int branch)
 

Data Fields

NoroCacheNode ** branches
 
int branches_len
 

Detailed Description

Definition at line 427 of file tgb_internal.h.

Constructor & Destructor Documentation

◆ NoroCacheNode()

NoroCacheNode::NoroCacheNode ( )
inline

Definition at line 434 of file tgb_internal.h.

436  {
437  branches=NULL;
438  branches_len=0;
439 

◆ ~NoroCacheNode()

virtual NoroCacheNode::~NoroCacheNode ( )
inlinevirtual

Definition at line 476 of file tgb_internal.h.

478  {
479  int i;
480  for(i=0;i<branches_len;i++)
481  {
482  delete branches[i];
483  }
484  omfree(branches);

Member Function Documentation

◆ getBranch()

NoroCacheNode* NoroCacheNode::getBranch ( int  branch)
inline

Definition at line 471 of file tgb_internal.h.

473  {
474  if (branch<branches_len) return branches[branch];
475  return NULL;

◆ getOrInsertBranch()

NoroCacheNode* NoroCacheNode::getOrInsertBranch ( int  branch)
inline

Definition at line 485 of file tgb_internal.h.

487  {
488  if ((branch<branches_len)&&(branches[branch]))
489  return branches[branch];
490  else
491  {
492  return setNode(branch,new NoroCacheNode());
493  }

◆ setNode()

NoroCacheNode* NoroCacheNode::setNode ( int  branch,
NoroCacheNode node 
)
inline

Definition at line 440 of file tgb_internal.h.

442  {
443  if (branch>=branches_len)
444  {
445  if (branches==NULL)
446  {
447  branches_len=branch+1;
450  int i;
451  for(i=0;i<branches_len;i++)
452  {
453  branches[i]=NULL;
454  }
455  }
456  else
457  {
458  int branches_len_old=branches_len;
459  branches_len=branch+1;
461  int i;
462  for(i=branches_len_old;i<branches_len;i++)
463  {
464  branches[i]=NULL;
465  }
466  }
467  }
468  assume(branches[branch]==NULL);
469  branches[branch]=node;
470  return node;

Field Documentation

◆ branches

NoroCacheNode** NoroCacheNode::branches

Definition at line 430 of file tgb_internal.h.

◆ branches_len

int NoroCacheNode::branches_len

Definition at line 431 of file tgb_internal.h.


The documentation for this class was generated from the following file:
NoroCacheNode::setNode
NoroCacheNode * setNode(int branch, NoroCacheNode *node)
Definition: tgb_internal.h:440
NoroCacheNode
Definition: tgb_internal.h:427
NoroCacheNode::branches_len
int branches_len
Definition: tgb_internal.h:431
i
int i
Definition: cfEzgcd.cc:125
omrealloc
#define omrealloc(addr, size)
Definition: omAllocDecl.h:231
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:208
si_max
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:9
NoroCacheNode::NoroCacheNode
NoroCacheNode()
Definition: tgb_internal.h:434
NoroCacheNode::branches
NoroCacheNode ** branches
Definition: tgb_internal.h:430
omfree
#define omfree(addr)
Definition: omAllocDecl.h:235