GestureRecognitionToolkit  Version: 1.0 Revision: 04-03-15
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
GRTBase.cpp
1 /*
2 GRT MIT License
3 Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 and associated documentation files (the "Software"), to deal in the Software without restriction,
7 including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in all copies or substantial
12 portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15 LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 */
20 
21 #include "GRTBase.h"
22 
23 namespace GRT{
24 
25 GRTBase::GRTBase(void):classType(""),debugLog("[DEBUG]"),errorLog("[ERROR]"),trainingLog("[TRAINING]"),testingLog("[TESTING]"),warningLog("[WARNING]"){
26 
27 }
28 
30 }
31 
33 
34  if( base == NULL ){
35  errorLog << "copyBaseVariables(const GRTBase *base) - base pointer is NULL!" << endl;
36  return false;
37  }
38 
39  this->classType = base->classType;
40  this->debugLog = base->debugLog;
41  this->errorLog = base->errorLog;
42  this->infoLog = base->infoLog;
43  this->trainingLog = base->trainingLog;
44  this->testingLog = base->testingLog;
45  this->warningLog = base->warningLog;
46 
47  return true;
48 }
49 
51  return warningLog.getLastMessage();
52 }
53 
55  return errorLog.getLastMessage();
56 }
57 
59  return infoLog.getLastMessage();
60 }
61 
62 string GRTBase::getGRTVersion(bool returnRevision){
63  string version = GRT_VERSION;
64  if( returnRevision ) version += " revision: " + getGRTRevison();
65  return version;
66 }
67 
69  return GRT_REVISION;
70 }
71 
72 string GRTBase::getClassType() const{
73  return classType;
74 }
75 
77  return this;
78 }
79 
81  return this;
82 }
83 
84 } //End of namespace GRT
85 
string getLastErrorMessage() const
Definition: GRTBase.cpp:54
GRTBase(void)
Definition: GRTBase.cpp:25
Definition: AdaBoost.cpp:25
static string getGRTVersion(bool returnRevision=true)
Definition: GRTBase.cpp:62
virtual ~GRTBase(void)
Definition: GRTBase.cpp:29
bool copyGRTBaseVariables(const GRTBase *GRTBase)
Definition: GRTBase.cpp:32
static string getGRTRevison()
Definition: GRTBase.cpp:68
string getClassType() const
Definition: GRTBase.cpp:72
This file contains the GRTBase class. This is the core base class for all the GRT modules...
GRTBase * getGRTBasePointer()
Definition: GRTBase.cpp:76
string getLastInfoMessage() const
Definition: GRTBase.cpp:58
string getLastWarningMessage() const
Definition: GRTBase.cpp:50