My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
LibThread::TxList Class Reference

Public Member Functions

 TxList ()
 
virtual ~TxList ()
 
int put (size_t index, string &value)
 
int get (size_t index, string &value)
 
long size ()
 
- Public Member Functions inherited from LibThread::Transactional
 Transactional ()
 
void set_region (Region *region_init)
 
virtual ~Transactional ()
 
- Public Member Functions inherited from LibThread::SharedObject
 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

vector< string > entries
 

Additional Inherited Members

- Protected Member Functions inherited from LibThread::Transactional
int tx_begin ()
 
void tx_end ()
 

Detailed Description

Definition at line 357 of file shared.cc.

Constructor & Destructor Documentation

◆ TxList()

LibThread::TxList::TxList ( )
inline

Definition at line 361 of file shared.cc.

361: Transactional(), entries() { }
vector< string > entries
Definition: shared.cc:359

◆ ~TxList()

virtual LibThread::TxList::~TxList ( )
inlinevirtual

Definition at line 362 of file shared.cc.

362{ }

Member Function Documentation

◆ get()

int LibThread::TxList::get ( size_t  index,
string &  value 
)
inline

Definition at line 377 of file shared.cc.

377 {
378 int result = 0;
379 if (!tx_begin()) return -1;
380 if (index >= 1 && index <= entries.size()) {
381 result = (entries[index-1].size() != 0);
382 if (result)
383 value = entries[index-1];
384 }
385 tx_end();
386 return result;
387 }
return result
Definition: facAbsBiFact.cc:75
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592

◆ put()

int LibThread::TxList::put ( size_t  index,
string &  value 
)
inline

Definition at line 363 of file shared.cc.

363 {
364 int result = -1;
365 if (!tx_begin()) return -1;
366 if (index >= 1 && index <= entries.size()) {
367 entries[index-1] = value;
368 result = 1;
369 } else {
370 entries.resize(index+1);
371 entries[index-1] = value;
372 result = 0;
373 }
374 tx_end();
375 return result;
376 }

◆ size()

long LibThread::TxList::size ( )
inline

Definition at line 388 of file shared.cc.

388 {
389 long result;
390 if (!tx_begin()) return -1;
391 result = (long) entries.size();
392 tx_end();
393 return result;
394 }

Field Documentation

◆ entries

vector<string> LibThread::TxList::entries
private

Definition at line 359 of file shared.cc.


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