diff --git a/src/copy/pvCopy.cpp b/src/copy/pvCopy.cpp index 5fc5c93..15502b5 100644 --- a/src/copy/pvCopy.cpp +++ b/src/copy/pvCopy.cpp @@ -18,7 +18,6 @@ #include #include -#include using std::tr1::static_pointer_cast; using std::tr1::dynamic_pointer_cast; @@ -29,6 +28,18 @@ using std::endl; namespace epics { namespace pvData { +/** + * Convenience method for implementing dump. + * It generates a newline and inserts blanks at the beginning of the newline. + * @param builder The std::string * being constructed. + * @param indentLevel Indent level, Each level is four spaces. + */ +static void newLine(string *buffer, int indentLevel) +{ + *buffer += "\n"; + *buffer += string(indentLevel*4, ' '); +} + static PVCopyPtr NULLPVCopy; static FieldConstPtr NULLField; static StructureConstPtr NULLStructure; @@ -291,7 +302,7 @@ string PVCopy::dump() void PVCopy::dump(string *builder,CopyNodePtr const &node,int indentLevel) { - getConvert()->newLine(builder,indentLevel); + newLine(builder,indentLevel); std::stringstream ss; ss << (node->isStructure ? "structureNode" : "masterNode"); ss << " structureOffset " << node->structureOffset; @@ -299,14 +310,14 @@ void PVCopy::dump(string *builder,CopyNodePtr const &node,int indentLevel) *builder += ss.str(); PVStructurePtr options = node->options; if(options) { - getConvert()->newLine(builder,indentLevel +1); + newLine(builder,indentLevel +1); // TODO !!! ugly std::ostringstream oss; oss << *options; *builder += oss.str(); - getConvert()->newLine(builder,indentLevel); + newLine(builder,indentLevel); } if(!node->isStructure) { CopyMasterNodePtr masterNode = static_pointer_cast(node); @@ -319,7 +330,7 @@ void PVCopy::dump(string *builder,CopyNodePtr const &node,int indentLevel) CopyNodePtrArrayPtr nodes = structureNode->nodes; for(size_t i=0; isize(); ++i) { if((*nodes)[i].get()==NULL) { - getConvert()->newLine(builder,indentLevel +1); + newLine(builder,indentLevel +1); ss.str(""); ss << "node[" << i << "] is null"; *builder += ss.str(); diff --git a/src/factory/Convert.cpp b/src/factory/Convert.cpp index a50e1af..dfdc5dc 100644 --- a/src/factory/Convert.cpp +++ b/src/factory/Convert.cpp @@ -152,12 +152,6 @@ size_t Convert::toStringArray(PVScalarArrayPtr const & pv, return data.size(); } -void Convert::newLine(string *buffer, int indentLevel) -{ - *buffer += "\n"; - *buffer += string(indentLevel*4, ' '); -} - ConvertPtr Convert::getConvert() { static ConvertPtr convert; diff --git a/src/pv/convert.h b/src/pv/convert.h index a15b04e..4741bf8 100644 --- a/src/pv/convert.h +++ b/src/pv/convert.h @@ -49,39 +49,6 @@ typedef std::tr1::shared_ptr ConvertPtr; class epicsShareClass Convert { public: static ConvertPtr getConvert(); - /** - * Get the full fieldName for the pvField. - * @param buf The string that will have the result. - * @param pvField The pvField. - */ - void getFullName(std::string *buf,PVFieldPtr const & pvField) - { - *buf = pvField->getFullName(); - } - - /** - * Do fields have the same definition. - * - * @param a First field - * @param b Second field - * @return (false, true) if the fields (are not, are) the same. - */ - inline bool equals(PVFieldPtr const &a,PVFieldPtr const &b) - { - return *a==*b; - } - - /** - * Do fields have the same definition. - * - * @param a First field - * @param b Second field - * @return (false, true) if the fields (are not, are) the same. - */ - inline bool equals(PVField &a,PVField &b) - { - return a==b; - } /** * Convert a PVField to a string. @@ -308,13 +275,6 @@ public: */ inline void fromDouble(PVScalarPtr const & pv, double from) { pv->putFrom(from); } - /** - * Convenience method for implementing dump. - * It generates a newline and inserts blanks at the beginning of the newline. - * @param builder The std::string * being constructed. - * @param indentLevel Indent level, Each level is four spaces. - */ - void newLine(std::string * buf, int indentLevel); }; static inline ConvertPtr getConvert() { return Convert::getConvert(); } diff --git a/testApp/property/testProperty.cpp b/testApp/property/testProperty.cpp index 53a3e96..3ff363f 100644 --- a/testApp/property/testProperty.cpp +++ b/testApp/property/testProperty.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -41,7 +40,6 @@ static FieldCreatePtr fieldCreate; static PVDataCreatePtr pvDataCreate; static StandardFieldPtr standardField; static StandardPVFieldPtr standardPVField; -static ConvertPtr convert; static string alarmTimeStamp("alarm,timeStamp"); static string allProperties("alarm,timeStamp,display,control"); @@ -236,7 +234,6 @@ MAIN(testProperty) pvDataCreate = getPVDataCreate(); standardField = getStandardField(); standardPVField = getStandardPVField(); - convert = getConvert(); createRecords(); testAlarm(); testTimeStamp(); diff --git a/testApp/pv/testBitSetUtil.cpp b/testApp/pv/testBitSetUtil.cpp index d709aae..c54975c 100644 --- a/testApp/pv/testBitSetUtil.cpp +++ b/testApp/pv/testBitSetUtil.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -32,7 +31,6 @@ static FieldCreatePtr fieldCreate; static PVDataCreatePtr pvDataCreate; static StandardFieldPtr standardField; static StandardPVFieldPtr standardPVField; -static ConvertPtr convert; static void test() { @@ -175,7 +173,6 @@ MAIN(testBitSetUtil) pvDataCreate = getPVDataCreate(); standardField = getStandardField(); standardPVField = getStandardPVField(); - convert = getConvert(); test(); return testDone(); } diff --git a/testApp/pv/testPVUnion.cpp b/testApp/pv/testPVUnion.cpp index cb64321..faf5d04 100644 --- a/testApp/pv/testPVUnion.cpp +++ b/testApp/pv/testPVUnion.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -35,7 +34,6 @@ static FieldCreatePtr fieldCreate = getFieldCreate(); static PVDataCreatePtr pvDataCreate = getPVDataCreate(); static StandardFieldPtr standardField = getStandardField(); static StandardPVFieldPtr standardPVField = getStandardPVField(); -static ConvertPtr convert = getConvert(); static void testPVUnionType() {