neic-glass3  1.4.6
Public Member Functions | List of all members
glass3::parse::Parser Class Referenceabstract

glass3 parser class More...

#include <parser.h>

Inheritance diagram for glass3::parse::Parser:
Inheritance graph
Collaboration diagram for glass3::parse::Parser:
Collaboration graph

Public Member Functions

 Parser ()
 
 Parser (const std::string &defaultAgencyID, const std::string &defaultAuthor)
 parser constructor More...
 
virtual ~Parser ()
 parser destructor More...
 
virtual std::shared_ptr< json::Object > parse (const std::string &input)=0
 Virtual parsing function to be overridden by deriving classes, used to parse input. More...
 
- Public Member Functions inherited from glass3::util::BaseClass
 BaseClass ()
 BaseClass constructor. More...
 
virtual ~BaseClass ()
 BaseClass destructor. More...
 
virtual bool setup (std::shared_ptr< const json::Object > config)
 BaseClass configuration function. More...
 
virtual void clear ()
 BaseClass clear function. More...
 
const std::shared_ptr< const json::Object > getConfig ()
 
bool getSetup ()
 Retrieves the class member boolean flag indicating whether the class has been setup, set to true if setup was successful. More...
 
const std::string & getDefaultAgencyId ()
 Function to retrieve the name of the default agency id. More...
 
void setDefaultAgencyId (const std::string &id)
 Function to set the name of the default agency id. More...
 
const std::string & getDefaultAuthor ()
 Function to retrieve the name of the default author. More...
 
void setDefaultAuthor (const std::string &author)
 Function to set the name of the default author. More...
 

Additional Inherited Members

- Protected Attributes inherited from glass3::util::BaseClass
std::shared_ptr< const json::Object > m_Config
 A shared pointer to the json::Object that holds the configuration. More...
 
std::atomic< bool > m_bIsSetup
 the boolean flag indicating whether the class has been setup, set to true if setup was successful. More...
 
std::string m_DefaultAgencyID
 A std::string containing the default agency id to use in parsing if one is not provided. More...
 
std::string m_DefaultAuthor
 A std::string containing the default author to use in parsing if one is not provided. More...
 

Detailed Description

glass3 parser class

The glass3 parser class is a class encapsulating basic parsing logic and validation for neic-glass3.

This class uses the external SuperEasyJSON library to return parsed messages

This class extends from glass3::util::BaseClass

This class is intended to be extended by derived classes.

Constructor & Destructor Documentation

glass3::parse::Parser::Parser ( )
glass3::parse::Parser::Parser ( const std::string &  defaultAgencyID,
const std::string &  defaultAuthor 
)

parser constructor

The constructor for the parser class. Initializes members to provided values.

Parameters
defaultAgencyID- A std::string containing the agency id to use if one is not provided by the parsed message.
defaultAuthor- A std::string containing the author to use if one is not provided by the parsed message.
glass3::parse::Parser::~Parser ( )
virtual

parser destructor

The destructor for the parser class.

Member Function Documentation

virtual std::shared_ptr<json::Object> glass3::parse::Parser::parse ( const std::string &  input)
pure virtual

Virtual parsing function to be overridden by deriving classes, used to parse input.

A pure virtual function used to parse a given string (from a file, broker, or other source) into a SuperEasyJSON object (the common data interchange object) which is returned as a shared_ptr for use in other neic-glass3 functions and classes (such as glasscore).

Parameters
input- The std::string to parse
Returns
Returns a shared_ptr to the json::Object containing the data.

Implemented in glass3::parse::GPickParser, glass3::parse::CCParser, glass3::parse::SimplePickParser, and glass3::parse::JSONParser.


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