My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
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 154 of file shared.cc.

Constructor & Destructor Documentation

◆ SharedObject()

LibThread::SharedObject::SharedObject ( )
inline

Definition at line 161 of file shared.cc.

◆ ~SharedObject()

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

Definition at line 162 of file shared.cc.

162{ }

Member Function Documentation

◆ decref()

long LibThread::SharedObject::decref ( )
inline

Definition at line 175 of file shared.cc.

175 {
176 int result;
177 lock.lock();
178 result = --refcount;
179 lock.unlock();
180 return result;
181 }
void lock()
Definition: thread.h:46
void unlock()
Definition: thread.h:57
return result
Definition: facAbsBiFact.cc:75

◆ get_name()

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

Definition at line 169 of file shared.cc.

169{ return name; }
std::string name
Definition: shared.cc:159

◆ get_type()

int LibThread::SharedObject::get_type ( )
inline

Definition at line 164 of file shared.cc.

164{ return type; }

◆ getref()

long LibThread::SharedObject::getref ( )
inline

Definition at line 182 of file shared.cc.

182 {
183 return refcount;
184 }

◆ incref()

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

Definition at line 170 of file shared.cc.

170 {
171 lock.lock();
172 refcount += 1;
173 lock.unlock();
174 }

◆ op2()

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

Definition at line 185 of file shared.cc.

185 {
186 return TRUE;
187 }
#define TRUE
Definition: auxiliary.h:100

◆ op3()

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

Definition at line 188 of file shared.cc.

188 {
189 return TRUE;
190 }

◆ set_name() [1/2]

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

Definition at line 166 of file shared.cc.

166 {
167 name = std::string(s);
168 }
const CanonicalForm int s
Definition: facAbsFact.cc:51
int name
New type name for int.
Definition: templateForC.h:21

◆ set_name() [2/2]

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

Definition at line 165 of file shared.cc.

165{ name = name_init; }

◆ set_type()

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

Definition at line 163 of file shared.cc.

163{ type = type_init; }

Field Documentation

◆ lock

Lock LibThread::SharedObject::lock
private

Definition at line 156 of file shared.cc.

◆ name

std::string LibThread::SharedObject::name
private

Definition at line 159 of file shared.cc.

◆ refcount

long LibThread::SharedObject::refcount
private

Definition at line 157 of file shared.cc.

◆ type

int LibThread::SharedObject::type
private

Definition at line 158 of file shared.cc.


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