Avro C++
|
Node is the building block for parse trees. More...
#include <Node.hh>
Public Member Functions | |
Node (Type type) | |
Type | type () const |
LogicalType | logicalType () const |
void | setLogicalType (LogicalType logicalType) |
void | lock () |
bool | locked () const |
virtual bool | hasName () const =0 |
void | setName (const Name &name) |
virtual const Name & | name () const =0 |
virtual const std::string & | getDoc () const =0 |
void | setDoc (const std::string &doc) |
void | addLeaf (const NodePtr &newLeaf) |
virtual size_t | leaves () const =0 |
virtual const NodePtr & | leafAt (size_t index) const =0 |
virtual const GenericDatum & | defaultValueAt (size_t index) |
void | addName (const std::string &name) |
virtual size_t | names () const =0 |
virtual const std::string & | nameAt (size_t index) const =0 |
virtual bool | nameIndex (const std::string &name, size_t &index) const =0 |
void | setFixedSize (size_t size) |
virtual size_t | fixedSize () const =0 |
void | addCustomAttributesForField (const CustomFields &customAttributes) |
virtual bool | isValid () const =0 |
virtual SchemaResolution | resolve (const Node &reader) const =0 |
virtual void | printJson (std::ostream &os, size_t depth) const =0 |
virtual void | printBasicInfo (std::ostream &os) const =0 |
virtual void | setLeafToSymbolic (size_t index, const NodePtr &node)=0 |
virtual void | printDefaultToJson (const GenericDatum &g, std::ostream &os, size_t depth) const =0 |
Protected Member Functions | |
void | checkLock () const |
virtual void | checkName (const Name &name) const |
virtual void | doSetName (const Name &name)=0 |
virtual void | doSetDoc (const std::string &name)=0 |
virtual void | doAddLeaf (const NodePtr &newLeaf)=0 |
virtual void | doAddName (const std::string &name)=0 |
virtual void | doSetFixedSize (size_t size)=0 |
virtual void | doAddCustomAttribute (const CustomFields &customFields)=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 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.