Public Member Functions | Data Fields
idrec Class Reference

#include <idrec.h>

Public Member Functions

 idrec ()
 
idhdl get (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
 
int 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 90 of file ipid.cc.

91 {
92  assume(s!=NULL);
93  assume((level>=0) && (level<=1000)); //not really, but if it isnt in that bounds..
94  idhdl h = this;
96  int l;
97  const char *id_;
98  int i=iiS2I(s);
99  int less4=(i < (1<<24));
100  while (h!=NULL)
101  {
102  omCheckAddr((ADDRESS)IDID(h));
103  l=IDLEV(h);
104  if ((l==0)||(l==level))
105  {
106  if (i==h->id_i)
107  {
108  id_=IDID(h);
109  if (less4 || (0 == strcmp(s+4,id_+4)))
110  {
111  if (l==level) return h;
112  found=h;
113  }
114  }
115  }
116  h = IDNEXT(h);
117  }
118  return found;
119 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int level(const CanonicalForm &f)
#define IDID(a)
Definition: ipid.h:119
#define IDNEXT(a)
Definition: ipid.h:115
int id_i
Definition: idrec.h:47
void * ADDRESS
Definition: auxiliary.h:115
Definition: idrec.h:34
bool found
Definition: facFactorize.cc:56
#define assume(x)
Definition: mod2.h:394
int iiS2I(const char *s)
Definition: ipid.cc:71
int i
Definition: cfEzgcd.cc:123
#define IDLEV(a)
Definition: ipid.h:118
#define NULL
Definition: omList.c:10
#define omCheckAddr(addr)
Definition: omAllocDecl.h:328
static Poly * h
Definition: janet.cc:978
int l
Definition: cfEzgcd.cc:94

◆ set()

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

Definition at line 217 of file ipid.cc.

218 {
219  //printf("define %s, %x, level: %d, typ: %d\n", s,s,level,t);
221  IDID(h) = s;
222  IDTYP(h) = t;
223  IDLEV(h) = level;
224  IDNEXT(h) = this;
225  BOOLEAN at_start=(this==IDROOT);
226  h->id_i=iiS2I(s);
227  if (init)
228  {
229  if ((t==IDEAL_CMD)||(t==MODUL_CMD))
230  IDFLAG(h) = Sy_bit(FLAG_STD);
231  IDSTRING(h)=(char *)idrecDataInit(t);
232  // additional settings:--------------------------------------
233 #if 0
234  // this leads to a memory leak
235  if (t == QRING_CMD)
236  {
237  // IDRING(h)=rCopy(currRing);
238  /* QRING_CMD is ring dep => currRing !=NULL */
239  }
240 #endif
241  }
242  // --------------------------------------------------------
243  if (at_start)
244  IDNEXT(h) = IDROOT;
245  return h;
246 }
void * idrecDataInit(int t)
Definition: ipid.cc:131
const CanonicalForm int s
Definition: facAbsFact.cc:55
int level(const CanonicalForm &f)
#define IDID(a)
Definition: ipid.h:119
#define IDNEXT(a)
Definition: ipid.h:115
#define IDROOT
Definition: ipid.h:20
int id_i
Definition: idrec.h:47
#define Sy_bit(x)
Definition: options.h:30
Definition: idrec.h:34
#define IDTYP(a)
Definition: ipid.h:116
omBin idrec_bin
Definition: ipid.cc:52
int iiS2I(const char *s)
Definition: ipid.cc:71
#define IDSTRING(a)
Definition: ipid.h:133
#define IDLEV(a)
Definition: ipid.h:118
#define FLAG_STD
Definition: ipid.h:106
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define IDFLAG(a)
Definition: ipid.h:117
Definition: tok.h:157
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85

◆ String()

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

Definition at line 248 of file ipid.cc.

249 {
250  sleftv tmp;
251  memset(&tmp,0,sizeof(sleftv));
252  tmp.rtyp=IDTYP(this);
253  tmp.data=IDDATA(this);
254  tmp.name=IDID(this);
255  return tmp.String(NULL, typed);
256 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define IDID(a)
Definition: ipid.h:119
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
Definition: subexpr.cc:751
void * data
Definition: subexpr.h:89
#define IDTYP(a)
Definition: ipid.h:116
const char * name
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
#define IDDATA(a)
Definition: ipid.h:123

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

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