HeightChecker.cpp
Go to the documentation of this file.
1 
18 #include "HeightChecker.hpp"
19 #include "sstream"
20 #include "utility/LogHelper.hpp"
21 
22 namespace ISM {
23 
25  {
26  if (tree->getHeight() > mMaxHeight)
27  {
28  LogHelper::logMessage("Rejected tree because its height (" + std::to_string(tree->getHeight())
29  + ") is greater than the max height (" + std::to_string(mMaxHeight) + ")\n",
31  return false;
32  }
34  return true;
35  }
36 
38  {
39  std::stringstream s;
40  s << "TreeValidator is HeightChecker.cpp : " << std::endl
41  << "- Checking if tree height is <= " << mMaxHeight
42  << " and if tree is connected" << std::endl;
43  return s.str();
44  }
45 }
46 
static void logMessage(const std::string &message, LogLevel logLevel=LOG_INFO, const char *logColor=LOG_COLOR_DEFAULT)
Definition: LogHelper.cpp:96
bool isTreeValid(TreePtr tree)
const char * LOG_COLOR_TREE_VALDIATOR_COLOR
boost::shared_ptr< Tree > TreePtr
Definition: typedef.hpp:46
this namespace contains all generally usable classes.
virtual std::string getDescription()


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40