Rename getAs getSubFieldT

Signed-off-by: Dave Hickin <david.hickin@diamond.ac.uk>
This commit is contained in:
Dave Hickin
2015-07-13 12:34:15 +01:00
parent e4689dd3f8
commit ebe2d6196c
6 changed files with 59 additions and 59 deletions

View File

@@ -107,7 +107,7 @@ const PVFieldPtrArray & PVStructure::getPVFields() const
PVFieldPtr PVStructure::getSubField(string const &fieldName) const
{
PVField * field = GetAsImpl(fieldName.c_str(), false);
PVField * field = getSubFieldImpl(fieldName.c_str(), false);
if (field)
return field->shared_from_this();
else
@@ -134,7 +134,7 @@ PVFieldPtr PVStructure::getSubField(size_t fieldOffset) const
throw std::logic_error("PVStructure.getSubField: Logic error");
}
PVField* PVStructure::GetAsImpl(const char *name, bool throws) const
PVField* PVStructure::getSubFieldImpl(const char *name, bool throws) const
{
const PVStructure *parent = this;
if(!name)

View File

@@ -712,7 +712,7 @@ public:
}
private:
PVField *GetAsImpl(const char *name, bool throws = true) const;
PVField *getSubFieldImpl(const char *name, bool throws = true) const;
public:
/**
@@ -721,13 +721,13 @@ public:
* @returns A reference to the sub-field (never NULL)
* @throws std::runtime_error if the requested sub-field doesn't exist, or has a different type
* @code
* PVInt& ref = pvStruct->getAs<PVInt>("substruct.leaffield");
* PVInt& ref = pvStruct->getSubFieldT<PVInt>("substruct.leaffield");
* @endcode
*/
template<typename PVT>
PVT& getAs(const char *name) const
PVT& getSubFieldT(const char *name) const
{
PVT *raw = dynamic_cast<PVT*>(GetAsImpl(name));
PVT *raw = dynamic_cast<PVT*>(getSubFieldImpl(name));
if(!raw)
{
std::stringstream ss;
@@ -738,9 +738,9 @@ public:
}
template<typename PVT>
FORCE_INLINE PVT& getAs(std::string const &fieldName) const
FORCE_INLINE PVT& getSubFieldT(std::string const &fieldName) const
{
return this->getAs<PVT>(fieldName.c_str());
return this->getSubFieldT<PVT>(fieldName.c_str());
}
/**