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

More...

`#include <TableTrace.h>`

## Public Types

enum | ColType { SCALAR , ARRAY , RECORD }
enum | Oper { READ , WRITE }

## Static Public Member Functions

static int | traceColumn (const ColumnDesc &)
| Does the given column have to be traced for read and/or write?
static int | traceTable (const String &tableName, char oper)
| If needed, write a trace message for table open or create.
static void | traceClose (const String &tableName)
| If needed, trace closing a table.
static void | traceFile (int tabid, const String &oper)
| If needed, trace an operation on a table.
static void | traceRefTable (const String &parentName, char oper)
| If needed, write a trace message for reftable open, create, or close.
static void | trace (int tabid, const String &columnName, char oper)
| If needed, write a trace message Write a trace message for a scalar column.
static void | trace (int tabid, const String &columnName, char oper, Int64 row)
| Write a trace message for a scalar row.
static void | trace (int tabid, const String &columnName, char oper, const RefRows &rownrs)
| Write a trace message for ranges of scalar rows.
static void | trace (int tabid, const String &columnName, char oper, const IPosition &shape)
| Write a trace message for an array column.
static void | trace (int tabid, const String &columnName, char oper, Int64 row, const IPosition &shape)
| Write a trace message for an array row.
static void | trace (int tabid, const String &columnName, char oper, const RefRows &rownrs, const IPosition &shape)
| Write a trace message for ranges of array rows.
static void | trace (int tabid, const String &columnName, char oper, const IPosition &shape, const IPosition &blc, const IPosition &trc, const IPosition &inc)
| Write a trace message for an array column slice.
static void | trace (int tabid, const String &columnName, char oper, Int64 row, const IPosition &shape, const IPosition &blc, const IPosition &trc, const IPosition &inc)
| Write a trace message for an array row slice.
static void | trace (int tabid, const String &columnName, char oper, const RefRows &rownrs, const IPosition &shape, const IPosition &blc, const IPosition &trc, const IPosition &inc)
| Write a trace message for ranges of array rows slice.

## Static Private Member Functions

static void | initTracing ()
| Initialize the tracing mechanism which should be done only once.
static void | initOper ()
static void | initColumn ()
static int | findTable (const String &name)
| Find the table name in the vector.
static void | writeTraceFirst (int tabid, const String &name, char oper)
| Write the first part of the trace message.
static void | writeRefRows (const RefRows &rownrs)
| Write the RefRows as vector of rows or slices.
static void | writeSlice (const IPosition &blc, const IPosition &trc, const IPosition &inc)
| Write the blc, trc, and inc of an array slice.

## Static Private Attributes

static std::once_flag | theirCallOnceFlag
static std::mutex | theirMutex
static std::ofstream | theirTraceFile
static std::ostream * | theirStream
static int | theirDoTrace
static int | theirOper
static int | theirColType
static std::vector< Regex > | theirColumns
static std::vector< String > | theirTables

## Detailed Description

Class with static functions for tracing column IO

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25

### Synopsis

This class contains some static functions to enable table and column tracing. It maintains a map of table name to table-id.
The following aipsrc variables variables determine if tracing will be done, and if so, which columns and operations will be traced.

- table.trace.filename gives the name of the file in which the trace will be written. If empty (default), no tracing will be done. If 'stdout' is given, tracing is done to stdout. If 'stderr' is given, tracing is done to stderr.
- table.trace.operation gives the operation to trace. be traced. It can be one or more of:
  s: creation of RefTable (selection/sort/iter)
  r: reads
  w: writes
  The default is ''. Note that opening and closing a PlainTable are always traced.
- table.trace.columntype gives the types of columns to trace for read and/or write. It can be one or more of:
  s: scalar columns
  a: array columns
  r: record columns
  The default is ''.
- table.trace.column gives names of additional columns to trace for read and/or write. The names are separated by commas without any whitespace. Each name can be a glob-like pattern.
  The default is ''.

If both table.trace.columntype and table.trace.column have an empty value, all array columns are traced.

Definition at line 90 of file TableTrace.h.

## Member Enumeration Documentation

## ColType

enum casacore::TableTrace::ColType

Enumerator
SCALAR |
ARRAY |
RECORD |

Definition at line 93 of file TableTrace.h.

## Oper

enum casacore::TableTrace::Oper

Enumerator
READ |
WRITE |

Definition at line 98 of file TableTrace.h.

## Member Function Documentation

## findTable()

int casacore::TableTrace::findTable | ( | const String & | name | ) |

static private

Find the table name in the vector.

-1 is returned if not found.

References casacore::name().

## initColumn()

void casacore::TableTrace::initColumn | ( |  | ) |

static private

## initOper()

void casacore::TableTrace::initOper | ( |  | ) |

static private

## initTracing()

void casacore::TableTrace::initTracing | ( |  | ) |

static private

Initialize the tracing mechanism which should be done only once.

## trace() [1/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper )

static

If needed, write a trace message Write a trace message for a scalar column.

## trace() [2/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper,
|  | const IPosition & | shape )

static

Write a trace message for an array column.

References casacore::shape().

## trace() [3/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper,
|  | const IPosition & | shape,
|  | const IPosition & | blc,
|  | const IPosition & | trc,
|  | const IPosition & | inc )

static

Write a trace message for an array column slice.

References casacore::shape().

## trace() [4/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper,
|  | const RefRows & | rownrs )

static

Write a trace message for ranges of scalar rows.

## trace() [5/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper,
|  | const RefRows & | rownrs,
|  | const IPosition & | shape )

static

Write a trace message for ranges of array rows.

References casacore::shape().

## trace() [6/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper,
|  | const RefRows & | rownrs,
|  | const IPosition & | shape,
|  | const IPosition & | blc,
|  | const IPosition & | trc,
|  | const IPosition & | inc )

static

Write a trace message for ranges of array rows slice.

References casacore::shape().

## trace() [7/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper,
|  | Int64 | row )

static

Write a trace message for a scalar row.

## trace() [8/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper,
|  | Int64 | row,
|  | const IPosition & | shape )

static

Write a trace message for an array row.

References casacore::shape().

## trace() [9/9]

void casacore::TableTrace::trace | ( | int | tabid,
|  | const String & | columnName,
|  | char | oper,
|  | Int64 | row,
|  | const IPosition & | shape,
|  | const IPosition & | blc,
|  | const IPosition & | trc,
|  | const IPosition & | inc )

static

Write a trace message for an array row slice.

References casacore::shape().

## traceClose()

void casacore::TableTrace::traceClose | ( | const String & | tableName | ) |

static

If needed, trace closing a table.

It removes the table from the map.

## traceColumn()

int casacore::TableTrace::traceColumn | ( | const ColumnDesc & |  | ) |

static

Does the given column have to be traced for read and/or write?

bit 0 set means read tracing; bit 1 write tracing.

## traceFile()

void casacore::TableTrace::traceFile | ( | int | tabid,
|  | const String & | oper )

static

If needed, trace an operation on a table.

## traceRefTable()

void casacore::TableTrace::traceRefTable | ( | const String & | parentName,
|  | char | oper )

static

If needed, write a trace message for reftable open, create, or close.

## traceTable()

int casacore::TableTrace::traceTable | ( | const String & | tableName,
|  | char | oper )

static

If needed, write a trace message for table open or create.

It adds the table to the map and returns the table-id.

## writeRefRows()

void casacore::TableTrace::writeRefRows | ( | const RefRows & | rownrs | ) |

static private

Write the RefRows as vector of rows or slices.

## writeSlice()

void casacore::TableTrace::writeSlice | ( | const IPosition & | blc,
|  | const IPosition & | trc,
|  | const IPosition & | inc )

static private

Write the blc, trc, and inc of an array slice.

## writeTraceFirst()

void casacore::TableTrace::writeTraceFirst | ( | int | tabid,
|  | const String & | name,
|  | char | oper )

static private

Write the first part of the trace message.

References casacore::name().

## Member Data Documentation

## theirCallOnceFlag

std::once_flag casacore::TableTrace::theirCallOnceFlag

static private

Definition at line 176 of file TableTrace.h.

## theirColType

int casacore::TableTrace::theirColType

static private

Definition at line 182 of file TableTrace.h.

## theirColumns

std::vector<Regex> casacore::TableTrace::theirColumns

static private

Definition at line 183 of file TableTrace.h.

## theirDoTrace

int casacore::TableTrace::theirDoTrace

static private

Definition at line 180 of file TableTrace.h.

## theirMutex

std::mutex casacore::TableTrace::theirMutex

static private

Definition at line 177 of file TableTrace.h.

## theirOper

int casacore::TableTrace::theirOper

static private

Definition at line 181 of file TableTrace.h.

## theirStream

std::ostream* casacore::TableTrace::theirStream

static private

Definition at line 179 of file TableTrace.h.

## theirTables

std::vector<String> casacore::TableTrace::theirTables

static private

Definition at line 184 of file TableTrace.h.

## theirTraceFile

std::ofstream casacore::TableTrace::theirTraceFile

static private

Definition at line 178 of file TableTrace.h.

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

- tables/Tables/TableTrace.h