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
|
a representation of a string containing Policy parameter data More...
#include <PolicyString.h>
Public Member Functions | |
PolicyString (const std::string &data, const SupportedFormats::Ptr &fmts=defaultFormats) | |
PolicyString (const SupportedFormats::Ptr &fmts=defaultFormats) | |
const std::string & | getData () const |
virtual const std::string & | getFormatName () |
const std::string & | getFormatName () const |
virtual void | load (Policy &policy) |
void | load (Policy &policy) const |
Public Member Functions inherited from lsst::pex.policy::PolicySource | |
PolicySource (SupportedFormats::Ptr fmts=defaultFormats) | |
virtual | ~PolicySource () |
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... | |
Public Member Functions inherited from lsst::daf::base::Persistable | |
Persistable (void) | |
virtual | ~Persistable (void) |
template<class Archive > | |
void | serialize (Archive &, unsigned int const) |
Static Public Attributes | |
static const boost::regex | SPACE_RE |
static const boost::regex | COMMENT |
reg-exp for an empty line More... | |
static const boost::regex | CONTENTID |
reg-exp for the start of a comment More... | |
Static Public Attributes inherited from lsst::pex.policy::PolicySource | |
static SupportedFormats::Ptr | defaultFormats |
Protected Attributes | |
std::string | _data |
Protected Attributes inherited from lsst::pex.policy::PolicySource | |
SupportedFormats::Ptr | _formats |
Private Member Functions | |
const std::string & | cacheName (const std::string &name) |
Private Attributes | |
std::string | _format |
PolicyParserFactory::Ptr | _pfact |
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) |
Public Types inherited from lsst::daf::base::Persistable | |
typedef boost::shared_ptr < Persistable > | 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... | |
a representation of a string containing Policy parameter data
This class facilitates reading data from a string. This class is especially useful for supporting string I/O from Python. The data is encoded in a supported format (just like the contents of a policy file).
Definition at line 52 of file PolicyString.h.
|
explicit |
create a PolicyString that's wrapped around a given string.
data | the path to the file, either as a string or a boost::filesystem::path instance |
fmts | a SupportedFormats object to use. An instance encapsulates a configured set of known formats. |
lsst::pex.policy::PolicyString::PolicyString | ( | const SupportedFormats::Ptr & | fmts = defaultFormats | ) |
create a "null" Policy formed from an empty string.
fmts | a SupportedFormats object to use. An instance encapsulates a configured set of known formats. |
|
inlineprivate |
Definition at line 121 of file PolicyString.h.
|
inline |
|
virtual |
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. In this implementation, once the format is definitely determined, the format name is cached internally, preventing re-determination on the next call to this function.
IOError | if an error occurs while reading the first few characters of the source stream. |
Implements lsst::pex.policy::PolicySource.
|
inline |
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. In this implementation, once the format is definitely determined, the format name is cached internally, preventing re-determination on the next call to this function.
IOError | if an error occurs while reading the first few characters of the source stream. |
Definition at line 88 of file PolicyString.h.
|
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. |
Implements lsst::pex.policy::PolicySource.
|
inlinevirtual |
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. |
Implements lsst::pex.policy::PolicySource.
Definition at line 102 of file PolicyString.h.
|
protected |
the policy data
Definition at line 118 of file PolicyString.h.
|
private |
Definition at line 126 of file PolicyString.h.
|
private |
Definition at line 127 of file PolicyString.h.
|
static |
reg-exp for an empty line
Definition at line 108 of file PolicyString.h.
|
static |
reg-exp for the start of a comment
reg-exp for a Policy content identifier, "<?cfg [format] [content] ?>"
Definition at line 112 of file PolicyString.h.
|
static |
Definition at line 107 of file PolicyString.h.