My Project  debian-1:4.1.2-p1+ds-2
Public Member Functions | Data Fields
sattr Class Reference

#include <attrib.h>

Public Member Functions

void Init ()
 
void Print ()
 
attr Copy ()
 
void * CopyA ()
 
attr set (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

char * name
 
void * data
 
attr next
 
int atyp
 

Detailed Description

Definition at line 16 of file attrib.h.

Member Function Documentation

◆ Copy()

attr sattr::Copy ( )

Definition at line 32 of file attrib.cc.

34 {
35  assume (this!=NULL);
36 
37  omCheckAddrSize(this,sizeof(sattr));
39  n->atyp=atyp;
40  if (name!=NULL) n->name=omStrDup(name);
41  n->data=CopyA();
42  if (next!=NULL)
43  {
44  n->next=next->Copy();
45  }
46  return n;

◆ CopyA()

void * sattr::CopyA ( )

Definition at line 2033 of file subexpr.cc.

2035 {
2036  omCheckAddrSize(this,sizeof(sattr));
2037  return s_internalCopy(atyp,data);

◆ get()

attr sattr::get ( const char *  s)

Definition at line 89 of file attrib.cc.

91 {
92  attr h = this;
93  while (h!=NULL)
94  {
95  if (0 == strcmp(s,h->name))
96  {
97 #ifdef TEST
98  //::Print("get attr >>%s<< of type %s\n",h->name, Tok2Cmdname(h->atyp));
99 #endif
100  return h;
101  }
102  h = h->next;
103  }
104  return NULL;

◆ Init()

void sattr::Init ( )
inline

Definition at line 22 of file attrib.h.

22 :
23  inline void Init() { memset(this,0,sizeof(*this)); }

◆ kill()

void sattr::kill ( const ring  r)

Definition at line 179 of file attrib.cc.

181 {
182  attr_free(this,r);
183  omFreeBin((ADDRESS)this, sattr_bin);

◆ killAll()

void sattr::killAll ( const ring  r)

Definition at line 185 of file attrib.cc.

187 {
188  attr temp = this,temp1;
189 
190  while (temp!=NULL)
191  {
192  temp1 = temp->next;
193  omCheckAddr(temp);
194  temp->kill(r);
195  temp = temp1;
196  }

◆ Print()

void sattr::Print ( )

Definition at line 25 of file attrib.cc.

27 {
28  omCheckAddrSize(this,sizeof(sattr));
29  ::Print("attr:%s, type %s \n",name,Tok2Cmdname(atyp));
30  if (next!=NULL) next->Print();

◆ set()

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

Definition at line 66 of file attrib.cc.

68 {
69  attr h = get(s);
70  attr result=this;
71  if (h!=NULL)
72  {
73  attr_free(h);
74  }
75  else
76  {
78  h->next = this;
79  result=h;
80  }
81  h->name = s;
82  h->data = d;
83  h->atyp = t;
84 #ifdef TEST
85  //::Print("set attr >>%s<< of type %s\n",h->name, Tok2Cmdname(t));
86 #endif
87  return result;

Field Documentation

◆ atyp

int sattr::atyp

Definition at line 26 of file attrib.h.

◆ data

void* sattr::data

Definition at line 24 of file attrib.h.

◆ name

char* sattr::name

Definition at line 23 of file attrib.h.

◆ next

attr sattr::next

Definition at line 25 of file attrib.h.


The documentation for this class was generated from the following files:
omCheckAddrSize
#define omCheckAddrSize(addr, size)
Definition: omAllocDecl.h:325
sattr::Print
void Print()
Definition: attrib.cc:25
attr
sattr * attr
Definition: attrib.h:14
result
return result
Definition: facAbsBiFact.cc:76
ADDRESS
void * ADDRESS
Definition: auxiliary.h:135
h
STATIC_VAR Poly * h
Definition: janet.cc:971
sattr
Definition: attrib.h:16
omStrDup
#define omStrDup(s)
Definition: omAllocDecl.h:261
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:204
sattr::data
void * data
Definition: attrib.h:24
s_internalCopy
static void * s_internalCopy(const int t, void *d)
Definition: subexpr.cc:429
sattr::name
char * name
Definition: attrib.h:23
sattr::kill
void kill(const ring r)
Definition: attrib.cc:179
sattr::CopyA
void * CopyA()
Definition: subexpr.cc:2033
sattr::Copy
attr Copy()
Definition: attrib.cc:32
sattr::next
attr next
Definition: attrib.h:25
sattr::Init
void Init()
Definition: attrib.h:22
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:11
omCheckAddr
#define omCheckAddr(addr)
Definition: omAllocDecl.h:326
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
sattr_bin
STATIC_VAR omBin sattr_bin
Definition: attrib.cc:23
Tok2Cmdname
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:140
sattr::atyp
int atyp
Definition: attrib.h:26
sattr::get
attr get(const char *s)
Definition: attrib.cc:89
omFreeBin
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:257
attr_free
static void attr_free(attr h, const ring r=currRing)
Definition: attrib.cc:55