From 461dbdf0f8bcdab8447b255435d613cc8d99f9da Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 8 May 2013 10:31:36 -0400 Subject: [PATCH] remove Convert pointer from PVField Allow inline construction of Convert --- pvDataApp/factory/Convert.cpp | 7 ------- pvDataApp/factory/PVField.cpp | 7 +++---- pvDataApp/pv/convert.h | 3 --- pvDataApp/pv/pvData.h | 1 - 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/pvDataApp/factory/Convert.cpp b/pvDataApp/factory/Convert.cpp index 3724d3b..c33af5e 100644 --- a/pvDataApp/factory/Convert.cpp +++ b/pvDataApp/factory/Convert.cpp @@ -43,13 +43,6 @@ static std::vector split(String commaSeparatedList) { } return valueList; } - -Convert::Convert() -{} - - - -Convert::~Convert(){} void Convert::getString(StringBuilder buf,PVField const *pvField,int indentLevel) { diff --git a/pvDataApp/factory/PVField.cpp b/pvDataApp/factory/PVField.cpp index 577ccb8..e9cd3b7 100644 --- a/pvDataApp/factory/PVField.cpp +++ b/pvDataApp/factory/PVField.cpp @@ -26,8 +26,7 @@ PVField::PVField(FieldConstPtr field) : notImplemented("not implemented"), parent(NULL),field(field), fieldOffset(0), nextFieldOffset(0), - immutable(false), - convert(getConvert()) + immutable(false) { } @@ -175,7 +174,7 @@ void PVField::setParentAndName(PVStructure * xxx,String const & name) bool PVField::equals(PVField &pv) { - return convert->equals(*this,pv); + return pv==*this; } void PVField::toString(StringBuilder buf) @@ -185,7 +184,7 @@ void PVField::toString(StringBuilder buf) void PVField::toString(StringBuilder buf,int indentLevel) { - convert->getString(buf,this,indentLevel); + Convert().getString(buf,this,indentLevel); if(pvAuxInfo.get()!=NULL) pvAuxInfo->toString(buf,indentLevel); } diff --git a/pvDataApp/pv/convert.h b/pvDataApp/pv/convert.h index 5bb23c0..2ddfc21 100644 --- a/pvDataApp/pv/convert.h +++ b/pvDataApp/pv/convert.h @@ -71,7 +71,6 @@ typedef std::tr1::shared_ptr ConvertPtr; class Convert { public: static ConvertPtr getConvert(); - ~Convert(); /** * Get the full fieldName for the pvField. * @param builder The builder that will have the result. @@ -817,8 +816,6 @@ public: * @param indentLevel Indent level, Each level is four spaces. */ void newLine(StringBuilder buf, int indentLevel); -private: - Convert(); }; static inline ConvertPtr getConvert() { return Convert::getConvert(); } diff --git a/pvDataApp/pv/pvData.h b/pvDataApp/pv/pvData.h index c73c5f7..91738a2 100644 --- a/pvDataApp/pv/pvData.h +++ b/pvDataApp/pv/pvData.h @@ -373,7 +373,6 @@ private: bool immutable; RequesterPtr requester; PostHandlerPtr postHandler; - std::tr1::shared_ptr convert; friend class PVDataCreate; friend class PVStructure; };