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 429 of file tgb_internal.h.

Constructor & Destructor Documentation

NoroCacheNode::NoroCacheNode ( )
inline

Definition at line 436 of file tgb_internal.h.

437  {
438  branches=NULL;
439  branches_len=0;
440 
441  }
#define NULL
Definition: omList.c:10
NoroCacheNode ** branches
Definition: tgb_internal.h:432
virtual NoroCacheNode::~NoroCacheNode ( )
inlinevirtual

Definition at line 478 of file tgb_internal.h.

479  {
480  int i;
481  for(i=0;i<branches_len;i++)
482  {
483  delete branches[i];
484  }
485  omfree(branches);
486  }
#define omfree(addr)
Definition: omAllocDecl.h:237
int i
Definition: cfEzgcd.cc:123
NoroCacheNode ** branches
Definition: tgb_internal.h:432

Member Function Documentation

NoroCacheNode* NoroCacheNode::getBranch ( int  branch)
inline

Definition at line 473 of file tgb_internal.h.

474  {
475  if (branch<branches_len) return branches[branch];
476  return NULL;
477  }
#define NULL
Definition: omList.c:10
NoroCacheNode ** branches
Definition: tgb_internal.h:432
NoroCacheNode* NoroCacheNode::getOrInsertBranch ( int  branch)
inline

Definition at line 487 of file tgb_internal.h.

488  {
489  if ((branch<branches_len)&&(branches[branch]))
490  return branches[branch];
491  else
492  {
493  return setNode(branch,new NoroCacheNode());
494  }
495  }
NoroCacheNode * setNode(int branch, NoroCacheNode *node)
Definition: tgb_internal.h:442
NoroCacheNode ** branches
Definition: tgb_internal.h:432
NoroCacheNode* NoroCacheNode::setNode ( int  branch,
NoroCacheNode node 
)
inline

Definition at line 442 of file tgb_internal.h.

443  {
444  if (branch>=branches_len)
445  {
446  if (branches==NULL)
447  {
448  branches_len=branch+1;
451  int i;
452  for(i=0;i<branches_len;i++)
453  {
454  branches[i]=NULL;
455  }
456  }
457  else
458  {
459  int branches_len_old=branches_len;
460  branches_len=branch+1;
462  int i;
463  for(i=branches_len_old;i<branches_len;i++)
464  {
465  branches[i]=NULL;
466  }
467  }
468  }
469  assume(branches[branch]==NULL);
470  branches[branch]=node;
471  return node;
472  }
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define assume(x)
Definition: mod2.h:405
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
#define omrealloc(addr, size)
Definition: omAllocDecl.h:233
#define NULL
Definition: omList.c:10
NoroCacheNode ** branches
Definition: tgb_internal.h:432

Field Documentation

NoroCacheNode** NoroCacheNode::branches

Definition at line 432 of file tgb_internal.h.

int NoroCacheNode::branches_len

Definition at line 433 of file tgb_internal.h.


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