39 # define __attribute__(x) 45 #include "boost/regex.hpp" 63 lsst::daf::
base::Citizen(typeid(*this)), _locString() {
64 boost::regex expr(
"(%.*?)\\((\\w+?)\\)");
65 boost::sregex_iterator i = make_regex_iterator(locString, expr);
66 boost::sregex_iterator last;
68 while (i != boost::sregex_iterator()) {
70 if ((*i).prefix().matched) {
71 _locString += (*i).prefix().str();
76 if (_map && _map->exists(key)) {
77 if (_map->typeOf(key) ==
typeid(
int)) {
78 int value = _map->getAsInt(key);
93 else if (additionalData && additionalData->
exists(key)) {
94 if (additionalData->
typeOf(key) ==
typeid(
int)) {
95 int value = additionalData->
getAsInt(key);
112 "Unknown substitution: " + key);
116 if (last == boost::sregex_iterator()) {
121 _locString += (*last).suffix().str();
A PersistentCitizenScope object causes all Citizen objects created during its lifetime to be marked a...
std::shared_ptr< PropertySet > Ptr
int getAsInt(std::string const &name) const
Get the last value for a bool/char/short/int property name (possibly hierarchical).
std::string const & locString(void) const
Accessor.
#define CONST_PTR(...)
A shared pointer to a const object.
LSST DM logging module built on log4cxx.
#define LOGLS_DEBUG(logger, message)
Log a debug-level message using an iostream-based interface.
A base class for image defects.
LogicalLocation(std::string const &locString, boost::shared_ptr< dafBase::PropertySet const > additionalData=boost::shared_ptr< dafBase::PropertySet const >())
Constructor from string and additional data.
virtual Ptr deepCopy() const
Make a deep copy of the PropertySet and all of its contents.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
bool exists(std::string const &name) const
Determine if a name (possibly hierarchical) exists.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
static void setLocationMap(boost::shared_ptr< dafBase::PropertySet > map)
Set the logical-to-less-logical map.
Class for storing generic metadata.
std::string getAsString(std::string const &name) const
Get the last value for a string property name (possibly hierarchical).
#define LOG_GET(logger)
Returns a Log object associated with logger.
Interface for LogicalLocation class.
Reports errors that are due to events beyond the control of the program.
std::type_info const & typeOf(std::string const &name) const
Get the type of values for a property name (possibly hierarchical).