From d13284da7ff8bcd802c96f27e78b952720cad0bb Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Tue, 10 May 2011 07:38:04 -0400 Subject: [PATCH] PVField no longer extends Requester. --- pvDataApp/factory/PVField.cpp | 18 +++++++++--------- pvDataApp/pv/pvData.h | 8 +++----- test/testBaseExceptionDiff | 4 ++-- test/testLinkedListAux | 24 ++++++++++++------------ test/testPVAppend | 4 ++-- test/testPVAppendDiff | 8 -------- test/testPVAppendGold | 2 +- test/testPropertyAux | 2 +- test/testThreadAux | 2 +- test/testTimeStampAux | 8 ++++---- test/testTimerAux | 12 ++++++------ 11 files changed, 41 insertions(+), 51 deletions(-) diff --git a/pvDataApp/factory/PVField.cpp b/pvDataApp/factory/PVField.cpp index 546f883..5175ab6 100644 --- a/pvDataApp/factory/PVField.cpp +++ b/pvDataApp/factory/PVField.cpp @@ -34,13 +34,15 @@ public: bool immutable; Requester *requester; PostHandler *postHandler; + Convert *convert; }; PVFieldPvt::PVFieldPvt(PVStructure *parent,FieldConstPtr field) : parent(parent),field(field), fieldOffset(0), nextFieldOffset(0), pvAuxInfo(0), - immutable(false),requester(0),postHandler(0) + immutable(false),requester(0),postHandler(0), + convert(getConvert()) { } @@ -63,13 +65,6 @@ PVField::~PVField() delete pImpl; } -String PVField::getRequesterName() -{ - static String none("none"); - if(pImpl->requester!=0) return pImpl->requester->getRequesterName(); - return none; -} - void PVField::message(String fieldName,String message,MessageType messageType) { if(pImpl->parent!=0) { @@ -176,11 +171,16 @@ void PVField::setParent(PVStructure * parent) pImpl->parent = parent; } +bool PVField::equals(PVField &pv) +{ + return pImpl->convert->equals(*this,pv); +} + void PVField::toString(StringBuilder buf) {toString(buf,0);} void PVField::toString(StringBuilder buf,int indentLevel) { - getConvert()->getString(buf,this,indentLevel); + pImpl->convert->getString(buf,this,indentLevel); if(pImpl->pvAuxInfo==0) return; pImpl->pvAuxInfo->toString(buf,indentLevel); } diff --git a/pvDataApp/pv/pvData.h b/pvDataApp/pv/pvData.h index 152faf5..ae8fca4 100644 --- a/pvDataApp/pv/pvData.h +++ b/pvDataApp/pv/pvData.h @@ -57,8 +57,7 @@ public: }; class PVField -: virtual public Requester, - virtual public Serializable, +: virtual public Serializable, private NoDefaultMethods { public: @@ -66,7 +65,6 @@ public: typedef std::tr1::shared_ptr const_shared_pointer; virtual ~PVField(); - String getRequesterName() ; virtual void message(String message,MessageType messageType) ; virtual void setRequester(Requester *prequester); int getFieldOffset() ; @@ -74,13 +72,13 @@ public: int getNumberFields() ; PVAuxInfo * getPVAuxInfo(); bool isImmutable() ; - void setImmutable(); + virtual void setImmutable(); FieldConstPtr getField() ; PVStructure * getParent() ; bool renameField(String newName); void postPut() ; void setPostHandler(PostHandler *postHandler); - bool equals(PVField &pv); + virtual bool equals(PVField &pv); virtual void toString(StringBuilder buf) ; virtual void toString(StringBuilder buf,int indentLevel) ; protected: diff --git a/test/testBaseExceptionDiff b/test/testBaseExceptionDiff index 30d227d..404d981 100644 --- a/test/testBaseExceptionDiff +++ b/test/testBaseExceptionDiff @@ -1,5 +1,5 @@ ---- testBaseExceptionGold 2011-04-25 13:04:28.000000000 -0400 -+++ testBaseException 2011-04-27 07:53:41.000000000 -0400 +--- testBaseExceptionGold 2011-04-27 13:11:55.000000000 -0400 ++++ testBaseException 2011-05-10 07:36:37.000000000 -0400 @@ -1,37 +1,46 @@ + + diff --git a/test/testLinkedListAux b/test/testLinkedListAux index acfa090..fb4614a 100644 --- a/test/testLinkedListAux +++ b/test/testLinkedListAux @@ -1,20 +1,20 @@ Time test -diff 22.226751 milliSeconds -time per iteration 22.226751 microseconds -time per addTail/removeHead 0.011113 microseconds +diff 23.025222 milliSeconds +time per iteration 23.025222 microseconds +time per addTail/removeHead 0.011513 microseconds Time test locked -diff 205.273532 milliSeconds -time per iteration 205.273532 microseconds -time per addTail/removeHead 0.102637 microseconds +diff 221.055746 milliSeconds +time per iteration 221.055746 microseconds +time per addTail/removeHead 0.110528 microseconds Time std::list test -diff 666.642776 milliSeconds -time per iteration 666.642776 microseconds -time per addTail/removeHead 0.333321 microseconds +diff 658.326477 milliSeconds +time per iteration 658.326477 microseconds +time per addTail/removeHead 0.329163 microseconds Time std::list test locked -diff 812.128477 milliSeconds -time per iteration 812.128477 microseconds -time per addTail/removeHead 0.406064 microseconds +diff 825.914024 milliSeconds +time per iteration 825.914024 microseconds +time per addTail/removeHead 0.412957 microseconds diff --git a/test/testPVAppend b/test/testPVAppend index 493c679..2b8b346 100644 --- a/test/testPVAppend +++ b/test/testPVAppend @@ -28,5 +28,5 @@ structure parent string Mary Good Girl structure child2 string Jane Bad Girl -pvField: totalConstruct 15 totalDestruct 14 ACTIVE 1 -field: totalConstruct 108 totalDestruct 107 ACTIVE 1 +pvField: totalConstruct 15 totalDestruct 15 +field: totalConstruct 108 totalDestruct 108 diff --git a/test/testPVAppendDiff b/test/testPVAppendDiff index 0270ca7..e69de29 100644 --- a/test/testPVAppendDiff +++ b/test/testPVAppendDiff @@ -1,8 +0,0 @@ ---- testPVAppendGold 2011-04-25 13:04:28.000000000 -0400 -+++ testPVAppend 2011-04-27 07:53:46.000000000 -0400 -@@ -29,4 +29,4 @@ - structure child2 - string Jane Bad Girl - pvField: totalConstruct 15 totalDestruct 14 ACTIVE 1 --field: totalConstruct 108 totalDestruct 108 -+field: totalConstruct 108 totalDestruct 107 ACTIVE 1 diff --git a/test/testPVAppendGold b/test/testPVAppendGold index c0477ab..2b8b346 100644 --- a/test/testPVAppendGold +++ b/test/testPVAppendGold @@ -28,5 +28,5 @@ structure parent string Mary Good Girl structure child2 string Jane Bad Girl -pvField: totalConstruct 15 totalDestruct 14 ACTIVE 1 +pvField: totalConstruct 15 totalDestruct 15 field: totalConstruct 108 totalDestruct 108 diff --git a/test/testPropertyAux b/test/testPropertyAux index 24c1967..a3dcd7b 100644 --- a/test/testPropertyAux +++ b/test/testPropertyAux @@ -1 +1 @@ -2011.04.27 07:53:47 782836752 nanoSeconds isDst true +2011.05.10 07:36:42 565871670 nanoSeconds isDst true diff --git a/test/testThreadAux b/test/testThreadAux index fb69fe0..afcc880 100644 --- a/test/testThreadAux +++ b/test/testThreadAux @@ -1 +1 @@ -time per call 0.007046 microseconds +time per call 0.007801 microseconds diff --git a/test/testTimeStampAux b/test/testTimeStampAux index af8e40c..05c5ce3 100644 --- a/test/testTimeStampAux +++ b/test/testTimeStampAux @@ -1,5 +1,5 @@ -current 1303905226 876200358 milliSec 1303905226876 -2011.04.27 07:53:46 876200358 nanoSeconds isDst true +current 1305027401 678184290 milliSec 1305027401678 +2011.05.10 07:36:41 678184290 nanoSeconds isDst true fromTime_t -current 1303905226 0 milliSec 1303905226000 -2011.04.27 07:53:46 0 nanoSeconds isDst true +current 1305027401 0 milliSec 1305027401000 +2011.05.10 07:36:41 0 nanoSeconds isDst true diff --git a/test/testTimerAux b/test/testTimerAux index 7e91b10..ddd9f7d 100644 --- a/test/testTimerAux +++ b/test/testTimerAux @@ -1,6 +1,6 @@ -one requested 0.400000 diff 0.400283 seconds -two requested 0.200000 diff 0.200268 seconds -one requested 0.200000 diff 0.200291 seconds -two requested 0.400000 diff 0.400374 seconds -one requested 0.000000 diff 0.000042 seconds -two requested 0.000000 diff 0.000061 seconds +one requested 0.400000 diff 0.400284 seconds +two requested 0.200000 diff 0.200202 seconds +one requested 0.200000 diff 0.200283 seconds +two requested 0.400000 diff 0.400290 seconds +one requested 0.000000 diff 0.000034 seconds +two requested 0.000000 diff 0.000049 seconds