From 6f2cae95e1791363998c3480d6b561c7bb14186d Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sat, 30 Sep 2017 11:00:37 -0500 Subject: [PATCH] PVField: getParent() const propagation and inline trival --- src/factory/PVField.cpp | 8 +------- src/pv/pvData.h | 9 +++++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/factory/PVField.cpp b/src/factory/PVField.cpp index 4190917..4b239ad 100644 --- a/src/factory/PVField.cpp +++ b/src/factory/PVField.cpp @@ -60,14 +60,8 @@ size_t PVField::getNumberFields() const } -bool PVField::isImmutable() const {return immutable;} - void PVField::setImmutable() {immutable = true;} -const FieldConstPtr & PVField::getField() const {return field;} - -PVStructure *PVField::getParent() const {return parent;} - void PVField::postPut() { if(postHandler.get()!=NULL) postHandler->postPut(); @@ -103,7 +97,7 @@ std::ostream& operator<<(std::ostream& o, const PVField& f) string PVField::getFullName() const { string ret(fieldName); - for(PVField *fld=getParent(); fld; fld=fld->getParent()) + for(const PVField *fld=getParent(); fld; fld=fld->getParent()) { if(fld->getFieldName().size()==0) break; ret = fld->getFieldName() + '.' + ret; diff --git a/src/pv/pvData.h b/src/pv/pvData.h index f79f08b..d34c080 100644 --- a/src/pv/pvData.h +++ b/src/pv/pvData.h @@ -230,7 +230,7 @@ public: * Is the field immutable, i.e. does it not allow changes. * @return (false,true) if it (is not, is) immutable. */ - bool isImmutable() const; + inline bool isImmutable() const {return immutable;} /** * Set the field to be immutable, i.e. it can no longer be modified. * This is permanent, i.e. once done the field cannot be made mutable. @@ -240,12 +240,13 @@ public: * Get the Field that describes the field. * @return Field, which is the reflection interface. */ - const FieldConstPtr & getField() const ; + inline const FieldConstPtr & getField() const {return field;} /** * Get the parent of this field. * @return The parent interface or null if this is PVRecord */ - PVStructure * getParent() const ; + inline PVStructure * getParent() {return parent;} + inline const PVStructure * getParent() const {return parent;} /** * postPut. Called when the field is updated by the implementation. */ @@ -285,7 +286,7 @@ private: static void computeOffset(const PVField *pvField,std::size_t offset); std::string fieldName; PVStructure *parent; - FieldConstPtr field; + const FieldConstPtr field; size_t fieldOffset; size_t nextFieldOffset; bool immutable;