Loading...
Searching...
No Matches
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 33 of file attrib.cc.

{
assume (this!=NULL);
omCheckAddrSize(this,sizeof(sattr));
attr n=(attr)omAlloc0Bin(sattr_bin);
n->atyp=atyp;
if (name!=NULL) n->name=omStrDup(name);
n->data=CopyA();
if (next!=NULL)
{
n->next=next->Copy();
}
return n;
}
sattr_bin
STATIC_VAR omBin sattr_bin
Definition attrib.cc:24
attr
sattr * attr
Definition attrib.h:16
sattr::data
void * data
Definition attrib.h:25
sattr::CopyA
void * CopyA()
Definition subexpr.cc:2192
sattr::atyp
int atyp
Definition attrib.h:27
sattr::name
char * name
Definition attrib.h:24
sattr::next
attr next
Definition attrib.h:26
assume
#define assume(x)
Definition mod2.h:389
omStrDup
#define omStrDup(s)
Definition omAllocDecl.h:263
omCheckAddrSize
#define omCheckAddrSize(addr, size)
Definition omAllocDecl.h:327
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition omAllocDecl.h:206
NULL
#define NULL
Definition omList.c:12

## CopyA()

void * sattr::CopyA | ( |  | ) |

Definition at line 2192 of file subexpr.cc.

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

## get()

attr sattr::get | ( | const char * | s | ) |

Definition at line 93 of file attrib.cc.

{
attr h = this;
while (h!=NULL)
{
if (0 == strcmp(s,h->name))
{
#ifdef TEST
//::Print("get attr >>%s<< of type %s\n",h->name, Tok2Cmdname(h->atyp));
#endif
return h;
}
h = h->next;
}
return NULL;
}
s
const CanonicalForm int s
Definition facAbsFact.cc:51
h
STATIC_VAR Poly * h
Definition janet.cc:971

## Init()

void sattr::Init | ( |  | ) |

inline

Definition at line 23 of file attrib.h.

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

## kill()

void sattr::kill | ( | const ring | r | ) |

Definition at line 183 of file attrib.cc.

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

## killAll()

void sattr::killAll | ( | const ring | r | ) |

Definition at line 189 of file attrib.cc.

{
attr temp = this,temp1;
while (temp!=NULL)
{
temp1 = temp->next;
omCheckAddr(temp);
temp->kill(r);
temp = temp1;
}
}
sattr::kill
void kill(const ring r)
Definition attrib.cc:183
omCheckAddr
#define omCheckAddr(addr)
Definition omAllocDecl.h:328

## Print()

void sattr::Print | ( |  | ) |

Definition at line 26 of file attrib.cc.

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

## set()

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

Definition at line 70 of file attrib.cc.

{
attr h = get(s);
attr result=this;
if (h!=NULL)
{
attr_free(h);
}
else
{
h = (attr)omAlloc0Bin(sattr_bin);
h->next = this;
result=h;
}
h->name = s;
h->data = d;
h->atyp = t;
#ifdef TEST
//::Print("set attr >>%s<< of type %s\n",h->name, Tok2Cmdname(t));
#endif
return result;
}
sattr::get
attr get(const char *s)
Definition attrib.cc:93
result
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:

- Singular/attrib.h
- Singular/attrib.cc
- Singular/subexpr.cc