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
 
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.

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

Member Function Documentation

◆ get()

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

Definition at line 72 of file ipid.cc.

73{
74 assume(s!=NULL);
75 assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
76 idhdl h = this;
78 int l;
79 const char *id_;
80 unsigned long i=iiS2I(s);
81 char *dummy=(char*)&i;
82 BOOLEAN less4=(dummy[SIZEOF_LONG-1]=='\0');
83 while (h!=NULL)
84 {
86 l=IDLEV(h);
87 if ((l==0)||(l==level))
88 {
89 if (i==h->id_i)
90 {
91 id_=IDID(h);
92 if (less4 || (0 == strcmp(s+SIZEOF_LONG,id_+SIZEOF_LONG)))
93 {
94 if(l==level) return h;
95 found=h;
96 }
97 }
98 }
99 h = IDNEXT(h);
100 }
101 return found;
102}
int BOOLEAN
Definition: auxiliary.h:87
void * ADDRESS
Definition: auxiliary.h:119
int level(const CanonicalForm &f)
int l
Definition: cfEzgcd.cc:100
int i
Definition: cfEzgcd.cc:132
Definition: idrec.h:35
const CanonicalForm int s
Definition: facAbsFact.cc:51
bool found
Definition: facFactorize.cc:55
static long iiS2I(const char *s)
Definition: ipid.cc:65
#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 104 of file ipid.cc.

105{
106 assume(s!=NULL);
107 assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
108 idhdl h = this;
109 int l;
110 const char *id_;
111 unsigned long i=iiS2I(s);
112 int less4=(i < (1L<<((SIZEOF_LONG-1)*8)));
113 while (h!=NULL)
114 {
116 l=IDLEV(h);
117 if ((l==level)&&(i==h->id_i))
118 {
119 id_=IDID(h);
120 if (less4 || (0 == strcmp(s+SIZEOF_LONG,id_+SIZEOF_LONG)))
121 {
122 return h;
123 }
124 }
125 h = IDNEXT(h);
126 }
127 return NULL;
128}

◆ Init()

void idrec::Init ( )
inline

Definition at line 50 of file idrec.h.

50{ 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.

238{
239 //printf("define %s, %x, level: %d, typ: %d\n", s,s,level,t);
241 IDID(h) = s;
242 IDTYP(h) = t;
243 IDLEV(h) = level;
244 IDNEXT(h) = this;
245 BOOLEAN at_start=(this==IDROOT);
246 h->id_i=iiS2I(s);
247 if (t==BUCKET_CMD) WarnS("defining polyBucket");
248 if (init)
249 {
250 if ((t==IDEAL_CMD)||(t==MODUL_CMD))
252 IDSTRING(h)=(char *)idrecDataInit(t);
253 // additional settings:--------------------------------------
254#if 0
255 // this leads to a memory leak
256 if (t == QRING_CMD)
257 {
258 // IDRING(h)=rCopy(currRing);
259 /* QRING_CMD is ring dep => currRing !=NULL */
260 }
261#endif
262 }
263 // --------------------------------------------------------
264 if (at_start)
265 IDNEXT(h) = IDROOT;
266 return h;
267}
#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:140
#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 269 of file ipid.cc.

270{
271 sleftv tmp;
272 tmp.Init();
273 tmp.rtyp=IDTYP(this);
274 tmp.data=IDDATA(this);
275 tmp.name=IDID(this);
276 return tmp.String(NULL, typed);
277}
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.

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