From 028076e79cd347a7b3d9db6d526c5742772063d5 Mon Sep 17 00:00:00 2001 From: Dave Hickin Date: Mon, 4 Jul 2016 14:59:56 +0100 Subject: [PATCH] Add char* overload for non-template getSubField --- src/factory/PVStructure.cpp | 4 ++-- src/pv/pvData.h | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/factory/PVStructure.cpp b/src/factory/PVStructure.cpp index aba99bd..14a75c4 100644 --- a/src/factory/PVStructure.cpp +++ b/src/factory/PVStructure.cpp @@ -104,9 +104,9 @@ const PVFieldPtrArray & PVStructure::getPVFields() const return pvFields; } -PVFieldPtr PVStructure::getSubField(string const &fieldName) const +PVFieldPtr PVStructure::getSubField(const char * fieldName) const { - PVField * field = getSubFieldImpl(fieldName.c_str(), false); + PVField * field = getSubFieldImpl(fieldName, false); if (field) return field->shared_from_this(); else diff --git a/src/pv/pvData.h b/src/pv/pvData.h index 2c6d128..dd8d9b5 100644 --- a/src/pv/pvData.h +++ b/src/pv/pvData.h @@ -702,7 +702,12 @@ public: * @param fieldName The name of the field. * @return Pointer to the field or null if field does not exist. */ - PVFieldPtr getSubField(std::string const &fieldName) const; + FORCE_INLINE PVFieldPtr getSubField(std::string const &fieldName) const + { + return getSubField(fieldName.c_str()); + } + + PVFieldPtr getSubField(const char *fieldName) const; /** * Get a subfield with the specified name.