Loading...
Searching...
No Matches
idrec Class Reference

`#include <idrec.h>`

## Public Member Functions

| idrec ()
void | Init ()
idhdl | get (const char *s, int lev)
idhdl | get_level (const char *s, int lev)
idhdl | set (const char *s, int lev, int t, BOOLEAN init=TRUE)
char * | String (BOOLEAN typed=FALSE)

## Data Fields

idhdl | next
const char * | id
utypes | data
attr | attribute
BITSET | flag
int | typ
short | lev
short | ref
unsigned long | id_i

## Detailed Description

Definition at line 34 of file idrec.h.

## Constructor & Destructor Documentation

## idrec()

idrec::idrec | ( |  | ) |

inline

Definition at line 49 of file idrec.h.

{ memset(this,0,sizeof(*this)); }

## Member Function Documentation

## get()

idhdl idrec::get | ( | const char * | s,
|  | int | lev )

Definition at line 70 of file ipid.cc.

{
assume(s!=NULL);
assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
idhdl h = this;
idhdl found=NULL;
int l;
const char *id_;
unsigned long i=iiS2I(s);
char *dummy=(char*)&i;
BOOLEAN less4=(dummy[SIZEOF_LONG-1]=='\0');
while (h!=NULL)
{
omCheckAddr((ADDRESS)IDID(h));
l=IDLEV(h);
if ((l==0)||(l==level))
{
if (i==h->id_i)
{
id_=IDID(h);
if (less4 || (0 == strcmp(s+SIZEOF_LONG,id_+SIZEOF_LONG)))
{
if(l==level) return h;
found=h;
}
}
}
h = IDNEXT(h);
}
return found;
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
level
int level(const CanonicalForm &f)
Definition canonicalform.h:331
l
int l
Definition cfEzgcd.cc:100
i
int i
Definition cfEzgcd.cc:132
s
const CanonicalForm int s
Definition facAbsFact.cc:51
found
bool found
Definition facFactorize.cc:55
iiS2I
static long iiS2I(const char *s)
Definition ipid.cc:63
IDNEXT
#define IDNEXT(a)
Definition ipid.h:118
IDID
#define IDID(a)
Definition ipid.h:122
IDLEV
#define IDLEV(a)
Definition ipid.h:121
h
STATIC_VAR Poly * h
Definition janet.cc:971
assume
#define assume(x)
Definition mod2.h:389
omCheckAddr
#define omCheckAddr(addr)
Definition omAllocDecl.h:328
NULL
#define NULL
Definition omList.c:12
idhdl
idrec * idhdl
Definition ring.h:22

## get_level()

idhdl idrec::get_level | ( | const char * | s,
|  | int | lev )

Definition at line 102 of file ipid.cc.

{
assume(s!=NULL);
assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
idhdl h = this;
int l;
const char *id_;
unsigned long i=iiS2I(s);
int less4=(i < (1L<<((SIZEOF_LONG-1)*8)));
while (h!=NULL)
{
omCheckAddr((ADDRESS)IDID(h));
l=IDLEV(h);
if ((l==level)&&(i==h->id_i))
{
id_=IDID(h);
if (less4 || (0 == strcmp(s+SIZEOF_LONG,id_+SIZEOF_LONG)))
{
return h;
}
}
h = IDNEXT(h);
}
return NULL;
}

## Init()

void idrec::Init | ( |  | ) |

inline

Definition at line 50 of file idrec.h.

{ memset(this,0,sizeof(*this)); }

## set()

idhdl idrec::set | ( | const char * | s,
|  | int | lev,
|  | int | t,
|  | BOOLEAN | init = TRUE )

Definition at line 237 of file ipid.cc.

{
//printf("define %s, %x, level: %d, typ: %d\n", s,s,level,t);
idhdl h = (idrec *)omAlloc0Bin(idrec_bin);
IDID(h) = s;
IDTYP(h) = t;
IDLEV(h) = level;
IDNEXT(h) = this;
BOOLEAN at_start=(this==IDROOT);
h->id_i=iiS2I(s);
if (t==BUCKET_CMD) WarnS("defining polyBucket");
if (init)
{
if ((t==IDEAL_CMD)||(t==MODUL_CMD))
IDFLAG(h) = Sy_bit(FLAG_STD);
IDSTRING(h)=(char *)idrecDataInit(t);
// additional settings:--------------------------------------
#if 0
// this leads to a memory leak
if (t == QRING_CMD)
{
// IDRING(h)=rCopy(currRing);
/* QRING_CMD is ring dep => currRing !=NULL */
}
#endif
}
// --------------------------------------------------------
if (at_start)
IDNEXT(h) = IDROOT;
return h;
}
idrec::idrec
idrec()
Definition idrec.h:49
WarnS
#define WarnS
Definition emacs.cc:78
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
BUCKET_CMD
@ BUCKET_CMD
Definition grammar.cc:284
MODUL_CMD
@ MODUL_CMD
Definition grammar.cc:288
idrec_bin
VAR omBin idrec_bin
Definition ipid.cc:48
idrecDataInit
void * idrecDataInit(int t)
Definition ipid.cc:138
IDSTRING
#define IDSTRING(a)
Definition ipid.h:136
IDFLAG
#define IDFLAG(a)
Definition ipid.h:120
IDROOT
#define IDROOT
Definition ipid.h:19
IDTYP
#define IDTYP(a)
Definition ipid.h:119
FLAG_STD
#define FLAG_STD
Definition ipid.h:106
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition omAllocDecl.h:206
Sy_bit
#define Sy_bit(x)
Definition options.h:31
QRING_CMD
@ QRING_CMD
Definition tok.h:160

## String()

char * idrec::String | ( | BOOLEAN | typed = FALSE | ) |

Definition at line 269 of file ipid.cc.

{
sleftv tmp;
tmp.Init();
tmp.rtyp=IDTYP(this);
tmp.data=IDDATA(this);
tmp.name=IDID(this);
return tmp.String(NULL, typed);
}
sleftv::name
const char * name
Definition subexpr.h:87
sleftv::rtyp
int rtyp
Definition subexpr.h:91
sleftv::Init
void Init()
Definition subexpr.h:107
sleftv::String
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..).
Definition subexpr.cc:765
sleftv::data
void * data
Definition subexpr.h:88
IDDATA
#define IDDATA(a)
Definition ipid.h:126

## Field Documentation

## attribute

attr idrec::attribute

Definition at line 41 of file idrec.h.

## data

utypes idrec::data

Definition at line 40 of file idrec.h.

## flag

BITSET idrec::flag

Definition at line 42 of file idrec.h.

## id

const char* idrec::id

Definition at line 39 of file idrec.h.

## id_i

unsigned long idrec::id_i

Definition at line 47 of file idrec.h.

## lev

short idrec::lev

Definition at line 45 of file idrec.h.

## next

idhdl idrec::next

Definition at line 38 of file idrec.h.

## ref

short idrec::ref

Definition at line 46 of file idrec.h.

## typ

int idrec::typ

Definition at line 43 of file idrec.h.

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

- Singular/idrec.h
- Singular/ipid.cc