Skip to content

v0.2.49..v0.2.50 changeset ApiEntityDisplayInfo.cpp

Garret Voltz edited this page Nov 6, 2019 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/info/ApiEntityDisplayInfo.cpp b/hoot-core/src/main/cpp/hoot/core/info/ApiEntityDisplayInfo.cpp
index 7f4947e..3ba14ca 100644
--- a/hoot-core/src/main/cpp/hoot/core/info/ApiEntityDisplayInfo.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/info/ApiEntityDisplayInfo.cpp
@@ -31,6 +31,7 @@
 #include <hoot/core/util/Log.h>
 #include <hoot/core/util/Factory.h>
 #include <hoot/core/info/SingleStatistic.h>
+#include <hoot/core/info/NumericStatistic.h>
 #include <hoot/core/ops/OsmMapOperation.h>
 #include <hoot/core/criterion/ElementCriterion.h>
 #include <hoot/core/elements/ElementVisitor.h>
@@ -74,7 +75,6 @@ public:
 static const int MAX_NAME_SIZE = 45;
 static const int MAX_TYPE_SIZE = 18;
 
-
 QString ApiEntityDisplayInfo::getDisplayInfoOps(const QString& optName)
 {
   LOG_TRACE("getDisplayInfoOps: " << optName);
@@ -154,7 +154,7 @@ QString ApiEntityDisplayInfo::getDisplayInfo(const QString& apiEntityType)
   QTextStream ts(&buffer);
   if (apiEntityType == "operators")
   {
-    msg += "; * = implements SingleStatistic):";
+    msg += "; * = implements SingleStatistic, ** = NumericStatistic):";
     msg.prepend("Operators");
     ts << msg << endl;
     ts << _getApiEntities<ElementCriterion, ElementCriterion>(
@@ -339,9 +339,21 @@ QString ApiEntityDisplayInfo::_getApiEntities(
         supportsSingleStat = true;
       }
 
+      bool supportsNumericStat = false;
+      std::shared_ptr<NumericStatistic> numericStat =
+        std::dynamic_pointer_cast<NumericStatistic>(apiEntity);
+      if (numericStat.get())
+      {
+        supportsNumericStat = true;
+      }
+
       QString name = QString::fromStdString(className).replace("hoot::", "");
       //append '*' to the names of visitors that support the SingleStatistic interface
-      if (supportsSingleStat)
+      if (supportsNumericStat)
+      {
+        name += "**";
+      }
+      else if (supportsSingleStat)
       {
         name += "*";
       }
Clone this wiki locally