LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Member Functions | Protected Attributes | List of all members
lsst::pex.policy::PolicyParser Class Referenceabstract

an abstract class for parsing serialized Policy data and loading it into a Policy object. More...

#include <PolicyParser.h>

Inheritance diagram for lsst::pex.policy::PolicyParser:
lsst::daf::base::Citizen lsst::pex.policy::paf::PAFParser

Public Member Functions

 PolicyParser (Policy &policy, bool strict=true)
 
virtual ~PolicyParser ()
 
bool isStrict ()
 
void setStrict (bool strict)
 
virtual int parse (std::istream &is)=0
 
PolicygetPolicy ()
 
const PolicygetPolicy () const
 
- Public Member Functions inherited from lsst::daf::base::Citizen
 Citizen (const std::type_info &)
 
 Citizen (Citizen const &)
 
 ~Citizen ()
 
Citizenoperator= (Citizen const &)
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 

Protected Attributes

Policy_pol
 
bool _strict
 

Additional Inherited Members

- Public Types inherited from lsst::daf::base::Citizen
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback )(const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback )(const Citizen *ptr)
 
- Static Public Member Functions inherited from lsst::daf::base::Citizen
static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector
< const Citizen * > * 
census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 

Detailed Description

an abstract class for parsing serialized Policy data and loading it into a Policy object.

Definition at line 47 of file PolicyParser.h.

Constructor & Destructor Documentation

lsst::pex.policy::PolicyParser::PolicyParser ( Policy policy,
bool  strict = true 
)
inline

Create a Parser attached to a policy object to be loaded.

Parameters
policythe Policy object to load the parsed data 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.

Definition at line 58 of file PolicyParser.h.

59  : lsst::daf::base::Citizen(typeid(this)), _pol(policy), _strict(strict) { }
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
lsst::pex.policy::PolicyParser::~PolicyParser ( )
virtual

destroy this factory

Definition at line 43 of file PolicyParser.cc.

43 { }

Member Function Documentation

Policy& lsst::pex.policy::PolicyParser::getPolicy ( )
inline

return the policy object

Definition at line 93 of file PolicyParser.h.

93 { return _pol; }
const Policy& lsst::pex.policy::PolicyParser::getPolicy ( ) const
inline

return the policy object

Definition at line 94 of file PolicyParser.h.

94 { return _pol; }
bool lsst::pex.policy::PolicyParser::isStrict ( )
inline

return true if this parser will be strict in adhering to syntax rules. In this case, exceptions will be thrown if any syntax errors are detected. Otherwise, some syntax errors may be ignored.

Definition at line 71 of file PolicyParser.h.

71 { return _strict; }
virtual int lsst::pex.policy::PolicyParser::parse ( std::istream &  is)
pure virtual

parse data from the input stream and load results into the attached Policy.

Parameters
isthe stream to read encoded data from
Returns
int the number of parameters values loaded. This does not include sub-Policy objects.

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

void lsst::pex.policy::PolicyParser::setStrict ( bool  strict)
inline

set whether this parser will be strict in adhering to syntax rules. If set to true, exceptions will be thrown if any syntax errors are detected. Otherwise, some syntax errors may be ignored.

Definition at line 78 of file PolicyParser.h.

78 { _strict = strict; }

Member Data Documentation

Policy& lsst::pex.policy::PolicyParser::_pol
protected

Definition at line 99 of file PolicyParser.h.

bool lsst::pex.policy::PolicyParser::_strict
protected

Definition at line 100 of file PolicyParser.h.


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