return s;
}
-HLADataElement::AttributePathPair
-HLADataElement::toAttributePathPair(const std::string& s)
+HLADataElement::StringPathPair
+HLADataElement::toStringPathPair(const std::string& s)
{
Path path;
- // Skip the initial attribute name if given
+ // Skip the initial attribute/parameter name if given
std::string::size_type i = s.find_first_of("[.");
std::string attribute = s.substr(0, i);
while (i < s.size()) {
if (10 <= v) {
SG_LOG(SG_NETWORK, SG_WARN, "HLADataElement: invalid character in array subscript for \""
<< s << "\" at \"" << attribute << toString(path) << "\"!");
- return AttributePathPair();
+ return StringPathPair();
}
index *= 10;
index += v;
if (s.size() <= ++i) {
SG_LOG(SG_NETWORK, SG_WARN, "HLADataElement: invalid terminating '.' for \""
<< s << "\"!");
- return AttributePathPair();
+ return StringPathPair();
}
std::string::size_type e = s.find_first_of("[.", i);
path.push_back(s.substr(i, e - i));
}
}
- return AttributePathPair(attribute, path);
+ return StringPathPair(attribute, path);
}
}
SGSharedPtr<Data> _data;
};
typedef std::list<PathElement> Path;
- typedef std::pair<std::string, Path> AttributePathPair;
+ typedef std::pair<std::string, Path> StringPathPair;
+ typedef StringPathPair AttributePathPair; // deprecated
typedef std::pair<unsigned, Path> IndexPathPair;
static std::string toString(const Path& path);
- static std::string toString(const AttributePathPair& path)
+ static std::string toString(const StringPathPair& path)
{ return path.first + toString(path.second); }
- static AttributePathPair toAttributePathPair(const std::string& s);
+ static StringPathPair toStringPathPair(const std::string& s);
+ static AttributePathPair toAttributePathPair(const std::string& s) // deprecated
+ { return toStringPathPair(s); }
static Path toPath(const std::string& s)
- { return toAttributePathPair(s).second; }
+ { return toStringPathPair(s).second; }
private:
// SGSharedPtr<const TimeStamp> _timeStamp;
}
HLADataElement::IndexPathPair
-HLAObjectClass::getIndexPathPair(const HLADataElement::AttributePathPair& attributePathPair) const
+HLAObjectClass::getIndexPathPair(const HLADataElement::StringPathPair& stringPathPair) const
{
- unsigned index = getAttributeIndex(attributePathPair.first);
+ unsigned index = getAttributeIndex(stringPathPair.first);
if (getNumAttributes() <= index) {
SG_LOG(SG_NETWORK, SG_ALERT, "HLAObjectClass::getIndexPathPair(\""
- << HLADataElement::toString(attributePathPair)
- << "\"): Could not resolve attribute \"" << attributePathPair.first
+ << HLADataElement::toString(stringPathPair)
+ << "\"): Could not resolve attribute \"" << stringPathPair.first
<< "\" for object class \"" << getName() << "\"!");
}
- return HLADataElement::IndexPathPair(index, attributePathPair.second);
+ return HLADataElement::IndexPathPair(index, stringPathPair.second);
}
HLADataElement::IndexPathPair
HLAObjectClass::getIndexPathPair(const std::string& path) const
{
- return getIndexPathPair(HLADataElement::toAttributePathPair(path));
+ return getIndexPathPair(HLADataElement::toStringPathPair(path));
}
bool
HLAUpdateType getAttributeUpdateType(unsigned index) const;
void setAttributeUpdateType(unsigned index, HLAUpdateType updateType);
- HLADataElement::IndexPathPair getIndexPathPair(const HLADataElement::AttributePathPair&) const;
+ HLADataElement::IndexPathPair getIndexPathPair(const HLADataElement::StringPathPair&) const;
HLADataElement::IndexPathPair getIndexPathPair(const std::string& path) const;
bool subscribe(const std::set<unsigned>& indexSet, bool active);