Loading...
Searching...
No Matches
NoroCacheNode Class Reference

`#include <tgb_internal.h>`

## Public Member Functions

| NoroCacheNode ()
NoroCacheNode * | setNode (int branch, NoroCacheNode *node)
NoroCacheNode * | getBranch (int branch)
virtual | ~NoroCacheNode ()
NoroCacheNode * | getOrInsertBranch (int branch)

## Data Fields

NoroCacheNode ** | branches
int | branches_len

## Detailed Description

Definition at line 414 of file tgb_internal.h.

## Constructor & Destructor Documentation

## NoroCacheNode()

NoroCacheNode::NoroCacheNode | ( |  | ) |

inline

Definition at line 421 of file tgb_internal.h.

{
branches=NULL;
branches_len=0;
}
NoroCacheNode::branches_len
int branches_len
Definition tgb_internal.h:418
NoroCacheNode::branches
NoroCacheNode ** branches
Definition tgb_internal.h:417
NULL
#define NULL
Definition omList.c:12

## ~NoroCacheNode()

virtual NoroCacheNode::~NoroCacheNode | ( |  | ) |

inline virtual

Definition at line 463 of file tgb_internal.h.

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

## Member Function Documentation

## getBranch()

NoroCacheNode * NoroCacheNode::getBranch | ( | int | branch | ) |

inline

Definition at line 458 of file tgb_internal.h.

{
if (branch<branches_len) return branches[branch];
return NULL;
}

## getOrInsertBranch()

NoroCacheNode * NoroCacheNode::getOrInsertBranch | ( | int | branch | ) |

inline

Definition at line 472 of file tgb_internal.h.

{
if ((branch<branches_len)&&(branches[branch]))
return branches[branch];
else
{
return setNode(branch,new NoroCacheNode());
}
}
NoroCacheNode::setNode
NoroCacheNode * setNode(int branch, NoroCacheNode *node)
Definition tgb_internal.h:427
NoroCacheNode::NoroCacheNode
NoroCacheNode()
Definition tgb_internal.h:421

## setNode()

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

inline

Definition at line 427 of file tgb_internal.h.

{
if (branch>=branches_len)
{
if (branches==NULL)
{
branches_len=branch+1;
branches_len=si_max(branches_len,3);
branches=(NoroCacheNode**) omAlloc(branches_len*sizeof(NoroCacheNode*));
int i;
for(i=0;i<branches_len;i++)
{
branches[i]=NULL;
}
}
else
{
int branches_len_old=branches_len;
branches_len=branch+1;
branches=(NoroCacheNode**) omrealloc(branches,branches_len*sizeof(NoroCacheNode*));
int i;
for(i=branches_len_old;i<branches_len;i++)
{
branches[i]=NULL;
}
}
}
assume(branches[branch]==NULL);
branches[branch]=node;
return node;
}
si_max
static int si_max(const int a, const int b)
Definition auxiliary.h:125
assume
#define assume(x)
Definition mod2.h:389
omrealloc
#define omrealloc(addr, size)
Definition omAllocDecl.h:233
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210

## Field Documentation

## branches

NoroCacheNode** NoroCacheNode::branches

Definition at line 417 of file tgb_internal.h.

## branches_len

int NoroCacheNode::branches_len

Definition at line 418 of file tgb_internal.h.

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

- kernel/GBEngine/tgb_internal.h