TaQLNodeRep.h

Classes

TaQLNodeRep -- Representation of a node in the raw TaQL parse tree. (full description)

class TaQLNodeRep

Interface

Public Members
explicit TaQLNodeRep (int nodeType) :itsCount(0), itsNodeType(nodeType)
virtual ~TaQLNodeRep()
static TaQLNodeRep* link (TaQLNodeRep* rep)
static void unlink (TaQLNodeRep* rep)
char nodeType() const
virtual TaQLNodeResult visit (TaQLNodeVisitor&) const = 0
virtual void show (std::ostream& os) const = 0
virtual void save (AipsIO& aio) const = 0
static String checkDataType (const String&)
Private Members
TaQLNodeRep (const TaQLNodeRep&)
TaQLNodeRep& operator= (const TaQLNodeRep&)

Description

Review Status

Programs:
Tests:

Prerequisite

Synopsis

TaQLNode/TaQLNodeRep form an envelope/letter pair. TaQLNodeRep is the abstract base class for all classes used in the raw TaQL parse tree (e.g. linktoTaQLConstNodeRep).

Motivation

The envelope/letter idiom (aka counted referencing) is a nice means to pass an object around by value, so to ensure that an object is deleted in case of an exception. Furthermore it makes copying an object very cheap and memory management straightforward.

Member Description

explicit TaQLNodeRep (int nodeType) :itsCount(0), itsNodeType(nodeType)

Constructor for derived classes specifying the type.

virtual ~TaQLNodeRep()

static TaQLNodeRep* link (TaQLNodeRep* rep)

Increment the reference count.

static void unlink (TaQLNodeRep* rep)

Decrement the reference count. Delete the letter if no more references.

char nodeType() const

Get the node type of the derived class.

virtual TaQLNodeResult visit (TaQLNodeVisitor&) const = 0

Visit a node for tree traversal.

virtual void show (std::ostream& os) const = 0

Print the object in an ostream.

virtual void save (AipsIO& aio) const = 0

Save the object.

static String checkDataType (const String&)

Check the data type string and return its standard form.

TaQLNodeRep (const TaQLNodeRep&)
TaQLNodeRep& operator= (const TaQLNodeRep&)

Letter objects cannot be copied.