MongoType
MongoDB Collection Data Dump with BSON Types
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mongotype::IBSONObjectVisitor Interface Referenceabstract

Visitor interface for parsing nested BSON data objects. More...

#include <BSONObjectParser.hpp>

Details:

Visitor interface for parsing nested BSON data objects.

Usage:

  1. Derive a class V from interface IBSONObjectVisitor and implement each onX() function.
  2. Instantiate an instance of V called v.
  3. Construct a BSONObjectParser object p using the instance of the derived class v as the parameter to constructor BSONObjectParser::BSONObjectParser(IBSONObjectVisitor&).
  4. Parse a BSON object (mongo::BSONobj) o using virtual void BSONObjectParser::parse(const BSONObj& o), i.e., p.parse(o).

Definition at line 370 of file BSONObjectParser.hpp.

Inheritance diagram for mongotype::IBSONObjectVisitor:

Public Member Functions

virtual ~IBSONObjectVisitor ()
 
virtual void onParseStart ()=0
 Parser Construction Event. More...
 
virtual void onParseEnd ()=0
 Parser Destruction Event. More...
 
virtual void onObjectStart (const BSONParserStack &stack)=0
 BSON Object Precursor Event. More...
 
virtual void onObjectEnd (const BSONParserStack &stack)=0
 BSON Object Successor Event. More...
 
virtual void onArrayStart (const BSONParserStack &stack)=0
 BSON Array Precursor Event. More...
 
virtual void onArrayEnd (const BSONParserStack &stack)=0
 BSON Array Successor Event. More...
 
virtual void onElement (const BSONParserStack &stack)=0
 BSON Element Event. More...
 

Constructor & Destructor Documentation

virtual mongotype::IBSONObjectVisitor::~IBSONObjectVisitor ( )
inlinevirtual

Definition at line 372 of file BSONObjectParser.hpp.

Member Function Documentation

void mongotype::IBSONObjectVisitor::onArrayEnd ( const BSONParserStack stack)
pure virtual

BSON Array Successor Event.

Parameters
[in]stackThe BSONParserStack object containing the current parse context.

Invoked once per each non-terminal BSON array after parsing the contained BSON elements.

Implemented in mongotype::JSONDump, mongotype::BSONObjectTypeDump, and mongotype::BSONDotNotationDump.

Referenced by mongotype::BSONObjectParser::parseElementRecursive().

Here is the caller graph for this function:

void mongotype::IBSONObjectVisitor::onArrayStart ( const BSONParserStack stack)
pure virtual

BSON Array Precursor Event.

Parameters
[in]stackThe BSONParserStack object containing the current parse context.

Invoked once per each non-terminal BSON array before parsing the contained BSON elements.

Implemented in mongotype::JSONDump, mongotype::BSONObjectTypeDump, and mongotype::BSONDotNotationDump.

Referenced by mongotype::BSONObjectParser::parseElementRecursive().

Here is the caller graph for this function:

void mongotype::IBSONObjectVisitor::onElement ( const BSONParserStack stack)
pure virtual

BSON Element Event.

Parameters
[in]stackThe BSONParserStack object containing the current parse context.

Invoked once per each terminal BSON element that is not a BSON object or a BSON array.

Implemented in mongotype::JSONDump, mongotype::BSONObjectTypeDump, and mongotype::BSONDotNotationDump.

Referenced by mongotype::BSONObjectParser::parseElementRecursive().

Here is the caller graph for this function:

void mongotype::IBSONObjectVisitor::onObjectEnd ( const BSONParserStack stack)
pure virtual

BSON Object Successor Event.

Parameters
[in]stackThe BSONParserStack object containing the current parse context.

Invoked once per each non-terminal BSON object after parsing the contained BSON elements.

Implemented in mongotype::JSONDump, mongotype::BSONObjectTypeDump, and mongotype::BSONDotNotationDump.

Referenced by mongotype::BSONObjectParser::parseObjectRecursive().

Here is the caller graph for this function:

void mongotype::IBSONObjectVisitor::onObjectStart ( const BSONParserStack stack)
pure virtual

BSON Object Precursor Event.

Parameters
[in]stackThe BSONParserStack object containing the current parse context.

Invoked once per each non-terminal BSON object before parsing the contained BSON elements.

Implemented in mongotype::JSONDump, mongotype::BSONObjectTypeDump, and mongotype::BSONDotNotationDump.

Referenced by mongotype::BSONObjectParser::parseObjectRecursive().

Here is the caller graph for this function:

void mongotype::IBSONObjectVisitor::onParseEnd ( )
pure virtual

Parser Destruction Event.

Invoked once each parse after all other events. Used to destroy the parse state.

Implemented in mongotype::JSONDump, mongotype::BSONObjectTypeDump, and mongotype::BSONDotNotationDump.

Referenced by mongotype::BSONObjectParser::parse().

Here is the caller graph for this function:

void mongotype::IBSONObjectVisitor::onParseStart ( )
pure virtual

Parser Construction Event.

Invoked once each parse before all other events. Used to construct the parse state.

Implemented in mongotype::JSONDump, mongotype::BSONObjectTypeDump, and mongotype::BSONDotNotationDump.

Referenced by mongotype::BSONObjectParser::parse().

Here is the caller graph for this function:


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