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
|
an abstract class representing a source of serialized Policy parameter data. This might be a file or a stream; sub-classes handle the different possibilities. This class can determine which format the data is in (which may involve reading the first few characters) and load it into a Policy. More...
#include <PolicySource.h>
Public Member Functions | |
PolicySource (SupportedFormats::Ptr fmts=defaultFormats) | |
virtual | ~PolicySource () |
virtual const std::string & | getFormatName ()=0 |
virtual void | load (Policy &policy) const =0 |
virtual void | load (Policy &policy)=0 |
Public Member Functions inherited from lsst::daf::base::Citizen | |
Citizen (const std::type_info &) | |
Citizen (Citizen const &) | |
~Citizen () | |
Citizen & | operator= (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... | |
Static Public Attributes | |
static SupportedFormats::Ptr | defaultFormats |
Protected Attributes | |
SupportedFormats::Ptr | _formats |
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... | |
an abstract class representing a source of serialized Policy parameter data. This might be a file or a stream; sub-classes handle the different possibilities. This class can determine which format the data is in (which may involve reading the first few characters) and load it into a Policy.
Definition at line 53 of file PolicySource.h.
|
inline |
create a Policy file that points a file with given path.
fmts | the list of formats to support |
Definition at line 60 of file PolicySource.h.
|
virtual |
|
pure virtual |
identifiers for the different supported formatsUnknown and unsupported XML format Policy authoring format (PAF) Supported format but unknown determine the format that the data is stored in and return its format type identifier. Note that UNKNOWN will be returned if the format is supported–that is, the data can be read into a Policy object–but otherwise does not have a defined type identifier defined. This may cause the first few records of the source to be read.
IOError | if an error occurs while reading the first few characters of the source stream. return the name of the format that the data is stored in. This may cause the first few records of the source to be read. |
IOError | if an error occurs while reading the first few characters of the source stream. |
Implemented in lsst::pex.policy::PolicyFile, and lsst::pex.policy::PolicyString.
|
pure virtual |
load the data from this Policy source into a Policy object
policy | the policy object to load the data into |
ParserException | if an error occurs while parsing the data |
IOError | if an I/O error occurs while reading from the source stream. |
Implemented in lsst::pex.policy::PolicyFile, lsst::pex.policy::DefaultPolicyFile, and lsst::pex.policy::PolicyString.
|
pure virtual |
load the data from this Policy source into a Policy object
policy | the policy object to load the data into |
ParserException | if an error occurs while parsing the data |
IOError | if an I/O error occurs while reading from the source stream. |
Implemented in lsst::pex.policy::PolicyFile, and lsst::pex.policy::PolicyString.
|
protected |
Definition at line 142 of file PolicySource.h.
|
static |
returns true if the given string containing a content identifier indicates that it contains dictionary data. Dictionary data has a content id of "<?cfg ... dictionary ?>" (where ... indicates the format); policy data has an id of "<?cfg ... policy ?>". a default set of formats
Definition at line 135 of file PolicySource.h.