Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1TaQLNode.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 21:08:40 2011 Кодировка: Поисковые слова: m 97 |
Envelope class for a node in the raw TaQL parse tree. More...
#include <TaQLNode.h>
Public Member Functions | |
TaQLNode () | |
Default constructor. | |
TaQLNode (TaQLNodeRep *rep) | |
Construct for given letter. | |
TaQLNode (const TaQLNode &that) | |
Copy constructor (reference semantics). | |
TaQLNode & | operator= (const TaQLNode &that) |
Assignment (reference semantics). | |
const TaQLStyle & | style () const |
Get the TaQL style. | |
~TaQLNode () | |
Destructor deletes the letter if no more references. | |
Bool | isValid () const |
Does the envelope contain a letter? | |
char | nodeType () const |
Return the type of letter. | |
const TaQLNodeRep * | getRep () const |
Get read access to the letter. | |
TaQLNodeResult | visit (TaQLNodeVisitor &visitor) const |
Let the visitor visit the node. | |
void | show (std::ostream &os) const |
Print the node (recursively) in the given stream. | |
void | save (AipsIO &aio) const |
Save and restore the entire tree. | |
void | saveNode (AipsIO &aio) const |
Helper functions for save/restore of tree. | |
Static Public Member Functions | |
static TaQLNode | parse (const String &command) |
Parse a TaQL command and return the result. | |
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. | |
static std::vector< TaQLNode * > | theirNodesCreated |
A list of objects created by the parser and deleted at the end. | |
static TaQLStyle | theirStyle |
Keep the TaQL style to use. | |
Protected Attributes | |
TaQLNodeRep * | itsRep |
Static Private Member Functions | |
static void | clearNodesCreated () |
Envelope class for a node in the raw TaQL parse tree.
Internal
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.
The letter-envelope idiom (counted pointer) makes if much easier to keep track of memory, especially in the case of exceptions.
Definition at line 75 of file TaQLNode.h.
casa::TaQLNode::TaQLNode | ( | ) | [inline] |
Default constructor.
Definition at line 79 of file TaQLNode.h.
casa::TaQLNode::TaQLNode | ( | TaQLNodeRep * | rep | ) | [inline] |
casa::TaQLNode::TaQLNode | ( | const TaQLNode & | that | ) | [inline] |
Copy constructor (reference semantics).
Definition at line 87 of file TaQLNode.h.
References itsRep, and casa::TaQLNodeRep::link().
casa::TaQLNode::~TaQLNode | ( | ) | [inline] |
Destructor deletes the letter if no more references.
Definition at line 104 of file TaQLNode.h.
References itsRep, and casa::TaQLNodeRep::style().
static void casa::TaQLNode::clearNodesCreated | ( | ) | [static, private] |
const TaQLNodeRep* casa::TaQLNode::getRep | ( | ) | const [inline] |
Get read access to the letter.
Definition at line 120 of file TaQLNode.h.
References itsRep, and casa::TaQLNodeRep::nodeType().
Bool casa::TaQLNode::isValid | ( | ) | const [inline] |
Does the envelope contain a letter?
Definition at line 112 of file TaQLNode.h.
char casa::TaQLNode::nodeType | ( | ) | const [inline] |
Assignment (reference semantics).
Definition at line 91 of file TaQLNode.h.
References itsRep, and casa::TaQLNodeRep::link().
Parse a TaQL command and return the result.
An exception is thrown in case of parse errors.
static TaQLMultiNode casa::TaQLNode::restoreMultiNode | ( | AipsIO & | aio | ) | [static] |
void casa::TaQLNode::save | ( | AipsIO & | aio | ) | const |
Save and restore the entire tree.
void casa::TaQLNode::saveNode | ( | AipsIO & | aio | ) | const |
Helper functions for save/restore of tree.
void casa::TaQLNode::show | ( | std::ostream & | os | ) | const [inline] |
Print the node (recursively) in the given stream.
Definition at line 129 of file TaQLNode.h.
References itsRep, and casa::TaQLNodeRep::visit().
const TaQLStyle& casa::TaQLNode::style | ( | ) | const [inline] |
Get the TaQL style.
Definition at line 100 of file TaQLNode.h.
TaQLNodeResult casa::TaQLNode::visit | ( | TaQLNodeVisitor & | visitor | ) | const [inline] |
Let the visitor visit the node.
If no node, return an empty result.
Definition at line 125 of file TaQLNode.h.
References itsRep.
Referenced by casa::TaQLNodeVisitor::visitNode().
TaQLNodeRep* casa::TaQLNode::itsRep [protected] |
Definition at line 139 of file TaQLNode.h.
Referenced by getRep(), nodeType(), operator=(), show(), TaQLNode(), visit(), and ~TaQLNode().
TaQLNode casa::TaQLNode::theirNode [static] |
The object getting the final tree.
Definition at line 151 of file TaQLNode.h.
std::vector<TaQLNode*> casa::TaQLNode::theirNodesCreated [static] |
A list of objects created by the parser and deleted at the end.
Definition at line 153 of file TaQLNode.h.
TaQLStyle casa::TaQLNode::theirStyle [static] |
Keep the TaQL style to use.
Definition at line 155 of file TaQLNode.h.