LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Static Public Attributes | List of all members
lsst::pex::policy::PolicyParserFactory Class Referenceabstract

an abstract factory class for creating PolicyParser instances. This class is used by the PolicySource class to determine the format of a stream of serialized Policy data and then parse it into a Policy instance. It is intended that for supported each format there is an implementation of this class and a corresponding PolicyParser class. More...

#include <PolicyParserFactory.h>

Inheritance diagram for lsst::pex::policy::PolicyParserFactory:
lsst::pex::policy::paf::PAFParserFactory

Public Types

typedef boost::shared_ptr
< PolicyParserFactory
Ptr
 

Public Member Functions

 PolicyParserFactory ()
 
virtual ~PolicyParserFactory ()
 
virtual PolicyParsercreateParser (Policy &policy, bool strict=true) const =0
 
virtual bool isRecognized (const std::string &leaders) const =0
 
virtual const std::string & getFormatName ()
 

Static Public Attributes

static const std::string UNRECOGNIZED
 

Detailed Description

an abstract factory class for creating PolicyParser instances. This class is used by the PolicySource class to determine the format of a stream of serialized Policy data and then parse it into a Policy instance. It is intended that for supported each format there is an implementation of this class and a corresponding PolicyParser class.

Definition at line 58 of file PolicyParserFactory.h.

Member Typedef Documentation

Definition at line 61 of file PolicyParserFactory.h.

Constructor & Destructor Documentation

lsst::pex::policy::PolicyParserFactory::PolicyParserFactory ( )
inline

create a factory

Definition at line 66 of file PolicyParserFactory.h.

66 { }
lsst::pex::policy::PolicyParserFactory::~PolicyParserFactory ( )
virtual

destroy this factory

Definition at line 45 of file PolicyParserFactory.cc.

45 { }

Member Function Documentation

virtual PolicyParser* lsst::pex::policy::PolicyParserFactory::createParser ( Policy policy,
bool  strict = true 
) const
pure virtual

create a new PolicyParser class and return a pointer to it. The caller is responsible for destroying the pointer.

Parameters
policythe Policy object that data should be loaded into.
strictif true, be strict in reporting errors in file contents and syntax. If false, errors will be ignored if possible; often, such errors will result in some data not getting loaded. The default is true.

Implemented in lsst::pex::policy::paf::PAFParserFactory.

const std::string & lsst::pex::policy::PolicyParserFactory::getFormatName ( )
virtual

return the name for the format supported by the parser

Reimplemented in lsst::pex::policy::paf::PAFParserFactory.

Definition at line 50 of file PolicyParserFactory.cc.

50  {
51  return UNRECOGNIZED;
52 }
virtual bool lsst::pex::policy::PolicyParserFactory::isRecognized ( const std::string &  leaders) const
pure virtual

analyze the given string assuming contains the leading characters from the data stream and return true if it is recognized as being in the format supported by this parser. If it is, return the name of the this format;

Implemented in lsst::pex::policy::paf::PAFParserFactory.

Member Data Documentation

const std::string lsst::pex::policy::PolicyParserFactory::UNRECOGNIZED
static

an empty string representing an unrecognized format

Definition at line 104 of file PolicyParserFactory.h.


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