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

## Constructor & Destructor Documentation

## TxTable()

LibThread::TxTable::TxTable | ( |  | ) |

inline

Definition at line 319 of file shared.cc.

: Transactional(), entries() { }
LibThread::Transactional::Transactional
Transactional()
Definition shared.cc:301
LibThread::TxTable::entries
std::map< string, string > entries
Definition shared.cc:317

## ~TxTable()

virtual LibThread::TxTable::~TxTable | ( |  | ) |

inline virtual

Definition at line 320 of file shared.cc.

{ }

## Member Function Documentation

## check()

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

inline

Definition at line 343 of file shared.cc.

{
int result;
if (!tx_begin()) return -1;
result = entries.count(key);
tx_end();
return result;
}
LibThread::Transactional::tx_end
void tx_end()
Definition shared.cc:296
LibThread::Transactional::tx_begin
int tx_begin()
Definition shared.cc:286
result
return result
Definition facAbsBiFact.cc:76

## get()

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

inline

Definition at line 333 of file shared.cc.

{
int result = 0;
if (!tx_begin()) return -1;
if (entries.count(key)) {
value = entries[key];
result = 1;
}
tx_end();
return result;
}

## put()

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

inline

Definition at line 321 of file shared.cc.

{
int result = 0;
if (!tx_begin()) return -1;
if (entries.count(key)) {
entries[key] = value;
} else {
entries.insert(pair<string, string>(key, value));
result = 1;
}
tx_end();
return result;
}

## Field Documentation

## entries

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

private

Definition at line 317 of file shared.cc.

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

- Singular/dyn_modules/systhreads/shared.cc