EvalCases.cpp
Go to the documentation of this file.
00001 //
00002 // EvalCases.cpp
00003 //
00004 // Created on: 05.09.2011
00005 //      Author: wahnfla
00006 //
00007 
00008 #include "EvalCases.hpp"
00009 #include "../tools/errorhandler.hpp"
00010 
00011 namespace datatypes
00012 {
00013 
00014 EvalCases::EvalCases()
00015 {
00016         m_datatype = Datatype_EvalCases;
00017 }
00018 
00019 void EvalCases::clear()
00020 {
00021         m_evalCases.clear();
00022 }
00023 
00024 //
00025 // Add a new EvalCase to the list.
00026 //
00027 void EvalCases::add(EvalCase_ptr evalCase)
00028 {
00029         if (m_evalCases.size() >= 16)
00030         {
00031                 // Error
00032                 printError("EvalCases::add: Cannot add this eval case. The MRS can only handle up to 16 eval cases!");
00033         }
00034         else
00035         {
00036                 // Add the case
00037                 m_evalCases.push_back(evalCase);
00038         }
00039 }
00040 
00041 const EvalCaseVector& EvalCases::getEvalCases() const
00042 {
00043         return m_evalCases;
00044 }
00045 
00046 //
00047 // Estimate the total memory usage of this object.
00048 //
00049 const UINT32 EvalCases::getUsedMemory() const
00050 {
00051         UINT32 mem = 0;
00052         mem += sizeof(*this);
00053         for (UINT32 i = 0; i<m_evalCases.size(); i++)
00054         {
00055                 EvalCase* ec = m_evalCases.at(i);
00056                 mem += ec->getUsedMemory();
00057         }
00058         
00059         return mem;
00060 }
00061 
00062 
00063 } // namespace datatypes


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Wed Jun 14 2017 04:04:50