lsst.pex.policy  17.0+11
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
lsst::pex::policy::paf::PAFParser Class Reference

a parser for reading PAF-formatted data into a Policy object More...

#include <PAFParser.h>

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

Public Types

typedef unsigned long memId
 
typedef memId(* memNewCallback) (const memId cid)
 
typedef memId(* memCallback) (const Citizen *ptr)
 

Public Member Functions

 PAFParser (Policy &policy)
 create a parser to load a Policy More...
 
 PAFParser (Policy &policy, bool strict)
 create a parser to load a Policy More...
 
virtual ~PAFParser ()
 delete this parser More...
 
virtual int parse (std::istream &is)
 parse the data found on the given stream More...
 
bool isStrict ()
 return true if this parser will be strict in adhering to syntax rules. More...
 
void setStrict (bool strict)
 set whether this parser will be strict in adhering to syntax rules. More...
 
std::string repr () const
 
void markPersistent (void)
 
memId getId () const
 
PolicygetPolicy ()
 return the policy object More...
 
const PolicygetPolicy () const
 return the policy object More...
 

Static Public Member Functions

static bool hasBeenCorrupted ()
 
static memId getNextMemId ()
 
static int init ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static memId setNewCallbackId (memId id)
 
static memId setNewCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memNewCallback setNewCallback (memNewCallback func)
 
static memCallback setDeleteCallback (memCallback func)
 
static memCallback setCorruptionCallback (memCallback func)
 

Public Attributes

 magicSentinel
 

Protected Attributes

Policy_pol
 
bool _strict
 

Detailed Description

a parser for reading PAF-formatted data into a Policy object

Definition at line 54 of file PAFParser.h.

Constructor & Destructor Documentation

◆ PAFParser() [1/2]

lsst::pex::policy::paf::PAFParser::PAFParser ( Policy policy)

create a parser to load a Policy

Parameters
policythe Policy object to load the parsed data into

◆ PAFParser() [2/2]

lsst::pex::policy::paf::PAFParser::PAFParser ( Policy policy,
bool  strict 
)

create a parser to load a Policy

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. The default (set by PolicyParser) is true.

◆ ~PAFParser()

virtual lsst::pex::policy::paf::PAFParser::~PAFParser ( )
virtual

delete this parser

Member Function Documentation

◆ getPolicy() [1/2]

Policy& lsst::pex::policy::PolicyParser::getPolicy ( )
inlineinherited

return the policy object

Definition at line 93 of file PolicyParser.h.

◆ getPolicy() [2/2]

const Policy& lsst::pex::policy::PolicyParser::getPolicy ( ) const
inlineinherited

return the policy object

Definition at line 94 of file PolicyParser.h.

◆ isStrict()

bool lsst::pex::policy::PolicyParser::isStrict ( )
inlineinherited

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.

◆ parse()

virtual int lsst::pex::policy::paf::PAFParser::parse ( std::istream is)
virtual

parse the data found on the given stream

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

Implements lsst::pex::policy::PolicyParser.

◆ setStrict()

void lsst::pex::policy::PolicyParser::setStrict ( bool  strict)
inlineinherited

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.

Member Data Documentation

◆ _pol

Policy& lsst::pex::policy::PolicyParser::_pol
protectedinherited

Definition at line 99 of file PolicyParser.h.

◆ _strict

bool lsst::pex::policy::PolicyParser::_strict
protectedinherited

Definition at line 100 of file PolicyParser.h.


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