My Project
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
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
 

Detailed Description

Definition at line 34 of file idrec.h.

Constructor & Destructor Documentation

◆ idrec()

idrec::idrec ( )
inline

Definition at line 48 of file idrec.h.

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

Member Function Documentation

◆ get()

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

Definition at line 65 of file ipid.cc.

66{
67 assume(s!=NULL);
68 assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
69 idhdl h = this;
71 while (h!=NULL)
72 {
73 const char *id_=IDID(h);
74 omCheckAddr((ADDRESS)id_);
75 int l=IDLEV(h);
76 if ((l==0)||(l==level))
77 {
78 if (0 == strcmp(s, id_))
79 {
80 if(l==level) return h;
81 found=h;
82 }
83 }
84 h = IDNEXT(h);
85 }
86 return found;
87}
void * ADDRESS
Definition: auxiliary.h:119
int level(const CanonicalForm &f)
int l
Definition: cfEzgcd.cc:100
Definition: idrec.h:35
const CanonicalForm int s
Definition: facAbsFact.cc:51
bool found
Definition: facFactorize.cc:55
#define IDNEXT(a)
Definition: ipid.h:118
#define IDID(a)
Definition: ipid.h:122
#define IDLEV(a)
Definition: ipid.h:121
STATIC_VAR Poly * h
Definition: janet.cc:971
#define assume(x)
Definition: mod2.h:389
#define omCheckAddr(addr)
Definition: omAllocDecl.h:328
#define NULL
Definition: omList.c:12

◆ get_level()

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

Definition at line 89 of file ipid.cc.

90{
91 assume(s!=NULL);
92 assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
93 idhdl h = this;
94 while (h!=NULL)
95 {
96 const char *id_=IDID(h);
97 omCheckAddr((ADDRESS)id_);
98 int l=IDLEV(h);
99 if ((l==level)&&(0 == strcmp(s, id_)))
100 {
101 return h;
102 }
103 h = IDNEXT(h);
104 }
105 return NULL;
106}

◆ Init()

void idrec::Init ( )
inline

Definition at line 49 of file idrec.h.

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

◆ set()

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

Definition at line 215 of file ipid.cc.

216{
217 //printf("define %s, %x, level: %d, typ: %d\n", s,s,level,t);
219 IDID(h) = s;
220 IDTYP(h) = t;
221 IDLEV(h) = level;
222 IDNEXT(h) = this;
223 BOOLEAN at_start=(this==IDROOT);
224 if (t==BUCKET_CMD) WarnS("defining polyBucket");
225 if (init)
226 {
227 if ((t==IDEAL_CMD)||(t==MODUL_CMD))
229 IDSTRING(h)=(char *)idrecDataInit(t);
230 // additional settings:--------------------------------------
231#if 0
232 // this leads to a memory leak
233 if (t == QRING_CMD)
234 {
235 // IDRING(h)=rCopy(currRing);
236 /* QRING_CMD is ring dep => currRing !=NULL */
237 }
238#endif
239 }
240 // --------------------------------------------------------
241 if (at_start)
242 IDNEXT(h) = IDROOT;
243 return h;
244}
int BOOLEAN
Definition: auxiliary.h:87
#define WarnS
Definition: emacs.cc:78
@ IDEAL_CMD
Definition: grammar.cc:284
@ BUCKET_CMD
Definition: grammar.cc:283
@ MODUL_CMD
Definition: grammar.cc:287
VAR omBin idrec_bin
Definition: ipid.cc:48
void * idrecDataInit(int t)
Definition: ipid.cc:118
#define IDSTRING(a)
Definition: ipid.h:136
#define IDFLAG(a)
Definition: ipid.h:120
#define IDROOT
Definition: ipid.h:19
#define IDTYP(a)
Definition: ipid.h:119
#define FLAG_STD
Definition: ipid.h:106
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define Sy_bit(x)
Definition: options.h:31
@ QRING_CMD
Definition: tok.h:158

◆ String()

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

Definition at line 246 of file ipid.cc.

247{
248 sleftv tmp;
249 tmp.Init();
250 tmp.rtyp=IDTYP(this);
251 tmp.data=IDDATA(this);
252 tmp.name=IDID(this);
253 return tmp.String(NULL, typed);
254}
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
const char * name
Definition: subexpr.h:87
int rtyp
Definition: subexpr.h:91
void Init()
Definition: subexpr.h:107
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
Definition: subexpr.cc:761
void * data
Definition: subexpr.h:88
#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.

◆ 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: