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

Public Member Functions

 TxTable ()
 
virtual ~TxTable ()
 
int put (string &key, string &value)
 
int get (string &key, string &value)
 
int check (string &key)
 
- 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

std::map< string, string > entries
 

Additional Inherited Members

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

Detailed Description

Definition at line 320 of file shared.cc.

Constructor & Destructor Documentation

◆ TxTable()

LibThread::TxTable::TxTable ( )
inline

Definition at line 324 of file shared.cc.

324: Transactional(), entries() { }
std::map< string, string > entries
Definition: shared.cc:322

◆ ~TxTable()

virtual LibThread::TxTable::~TxTable ( )
inlinevirtual

Definition at line 325 of file shared.cc.

325{ }

Member Function Documentation

◆ check()

int LibThread::TxTable::check ( string &  key)
inline

Definition at line 348 of file shared.cc.

348 {
349 int result;
350 if (!tx_begin()) return -1;
351 result = entries.count(key);
352 tx_end();
353 return result;
354 }
return result
Definition: facAbsBiFact.cc:75

◆ get()

int LibThread::TxTable::get ( string &  key,
string &  value 
)
inline

Definition at line 338 of file shared.cc.

338 {
339 int result = 0;
340 if (!tx_begin()) return -1;
341 if (entries.count(key)) {
342 value = entries[key];
343 result = 1;
344 }
345 tx_end();
346 return result;
347 }

◆ put()

int LibThread::TxTable::put ( string &  key,
string &  value 
)
inline

Definition at line 326 of file shared.cc.

326 {
327 int result = 0;
328 if (!tx_begin()) return -1;
329 if (entries.count(key)) {
330 entries[key] = value;
331 } else {
332 entries.insert(pair<string, string>(key, value));
333 result = 1;
334 }
335 tx_end();
336 return result;
337 }

Field Documentation

◆ entries

std::map<string, string> LibThread::TxTable::entries
private

Definition at line 322 of file shared.cc.


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