Public Member Functions | Data Fields
sattr Class Reference

#include <attrib.h>

Public Member Functions

void Init ()
 
void Print ()
 
attr Copy ()
 
void * CopyA ()
 
attr set (const char *s, void *data, int t)
 
attr get (const char *s)
 
void kill (const ring r)
 
void killAll (const ring r)
 
- Public Member Functions inherited from omallocClass
void * operator new (size_t size) throw (std::bad_alloc)
 
void operator delete (void *block) throw ()
 
void * operator new[] (size_t size) throw (std::bad_alloc)
 
void operator delete[] (void *block) throw ()
 
void * operator new (size_t size, const std::nothrow_t &) throw ()
 
void * operator new[] (size_t size, const std::nothrow_t &) throw ()
 

Data Fields

const char * name
 
void * data
 
attr next
 
int atyp
 

Detailed Description

Definition at line 15 of file attrib.h.

Member Function Documentation

§ Copy()

attr sattr::Copy ( )

Definition at line 41 of file attrib.cc.

42 {
43  assume (this!=NULL);
44 
45  omCheckAddrSize(this,sizeof(sattr));
47  n->atyp=atyp;
48  if (name!=NULL) n->name=omStrDup(name);
49  n->data=CopyA();
50  if (next!=NULL)
51  {
52  n->next=next->Copy();
53  }
54  return n;
55 }
#define omCheckAddrSize(addr, size)
Definition: omAllocDecl.h:327
Definition: attrib.h:15
void * data
Definition: attrib.h:20
void * CopyA()
Definition: subexpr.cc:1966
sattr * attr
Definition: attrib.h:13
#define assume(x)
Definition: mod2.h:403
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
static omBin sattr_bin
Definition: attrib.cc:32
attr next
Definition: attrib.h:21
attr Copy()
Definition: attrib.cc:41
const char * name
Definition: attrib.h:19
int atyp
Definition: attrib.h:22
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ CopyA()

void * sattr::CopyA ( )

Definition at line 1966 of file subexpr.cc.

1967 {
1968  omCheckAddrSize(this,sizeof(sattr));
1969  return s_internalCopy(atyp,data);
1970 }
#define omCheckAddrSize(addr, size)
Definition: omAllocDecl.h:327
Definition: attrib.h:15
void * data
Definition: attrib.h:20
static void * s_internalCopy(const int t, void *d)
Definition: subexpr.cc:417
int atyp
Definition: attrib.h:22

§ get()

attr sattr::get ( const char *  s)

Definition at line 96 of file attrib.cc.

97 {
98  attr h = this;
99  while (h!=NULL)
100  {
101  if (0 == strcmp(s,h->name))
102  {
103 #ifdef TEST
104  //::Print("get attr >>%s<< of type %s\n",h->name, Tok2Cmdname(h->atyp));
105 #endif
106  return h;
107  }
108  h = h->next;
109  }
110  return NULL;
111 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: attrib.h:15
#define NULL
Definition: omList.c:10
attr next
Definition: attrib.h:21
const char * name
Definition: attrib.h:19
static Poly * h
Definition: janet.cc:978

§ Init()

void sattr::Init ( )
inline

Definition at line 18 of file attrib.h.

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

§ kill()

void sattr::kill ( const ring  r)

Definition at line 186 of file attrib.cc.

187 {
188  attr_free(this,r);
189  omFree((ADDRESS)name);
190  name=NULL;
191  omFreeBin((ADDRESS)this, sattr_bin);
192 }
void * ADDRESS
Definition: auxiliary.h:116
const ring r
Definition: syzextra.cc:208
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:10
static omBin sattr_bin
Definition: attrib.cc:32
const char * name
Definition: attrib.h:19
static void attr_free(attr h, const ring r=currRing)
Definition: attrib.cc:64
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259

§ killAll()

void sattr::killAll ( const ring  r)

Definition at line 194 of file attrib.cc.

195 {
196  attr temp = this,temp1;
197 
198  while (temp!=NULL)
199  {
200  temp1 = temp->next;
201  omCheckAddr(temp);
202  temp->kill(r);
203  temp = temp1;
204  }
205 }
Definition: attrib.h:15
void kill(const ring r)
Definition: attrib.cc:186
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
attr next
Definition: attrib.h:21
#define omCheckAddr(addr)
Definition: omAllocDecl.h:328

§ Print()

void sattr::Print ( )

Definition at line 34 of file attrib.cc.

35 {
36  omCheckAddrSize(this,sizeof(sattr));
37  ::Print("attr:%s, type %s \n",name,Tok2Cmdname(atyp));
38  if (next!=NULL) next->Print();
39 }
#define omCheckAddrSize(addr, size)
Definition: omAllocDecl.h:327
Definition: attrib.h:15
void Print()
Definition: attrib.cc:34
#define NULL
Definition: omList.c:10
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:130
attr next
Definition: attrib.h:21
const char * name
Definition: attrib.h:19
int atyp
Definition: attrib.h:22

§ set()

attr sattr::set ( const char *  s,
void *  data,
int  t 
)

Definition at line 73 of file attrib.cc.

74 {
75  attr h = get(s);
76  attr result=this;
77  if (h!=NULL)
78  {
79  attr_free(h);
80  }
81  else
82  {
84  h->next = this;
85  result=h;
86  }
87  h->name = s;
88  h->data = d;
89  h->atyp = t;
90 #ifdef TEST
91  //::Print("set attr >>%s<< of type %s\n",h->name, Tok2Cmdname(t));
92 #endif
93  return result;
94 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: attrib.h:15
void * data
Definition: attrib.h:20
sattr * attr
Definition: attrib.h:13
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
static omBin sattr_bin
Definition: attrib.cc:32
attr next
Definition: attrib.h:21
const char * name
Definition: attrib.h:19
static void attr_free(attr h, const ring r=currRing)
Definition: attrib.cc:64
static Poly * h
Definition: janet.cc:978
int atyp
Definition: attrib.h:22
return result
Definition: facAbsBiFact.cc:76

Field Documentation

§ atyp

int sattr::atyp

Definition at line 22 of file attrib.h.

§ data

void* sattr::data

Definition at line 20 of file attrib.h.

§ name

const char* sattr::name

Definition at line 19 of file attrib.h.

§ next

attr sattr::next

Definition at line 21 of file attrib.h.


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