My Project
Loading...
Searching...
No Matches
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 418 of file tgb_internal.h.

Constructor & Destructor Documentation

◆ NoroCacheNode()

NoroCacheNode::NoroCacheNode ( )
inline

Definition at line 425 of file tgb_internal.h.

426 {
428 branches_len=0;
429
430 }
NoroCacheNode ** branches
Definition: tgb_internal.h:421
#define NULL
Definition: omList.c:12

◆ ~NoroCacheNode()

virtual NoroCacheNode::~NoroCacheNode ( )
inlinevirtual

Definition at line 467 of file tgb_internal.h.

468 {
469 int i;
470 for(i=0;i<branches_len;i++)
471 {
472 delete branches[i];
473 }
475 }
int i
Definition: cfEzgcd.cc:132
#define omfree(addr)
Definition: omAllocDecl.h:237

Member Function Documentation

◆ getBranch()

NoroCacheNode * NoroCacheNode::getBranch ( int  branch)
inline

Definition at line 462 of file tgb_internal.h.

463 {
464 if (branch<branches_len) return branches[branch];
465 return NULL;
466 }

◆ getOrInsertBranch()

NoroCacheNode * NoroCacheNode::getOrInsertBranch ( int  branch)
inline

Definition at line 476 of file tgb_internal.h.

477 {
478 if ((branch<branches_len)&&(branches[branch]))
479 return branches[branch];
480 else
481 {
482 return setNode(branch,new NoroCacheNode());
483 }
484 }
NoroCacheNode * setNode(int branch, NoroCacheNode *node)
Definition: tgb_internal.h:431

◆ setNode()

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

Definition at line 431 of file tgb_internal.h.

432 {
433 if (branch>=branches_len)
434 {
435 if (branches==NULL)
436 {
437 branches_len=branch+1;
440 int i;
441 for(i=0;i<branches_len;i++)
442 {
443 branches[i]=NULL;
444 }
445 }
446 else
447 {
448 int branches_len_old=branches_len;
449 branches_len=branch+1;
451 int i;
452 for(i=branches_len_old;i<branches_len;i++)
453 {
454 branches[i]=NULL;
455 }
456 }
457 }
458 assume(branches[branch]==NULL);
459 branches[branch]=node;
460 return node;
461 }
static int si_max(const int a, const int b)
Definition: auxiliary.h:124
#define assume(x)
Definition: mod2.h:387
#define omrealloc(addr, size)
Definition: omAllocDecl.h:233
#define omAlloc(size)
Definition: omAllocDecl.h:210

Field Documentation

◆ branches

NoroCacheNode** NoroCacheNode::branches

Definition at line 421 of file tgb_internal.h.

◆ branches_len

int NoroCacheNode::branches_len

Definition at line 422 of file tgb_internal.h.


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