My Project  debian-1:4.1.1-p2+ds-4build4
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 17 of file attrib.h.

Member Function Documentation

◆ Copy()

attr sattr::Copy ( )

Definition at line 35 of file attrib.cc.

36 {
37  assume (this!=NULL);
38 
39  omCheckAddrSize(this,sizeof(sattr));
41  n->atyp=atyp;
42  if (name!=NULL) n->name=omStrDup(name);
43  n->data=CopyA();
44  if (next!=NULL)
45  {
46  n->next=next->Copy();
47  }
48  return n;
49 }
static omBin sattr_bin
Definition: attrib.cc:26
sattr * attr
Definition: attrib.h:15
Definition: attrib.h:21
void * data
Definition: attrib.h:25
attr Copy()
Definition: attrib.cc:35
void * CopyA()
Definition: subexpr.cc:1944
int atyp
Definition: attrib.h:27
char * name
Definition: attrib.h:24
attr next
Definition: attrib.h:26
#define assume(x)
Definition: mod2.h:390
#define omStrDup(s)
Definition: omAllocDecl.h:263
#define omCheckAddrSize(addr, size)
Definition: omAllocDecl.h:327
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10

◆ CopyA()

void * sattr::CopyA ( )

Definition at line 1944 of file subexpr.cc.

1945 {
1946  omCheckAddrSize(this,sizeof(sattr));
1947  return s_internalCopy(atyp,data);
1948 }
static void * s_internalCopy(const int t, void *d)
Definition: subexpr.cc:410

◆ get()

attr sattr::get ( const char *  s)

Definition at line 92 of file attrib.cc.

93 {
94  attr h = this;
95  while (h!=NULL)
96  {
97  if (0 == strcmp(s,h->name))
98  {
99 #ifdef TEST
100  //::Print("get attr >>%s<< of type %s\n",h->name, Tok2Cmdname(h->atyp));
101 #endif
102  return h;
103  }
104  h = h->next;
105  }
106  return NULL;
107 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
static Poly * h
Definition: janet.cc:972

◆ Init()

void sattr::Init ( )
inline

Definition at line 23 of file attrib.h.

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

◆ kill()

void sattr::kill ( const ring  r)

Definition at line 182 of file attrib.cc.

183 {
184  attr_free(this,r);
185  omFreeBin((ADDRESS)this, sattr_bin);
186 }
static void attr_free(attr h, const ring r=currRing)
Definition: attrib.cc:58
void * ADDRESS
Definition: auxiliary.h:133
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259

◆ killAll()

void sattr::killAll ( const ring  r)

Definition at line 188 of file attrib.cc.

189 {
190  attr temp = this,temp1;
191 
192  while (temp!=NULL)
193  {
194  temp1 = temp->next;
195  omCheckAddr(temp);
196  temp->kill(r);
197  temp = temp1;
198  }
199 }
void kill(const ring r)
Definition: attrib.cc:182
#define omCheckAddr(addr)
Definition: omAllocDecl.h:328

◆ Print()

void sattr::Print ( )

Definition at line 28 of file attrib.cc.

29 {
30  omCheckAddrSize(this,sizeof(sattr));
31  ::Print("attr:%s, type %s \n",name,Tok2Cmdname(atyp));
32  if (next!=NULL) next->Print();
33 }
void Print()
Definition: attrib.cc:28
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:138

◆ set()

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

Definition at line 69 of file attrib.cc.

70 {
71  attr h = get(s);
72  attr result=this;
73  if (h!=NULL)
74  {
75  attr_free(h);
76  }
77  else
78  {
80  h->next = this;
81  result=h;
82  }
83  h->name = s;
84  h->data = d;
85  h->atyp = t;
86 #ifdef TEST
87  //::Print("set attr >>%s<< of type %s\n",h->name, Tok2Cmdname(t));
88 #endif
89  return result;
90 }
attr get(const char *s)
Definition: attrib.cc:92
return result
Definition: facAbsBiFact.cc:76

Field Documentation

◆ atyp

int sattr::atyp

Definition at line 27 of file attrib.h.

◆ data

void* sattr::data

Definition at line 25 of file attrib.h.

◆ name

char* sattr::name

Definition at line 24 of file attrib.h.

◆ next

attr sattr::next

Definition at line 26 of file attrib.h.


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