My Project  debian-1:4.1.2-p1+ds-2
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 432 of file tgb_internal.h.

Constructor & Destructor Documentation

◆ NoroCacheNode()

NoroCacheNode::NoroCacheNode ( )
inline

Definition at line 439 of file tgb_internal.h.

440  {
441  branches=NULL;
442  branches_len=0;
443 
444  }
NoroCacheNode ** branches
Definition: tgb_internal.h:435
#define NULL
Definition: omList.c:12

◆ ~NoroCacheNode()

virtual NoroCacheNode::~NoroCacheNode ( )
inlinevirtual

Definition at line 481 of file tgb_internal.h.

482  {
483  int i;
484  for(i=0;i<branches_len;i++)
485  {
486  delete branches[i];
487  }
488  omfree(branches);
489  }
int i
Definition: cfEzgcd.cc:125
#define omfree(addr)
Definition: omAllocDecl.h:237

Member Function Documentation

◆ getBranch()

NoroCacheNode* NoroCacheNode::getBranch ( int  branch)
inline

Definition at line 476 of file tgb_internal.h.

477  {
478  if (branch<branches_len) return branches[branch];
479  return NULL;
480  }

◆ getOrInsertBranch()

NoroCacheNode* NoroCacheNode::getOrInsertBranch ( int  branch)
inline

Definition at line 490 of file tgb_internal.h.

491  {
492  if ((branch<branches_len)&&(branches[branch]))
493  return branches[branch];
494  else
495  {
496  return setNode(branch,new NoroCacheNode());
497  }
498  }
NoroCacheNode * setNode(int branch, NoroCacheNode *node)
Definition: tgb_internal.h:445

◆ setNode()

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

Definition at line 445 of file tgb_internal.h.

446  {
447  if (branch>=branches_len)
448  {
449  if (branches==NULL)
450  {
451  branches_len=branch+1;
454  int i;
455  for(i=0;i<branches_len;i++)
456  {
457  branches[i]=NULL;
458  }
459  }
460  else
461  {
462  int branches_len_old=branches_len;
463  branches_len=branch+1;
465  int i;
466  for(i=branches_len_old;i<branches_len;i++)
467  {
468  branches[i]=NULL;
469  }
470  }
471  }
472  assume(branches[branch]==NULL);
473  branches[branch]=node;
474  return node;
475  }
static int si_max(const int a, const int b)
Definition: auxiliary.h:140
#define assume(x)
Definition: mod2.h:390
#define omrealloc(addr, size)
Definition: omAllocDecl.h:233
#define omAlloc(size)
Definition: omAllocDecl.h:210

Field Documentation

◆ branches

NoroCacheNode** NoroCacheNode::branches

Definition at line 435 of file tgb_internal.h.

◆ branches_len

int NoroCacheNode::branches_len

Definition at line 436 of file tgb_internal.h.


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