Loading...
Searching...
No Matches
LibThread::SharedObject Class Reference

## Public Member Functions

| SharedObject ()
virtual | ~SharedObject ()
void | set_type (int type_init)
int | get_type ()
void | set_name (std::string &name_init)
void | set_name (const char *s)
std::string & | get_name ()
void | incref (int by=1)
long | decref ()
long | getref ()
virtual BOOLEAN | op2 (int op, leftv res, leftv a1, leftv a2)
virtual BOOLEAN | op3 (int op, leftv res, leftv a1, leftv a2, leftv a3)

## Private Attributes

Lock | lock
long | refcount
int | type
std::string | name

## Detailed Description

Definition at line 149 of file shared.cc.

## Constructor & Destructor Documentation

## SharedObject()

LibThread::SharedObject::SharedObject | ( |  | ) |

inline

Definition at line 156 of file shared.cc.

: lock(), refcount(0) { }
LibThread::SharedObject::refcount
long refcount
Definition shared.cc:152
LibThread::SharedObject::lock
Lock lock
Definition shared.cc:151

## ~SharedObject()

virtual LibThread::SharedObject::~SharedObject | ( |  | ) |

inline virtual

Definition at line 157 of file shared.cc.

{ }

## Member Function Documentation

## decref()

long LibThread::SharedObject::decref | ( |  | ) |

inline

Definition at line 170 of file shared.cc.

{
int result;
lock.lock();
result = --refcount;
lock.unlock();
return result;
}
result
return result
Definition facAbsBiFact.cc:76

## get_name()

std::string & LibThread::SharedObject::get_name | ( |  | ) |

inline

Definition at line 164 of file shared.cc.

{ return name; }
LibThread::SharedObject::name
std::string name
Definition shared.cc:154

## get_type()

int LibThread::SharedObject::get_type | ( |  | ) |

inline

Definition at line 159 of file shared.cc.

{ return type; }
LibThread::SharedObject::type
int type
Definition shared.cc:153

## getref()

long LibThread::SharedObject::getref | ( |  | ) |

inline

Definition at line 177 of file shared.cc.

{
return refcount;
}

## incref()

void LibThread::SharedObject::incref | ( | int | by = 1 | ) |

inline

Definition at line 165 of file shared.cc.

{
lock.lock();
refcount += 1;
lock.unlock();
}

## op2()

virtual BOOLEAN LibThread::SharedObject::op2 | ( | int | op,
|  | leftv | res,
|  | leftv | a1,
|  | leftv | a2 )

inline virtual

Definition at line 180 of file shared.cc.

{
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101

## op3()

virtual BOOLEAN LibThread::SharedObject::op3 | ( | int | op,
|  | leftv | res,
|  | leftv | a1,
|  | leftv | a2,
|  | leftv | a3 )

inline virtual

Definition at line 183 of file shared.cc.

{
return TRUE;
}

## set_name() [1/2]

void LibThread::SharedObject::set_name | ( | const char * | s | ) |

inline

Definition at line 161 of file shared.cc.

{
name = std::string(s);
}
s
const CanonicalForm int s
Definition facAbsFact.cc:51

## set_name() [2/2]

void LibThread::SharedObject::set_name | ( | std::string & | name_init | ) |

inline

Definition at line 160 of file shared.cc.

{ name = name_init; }

## set_type()

void LibThread::SharedObject::set_type | ( | int | type_init | ) |

inline

Definition at line 158 of file shared.cc.

{ type = type_init; }

## Field Documentation

## lock

Lock LibThread::SharedObject::lock

private

Definition at line 151 of file shared.cc.

## name

std::string LibThread::SharedObject::name

private

Definition at line 154 of file shared.cc.

## refcount

long LibThread::SharedObject::refcount

private

Definition at line 152 of file shared.cc.

## type

int LibThread::SharedObject::type

private

Definition at line 153 of file shared.cc.

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

- Singular/dyn_modules/systhreads/shared.cc