My Project
Loading...
Searching...
No Matches
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 352 of file shared.cc.

Constructor & Destructor Documentation

◆ TxList()

LibThread::TxList::TxList ( )
inline

Definition at line 356 of file shared.cc.

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

◆ ~TxList()

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

Definition at line 357 of file shared.cc.

357{ }

Member Function Documentation

◆ get()

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

Definition at line 372 of file shared.cc.

372 {
373 int result = 0;
374 if (!tx_begin()) return -1;
375 if (index >= 1 && index <= entries.size()) {
376 result = (entries[index-1].size() != 0);
377 if (result)
378 value = entries[index-1];
379 }
380 tx_end();
381 return result;
382 }
return result
static int index(p_Length length, p_Ord ord)

◆ put()

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

Definition at line 358 of file shared.cc.

358 {
359 int result = -1;
360 if (!tx_begin()) return -1;
361 if (index >= 1 && index <= entries.size()) {
362 entries[index-1] = value;
363 result = 1;
364 } else {
365 entries.resize(index+1);
366 entries[index-1] = value;
367 result = 0;
368 }
369 tx_end();
370 return result;
371 }

◆ size()

long LibThread::TxList::size ( )
inline

Definition at line 383 of file shared.cc.

383 {
384 long result;
385 if (!tx_begin()) return -1;
386 result = (long) entries.size();
387 tx_end();
388 return result;
389 }

Field Documentation

◆ entries

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

Definition at line 354 of file shared.cc.


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