My Project
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.

◆ ~SharedObject()

virtual LibThread::SharedObject::~SharedObject ( )
inlinevirtual

Definition at line 157 of file shared.cc.

157{ }

Member Function Documentation

◆ decref()

long LibThread::SharedObject::decref ( )
inline

Definition at line 170 of file shared.cc.

170 {
171 int result;
172 lock.lock();
173 result = --refcount;
174 lock.unlock();
175 return result;
176 }
return result

◆ get_name()

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

Definition at line 164 of file shared.cc.

164{ return name; }

◆ get_type()

int LibThread::SharedObject::get_type ( )
inline

Definition at line 159 of file shared.cc.

159{ return type; }

◆ getref()

long LibThread::SharedObject::getref ( )
inline

Definition at line 177 of file shared.cc.

177 {
178 return refcount;
179 }

◆ incref()

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

Definition at line 165 of file shared.cc.

165 {
166 lock.lock();
167 refcount += 1;
168 lock.unlock();
169 }

◆ op2()

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

Definition at line 180 of file shared.cc.

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

◆ op3()

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

Definition at line 183 of file shared.cc.

183 {
184 return TRUE;
185 }

◆ set_name() [1/2]

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

Definition at line 161 of file shared.cc.

161 {
162 name = std::string(s);
163 }
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.

160{ name = name_init; }

◆ set_type()

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

Definition at line 158 of file shared.cc.

158{ 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: