Node is the building block for parse trees. More...
#include <Node.hh>
Public Member Functions | |
Node (Type type) | |
Type | type () const |
void | lock () |
bool | locked () const |
virtual bool | hasName () const =0 |
void | setName (const Name &name) |
virtual const Name & | name () const =0 |
void | addLeaf (const NodePtr &newLeaf) |
virtual size_t | leaves () const =0 |
virtual const NodePtr & | leafAt (int index) const =0 |
virtual const GenericDatum & | defaultValueAt (int index) |
void | addName (const std::string &name) |
virtual size_t | names () const =0 |
virtual const std::string & | nameAt (int index) const =0 |
virtual bool | nameIndex (const std::string &name, size_t &index) const =0 |
void | setFixedSize (int size) |
virtual int | fixedSize () const =0 |
virtual bool | isValid () const =0 |
virtual SchemaResolution | resolve (const Node &reader) const =0 |
virtual void | printJson (std::ostream &os, int depth) const =0 |
virtual void | printBasicInfo (std::ostream &os) const =0 |
virtual void | setLeafToSymbolic (int index, const NodePtr &node)=0 |
Protected Member Functions | |
void | checkLock () const |
virtual void | checkName (const Name &name) const |
virtual void | doSetName (const Name &name)=0 |
virtual void | doAddLeaf (const NodePtr &newLeaf)=0 |
virtual void | doAddName (const std::string &name)=0 |
virtual void | doSetFixedSize (int size)=0 |
Node is the building block for parse trees.
Each node represents an avro type. Compound types have leaf nodes that represent the types they are composed of.
The user does not use the Node object directly, they interface with Schema objects.
The Node object uses reference-counted pointers. This is so that schemas may be reused in other other schemas, without needing to worry about memory deallocation for nodes that are added to multiple schema parse trees.
Node has minimal implementation, serving as an abstract base class for different node types.