Loading...
Searching...
No Matches
casacore::ObjectID Class Reference
casa package (libcasa_casa) » System_module

More...

`#include <ObjectID.h>`

## Public Member Functions

| ObjectID (Bool makeNull=False)
| If makeNull is True, make the null ObjectID, otherwise create a unique ObjectID.
| ObjectID (Int sequence, Int pid, Int time, const String &hostname)
| Create explicitly from the provided constituents.
| ObjectID (const ObjectID &other)
| Copy other.
ObjectID & | operator= (const ObjectID &other)
Bool | isNull () const
| Is this ObjectID set?
Bool | operator== (const ObjectID &other) const
| Compare two ObjectID's for (in)equality.
Bool | operator!= (const ObjectID &other) const
Bool | fromString (String &error, const String &in)
| It is useful to interconvert between strings and ObjecID's, e.g.
void | toString (String &out) const
| Note that out is zero'd before it is set.
Int | sequence () const
| Ordinarily the user does not need to get at the exact state of the, ObjectID, however it is available for those times when it is necessary.
Int | pid () const
Int | creationTime () const
const String & | hostName () const

## Static Public Member Functions

static String | extractIDs (Block< ObjectID > &objectIDs, const String &command)
| Extract objectID strings (as set by glish script substitute.g) from a command, convert them to ObjectID objects, store those in the Block, and replace the strings by their Block indices as $OBJ#n#O where n is the index.

## Static Private Member Functions

static Int | sequence_number ()
| Make a unique sequence number, returns 0 on first call, 1 on next,...

## Private Attributes

Int | sequence_number_p
Int | process_id_p
Int | creation_time_p
String | hostname_p

## Detailed Description

ObjectID: A unique identifier for distributed and other objects.

### Intended use:

Public interface

### Review Status

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

### Prerequisite

- none

### Etymology

The ObjectID class name reflects its role as the single identifier for distributed and other user-level objects.

### Synopsis

The ObjectID class is used to give a unique identifier to ``high-level'' objects in the system. Internally the ObjectID consists of a sequence number (unique within the creating process), a process id, a creation time, and a host id. Pragmatically the ObjectID should be unique with no dangers of collisions.

A special ``Null'' ObjectID is available.

### Motivation

The fundamental purpose for an ObjectID is to provide a unique identifier for persistent objects, or for objects that might be accessed outside the creating processes address space.

### To Do

- Nothing (hostid -> hostname on this date).

Definition at line 77 of file ObjectID.h.

## Constructor & Destructor Documentation

## ObjectID() [1/3]

casacore::ObjectID::ObjectID | ( | Bool | makeNull = False | ) |

If makeNull is True, make the null ObjectID, otherwise create a unique ObjectID.

References casacore::False.

Referenced by ObjectID(), operator!=(), operator=(), and operator==().

## ObjectID() [2/3]

casacore::ObjectID::ObjectID | ( | Int | sequence,
|  | Int | pid,
|  | Int | time,
|  | const String & | hostname )

Create explicitly from the provided constituents.

References pid(), sequence(), and casacore::time().

## ObjectID() [3/3]

casacore::ObjectID::ObjectID | ( | const ObjectID & | other | ) |

Copy other.

Note that if the ObjectID is embedded inside an object, the enclosing object probably does not want to copy the ObjectID since generally speaking the identity of the enclosing object should be immutable.

References ObjectID().

## Member Function Documentation

## creationTime()

Int casacore::ObjectID::creationTime | ( |  | ) | const

inline

Definition at line 162 of file ObjectID.h.

References creation_time_p.

## extractIDs()

String casacore::ObjectID::extractIDs | ( | Block< ObjectID > & | objectIDs,
|  | const String & | command )

static

Extract objectID strings (as set by glish script substitute.g) from a command, convert them to ObjectID objects, store those in the Block, and replace the strings by their Block indices as $OBJ#n#O where n is the index.

## fromString()

Bool casacore::ObjectID::fromString | ( | String & | error,
|  | const String & | in )

It is useful to interconvert between strings and ObjecID's, e.g.

when saving to FITS or writing to a table. The form of the string is:

sequence=123 host=hostname pid=pid time=time
casacore::ObjectID::pid
Int pid() const
Definition ObjectID.h:157
casacore::ObjectID::sequence
Int sequence() const
Ordinarily the user does not need to get at the exact state of the, ObjectID, however it is available...
Definition ObjectID.h:152
casacore::time
TableExprNode time(const TableExprNode &node)
Definition ExprNode.h:1584

with an optional comma between the fields. However, in general user code should not depend on the exact form of the string.

If this fails, an error message is set and the ObjectID is the null ObjectID.

## hostName()

const String & casacore::ObjectID::hostName | ( |  | ) | const

inline

Definition at line 167 of file ObjectID.h.

References hostname_p.

## isNull()

Bool casacore::ObjectID::isNull | ( |  | ) | const

Is this ObjectID set?

## operator!=()

Bool casacore::ObjectID::operator!= | ( | const ObjectID & | other | ) | const

References ObjectID().

## operator=()

ObjectID & casacore::ObjectID::operator= | ( | const ObjectID & | other | ) |

References ObjectID().

## operator==()

Bool casacore::ObjectID::operator== | ( | const ObjectID & | other | ) | const

Compare two ObjectID's for (in)equality.

References ObjectID().

## pid()

Int casacore::ObjectID::pid | ( |  | ) | const

inline

Definition at line 157 of file ObjectID.h.

References process_id_p.

Referenced by ObjectID().

## sequence()

Int casacore::ObjectID::sequence | ( |  | ) | const

inline

Ordinarily the user does not need to get at the exact state of the, ObjectID, however it is available for those times when it is necessary.

Definition at line 152 of file ObjectID.h.

References sequence_number_p.

Referenced by ObjectID().

## sequence_number()

Int casacore::ObjectID::sequence_number | ( |  | ) |

static private

Make a unique sequence number, returns 0 on first call, 1 on next,...

## toString()

void casacore::ObjectID::toString | ( | String & | out | ) | const

Note that out is zero'd before it is set.

## Member Data Documentation

## creation_time_p

Int casacore::ObjectID::creation_time_p

private

Definition at line 139 of file ObjectID.h.

Referenced by creationTime().

## hostname_p

String casacore::ObjectID::hostname_p

private

Definition at line 140 of file ObjectID.h.

Referenced by hostName().

## process_id_p

Int casacore::ObjectID::process_id_p

private

Definition at line 138 of file ObjectID.h.

Referenced by pid().

## sequence_number_p

Int casacore::ObjectID::sequence_number_p

private

Definition at line 137 of file ObjectID.h.

Referenced by sequence().

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

- casa/System/ObjectID.h