Avro C++
Public Member Functions | Protected Member Functions | List of all members
avro::Node Class Referenceabstract

Node is the building block for parse trees. More...

#include <Node.hh>

Inheritance diagram for avro::Node:
avro::NodeImpl< NameConcept, LeavesConcept, LeafNamesConcept, MultiAttributesConcept, SizeConcept > avro::NodeArray avro::NodeEnum avro::NodeFixed avro::NodeMap avro::NodePrimitive avro::NodeRecord avro::NodeSymbolic avro::NodeUnion

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 Namename () 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 GenericDatumdefaultValueAt (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
 

Detailed Description

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.


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