39 # define __attribute__(x) 45 #include "boost/regex.hpp" 54 LOG_LOGGER _log =
LOG_GET(
"daf.persistence.LogicalLocation");
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);
81 _locString += (boost::format(
"%1%") % value).str();
84 _locString += (boost::format(fmt) % value).str();
93 else if (additionalData && additionalData->
exists(key)) {
94 if (additionalData->
typeOf(key) ==
typeid(int)) {
95 int value = additionalData->
getAsInt(key);
98 _locString += (boost::format(
"%1%") % value).str();
101 _locString += (boost::format(fmt) % value).str();
112 "Unknown substitution: " + key);
116 if (last == boost::sregex_iterator()) {
121 _locString += (*last).suffix().str();
virtual Ptr deepCopy(void) const
std::shared_ptr< PropertySet > Ptr
int getAsInt(std::string const &name) const
std::string const & locString(void) const
Accessor.
LogicalLocation(std::string const &locString, boost::shared_ptr< dafBase::PropertySet const > additionalData=boost::shared_ptr< dafBase::PropertySet const >())
Constructor from string and additional data.
bool exists(std::string const &name) const
#define LSST_EXCEPT(type,...)
static void setLocationMap(boost::shared_ptr< dafBase::PropertySet > map)
Set the logical-to-less-logical map.
#define LOGLS_DEBUG(logger, message)
std::string getAsString(std::string const &name) const
Interface for LogicalLocation class.
std::type_info const & typeOf(std::string const &name) const