38 #define __attribute__(x)
44 #include "boost/regex.hpp"
53 LOG_LOGGER _log =
LOG_GET(
"daf.persistence.LogicalLocation");
63 boost::regex expr(
"(%.*?)\\((\\w+?)\\)");
64 boost::sregex_iterator i = make_regex_iterator(
locString, expr);
65 boost::sregex_iterator last;
67 while (i != boost::sregex_iterator()) {
69 if ((*i).prefix().matched) {
70 _locString += (*i).prefix().str();
75 if (_map && _map->exists(key)) {
76 if (_map->typeOf(key) ==
typeid(
int)) {
77 int value = _map->getAsInt(key);
80 _locString += (boost::format(
"%1%") % value).str();
82 _locString += (boost::format(fmt) % value).str();
89 }
else if (additionalData && additionalData->
exists(key)) {
90 if (additionalData->
typeOf(key) ==
typeid(
int)) {
91 int value = additionalData->
getAsInt(key);
94 _locString += (boost::format(
"%1%") % value).str();
96 _locString += (boost::format(fmt) % value).str();
108 if (last == boost::sregex_iterator()) {
112 _locString += (*last).suffix().str();
#define LOGLS_DEBUG(logger, message)
#define LSST_EXCEPT(type,...)
Interface for LogicalLocation class.
std::string getAsString(std::string const &name) const
virtual Ptr deepCopy() const
int getAsInt(std::string const &name) const
std::shared_ptr< PropertySet > Ptr
bool exists(std::string const &name) const
std::type_info const & typeOf(std::string const &name) const
LogicalLocation(std::string const &locString, boost::shared_ptr< dafBase::PropertySet const > additionalData=boost::shared_ptr< dafBase::PropertySet const >())
Constructor from string and additional data.
std::string const & locString(void) const
Accessor.
static void setLocationMap(boost::shared_ptr< dafBase::PropertySet > map)
Set the logical-to-less-logical map.