Loading...
Searching...
No Matches
casacore::TableSyncData Class Reference
tables package (libcasa_tables) » Tables_module » Tables_module_internal_classes

More...

`#include <TableSyncData.h>`

## Public Member Functions

| TableSyncData ()
| ~TableSyncData ()
| TableSyncData (const TableSyncData &that)=delete
| Copy constructor is forbidden.
TableSyncData & | operator= (const TableSyncData &that)=delete
| Assignment is forbidden.
void | write (rownr_t nrrow, uInt nrcolumn, Bool tableChanged, const Block< Bool > &dataManChanged)
| Update the synchronization data and write it into the MemoryIO object.
void | write (rownr_t nrrow)
| Update the synchronization data and write it into the MemoryIO object.
Bool | read (rownr_t &nrrow, uInt &nrcolumn, Bool &tableChanged, Block< Bool > &dataManChanged)
| Read the synchronization data from the MemoryIO object.
MemoryIO & | memoryIO ()
| Get the MemoryIO object.
uInt | getModifyCounter () const
| Get the modify counter.

## Private Attributes

rownr_t | itsNrrow
Int | itsNrcolumn
uInt | itsModifyCounter
uInt | itsTableChangeCounter
Block< uInt > | itsDataManChangeCounter
std::shared_ptr< MemoryIO > | itsMemIO
AipsIO | itsAipsIO

## Detailed Description

Class to hold table synchronization data.

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tTable

### Prerequisite

- class TableLockData

### Synopsis

This class keeps counters to synchronize the table data when a table is locked or unlocked.
A few counters are kept by this class:

- The numbers of rows in the table.
- The number of columns in the table.
- The table change counter.
- A change counter per data manager.

When a lock on the table is acquired, it reads the sync data from the lock file and determines if anything has changed. If so, the necessary steps are taken to reread the table data when needed.
When a lock on the table is released, it updates and writes the sync data which tells if table data have changed.

This class can also be used for the synchronization of tables and external fillers (see class ExternalLockSync). For this purpose it is sufficient to store the number of rows.

Definition at line 76 of file TableSyncData.h.

## Constructor & Destructor Documentation

## TableSyncData() [1/2]

casacore::TableSyncData::TableSyncData | ( |  | ) |

Referenced by operator=(), and TableSyncData().

## ~TableSyncData()

casacore::TableSyncData::~TableSyncData | ( |  | ) |

## TableSyncData() [2/2]

casacore::TableSyncData::TableSyncData | ( | const TableSyncData & | that | ) |

delete

Copy constructor is forbidden.

References TableSyncData().

## Member Function Documentation

## getModifyCounter()

uInt casacore::TableSyncData::getModifyCounter | ( |  | ) | const

inline

Get the modify counter.

Definition at line 133 of file TableSyncData.h.

References itsModifyCounter.

## memoryIO()

MemoryIO & casacore::TableSyncData::memoryIO | ( |  | ) |

inline

Get the MemoryIO object.

This is used to let LockFile read or write the synchronization data into it.

Definition at line 129 of file TableSyncData.h.

References itsMemIO.

## operator=()

TableSyncData & casacore::TableSyncData::operator= | ( | const TableSyncData & | that | ) |

delete

Assignment is forbidden.

References TableSyncData().

## read()

Bool casacore::TableSyncData::read | ( | rownr_t & | nrrow,
|  | uInt & | nrcolumn,
|  | Bool & | tableChanged,
|  | Block< Bool > & | dataManChanged )

Read the synchronization data from the MemoryIO object.

This function is called when a lock is acquired to see if table data has to be reread.
It returns False when the MemoryIO object is empty.

## write() [1/2]

void casacore::TableSyncData::write | ( | rownr_t | nrrow | ) |

Update the synchronization data and write it into the MemoryIO object.

This function should be used by an external filler when it flushes its data.

## write() [2/2]

void casacore::TableSyncData::write | ( | rownr_t | nrrow,
|  | uInt | nrcolumn,
|  | Bool | tableChanged,
|  | const Block< Bool > & | dataManChanged )

Update the synchronization data and write it into the MemoryIO object.

This function is called when a table flush is done to reflect if anything has changed compared to the previous flush.

## Member Data Documentation

## itsAipsIO

AipsIO casacore::TableSyncData::itsAipsIO

private

Definition at line 124 of file TableSyncData.h.

## itsDataManChangeCounter

Block<uInt> casacore::TableSyncData::itsDataManChangeCounter

private

Definition at line 122 of file TableSyncData.h.

## itsMemIO

std::shared_ptr<MemoryIO> casacore::TableSyncData::itsMemIO

private

Definition at line 123 of file TableSyncData.h.

Referenced by memoryIO().

## itsModifyCounter

uInt casacore::TableSyncData::itsModifyCounter

private

Definition at line 120 of file TableSyncData.h.

Referenced by getModifyCounter().

## itsNrcolumn

Int casacore::TableSyncData::itsNrcolumn

private

Definition at line 119 of file TableSyncData.h.

## itsNrrow

rownr_t casacore::TableSyncData::itsNrrow

private

Definition at line 118 of file TableSyncData.h.

## itsTableChangeCounter

uInt casacore::TableSyncData::itsTableChangeCounter

private

Definition at line 121 of file TableSyncData.h.

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

- tables/Tables/TableSyncData.h