casacore
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Static Private Member Functions | List of all members

More...

#include <TaQLNode.h>

Public Member Functions

 TaQLNode ()
 Default constructor. More...
 
 TaQLNode (TaQLNodeRep *rep)
 Construct for given letter. More...
 
 TaQLNode (const TaQLNode &that)
 Copy constructor (reference semantics). More...
 
TaQLNodeoperator= (const TaQLNode &that)
 Assignment (reference semantics). More...
 
const TaQLStylestyle () const
 Get the TaQL style. More...
 
 ~TaQLNode ()
 Destructor deletes the letter if no more references. More...
 
Bool isValid () const
 Does the envelope contain a letter? More...
 
char nodeType () const
 Return the type of letter. More...
 
const TaQLNodeRepgetRep () const
 Get read access to the letter. More...
 
TaQLNodeResult visit (TaQLNodeVisitor &visitor) const
 Let the visitor visit the node. More...
 
void show (std::ostream &os) const
 Print the node (recursively) in the given stream. More...
 
void save (AipsIO &aio) const
 Save and restore the entire parse tree. More...
 
void saveNode (AipsIO &aio) const
 Helper functions for save/restore of tree. More...
 

Static Public Member Functions

static TaQLNode parse (const String &command)
 Parse a TaQL command and return the result. More...
 
static TaQLNode restore (AipsIO &aio)
 
static TaQLNode restoreNode (AipsIO &aio)
 
static TaQLMultiNode restoreMultiNode (AipsIO &aio)
 

Static Public Attributes

static TaQLNode theirNode
 The object getting the final tree. More...
 
static std::vector< TaQLNode * > theirNodesCreated
 A list of objects created by the parser and deleted at the end. More...
 
static TaQLStyle theirStyle
 Keep the TaQL style to use. More...
 
static std::mutex theirMutex
 Use a mutex to guard the statics. More...
 

Protected Attributes

std::shared_ptr< TaQLNodeRepitsRep
 

Static Private Member Functions

static void clearNodesCreated ()
 Delete all nodes that were created by the parser. More...
 

Detailed Description

Envelope class for a node in the raw TaQL parse tree.

Intended use:

Internal

Review Status

Test programs:
tTaQLNode

Prerequisite

Synopsis

The result of parsing a TaQL command is stored in TaQLNode objects. Each part of the command can have its own specialized TaQLNodeRep object, which forms the letter in the TaQLNode envelope.
The actual scanning/parsing of the command is done using flex/bison as defined in the TableGram files.

Motivation

The letter-envelope idiom (counted pointer) makes if much easier to keep track of memory, especially in the case of exceptions.

Definition at line 83 of file TaQLNode.h.

Constructor & Destructor Documentation

◆ TaQLNode() [1/3]

casacore::TaQLNode::TaQLNode ( )
inline

Default constructor.

Definition at line 87 of file TaQLNode.h.

◆ TaQLNode() [2/3]

casacore::TaQLNode::TaQLNode ( TaQLNodeRep rep)
inline

Construct for given letter.

It takes over the pointer.

Definition at line 91 of file TaQLNode.h.

References itsRep.

◆ TaQLNode() [3/3]

casacore::TaQLNode::TaQLNode ( const TaQLNode that)
inline

Copy constructor (reference semantics).

Definition at line 95 of file TaQLNode.h.

References itsRep.

◆ ~TaQLNode()

casacore::TaQLNode::~TaQLNode ( )
inline

Destructor deletes the letter if no more references.

Definition at line 111 of file TaQLNode.h.

Member Function Documentation

◆ clearNodesCreated()

static void casacore::TaQLNode::clearNodesCreated ( )
staticprivate

Delete all nodes that were created by the parser.

◆ getRep()

const TaQLNodeRep* casacore::TaQLNode::getRep ( ) const
inline

Get read access to the letter.

Definition at line 128 of file TaQLNode.h.

References itsRep.

◆ isValid()

Bool casacore::TaQLNode::isValid ( ) const
inline

Does the envelope contain a letter?

Definition at line 120 of file TaQLNode.h.

References itsRep.

◆ nodeType()

char casacore::TaQLNode::nodeType ( ) const
inline

Return the type of letter.

Definition at line 124 of file TaQLNode.h.

References itsRep.

◆ operator=()

TaQLNode& casacore::TaQLNode::operator= ( const TaQLNode that)
inline

Assignment (reference semantics).

Definition at line 99 of file TaQLNode.h.

References itsRep.

◆ parse()

static TaQLNode casacore::TaQLNode::parse ( const String command)
static

Parse a TaQL command and return the result.

An exception is thrown in case of parse errors. The parse tree is deleted by function clearNodeCreated.

◆ restore()

static TaQLNode casacore::TaQLNode::restore ( AipsIO aio)
static

◆ restoreMultiNode()

static TaQLMultiNode casacore::TaQLNode::restoreMultiNode ( AipsIO aio)
static

◆ restoreNode()

static TaQLNode casacore::TaQLNode::restoreNode ( AipsIO aio)
static

◆ save()

void casacore::TaQLNode::save ( AipsIO aio) const

Save and restore the entire parse tree.

◆ saveNode()

void casacore::TaQLNode::saveNode ( AipsIO aio) const

Helper functions for save/restore of tree.

◆ show()

void casacore::TaQLNode::show ( std::ostream &  os) const
inline

Print the node (recursively) in the given stream.

Definition at line 137 of file TaQLNode.h.

References itsRep.

◆ style()

const TaQLStyle& casacore::TaQLNode::style ( ) const
inline

Get the TaQL style.

Definition at line 107 of file TaQLNode.h.

References itsRep.

◆ visit()

TaQLNodeResult casacore::TaQLNode::visit ( TaQLNodeVisitor visitor) const
inline

Let the visitor visit the node.

If no node, return an empty result.

Definition at line 133 of file TaQLNode.h.

References itsRep.

Referenced by casacore::TaQLNodeVisitor::visitNode().

Member Data Documentation

◆ itsRep

std::shared_ptr<TaQLNodeRep> casacore::TaQLNode::itsRep
protected

Definition at line 147 of file TaQLNode.h.

Referenced by getRep(), isValid(), nodeType(), operator=(), show(), style(), TaQLNode(), and visit().

◆ theirMutex

std::mutex casacore::TaQLNode::theirMutex
static

Use a mutex to guard the statics.

Definition at line 168 of file TaQLNode.h.

◆ theirNode

TaQLNode casacore::TaQLNode::theirNode
static

The object getting the final tree.

Definition at line 162 of file TaQLNode.h.

◆ theirNodesCreated

std::vector<TaQLNode*> casacore::TaQLNode::theirNodesCreated
static

A list of objects created by the parser and deleted at the end.

Definition at line 164 of file TaQLNode.h.

◆ theirStyle

TaQLStyle casacore::TaQLNode::theirStyle
static

Keep the TaQL style to use.

Definition at line 166 of file TaQLNode.h.


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