iCub-main
IethResource.cpp
Go to the documentation of this file.
1 // -*- Mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 
4 /*
5  * Copyright (C) 2017 iCub Facility - Istituto Italiano di Tecnologia
6  * Author: Marco Accame
7  * email: marco.accame@iit.it
8  * website: www.robotcub.org
9  * Permission is granted to copy, distribute, and/or modify this program
10  * under the terms of the GNU General Public License, version 2 or any
11  * later version published by the Free Software Foundation.
12  *
13  * A copy of the license can be found at
14  * http://www.robotcub.org/icub/license/gpl.txt
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19  * Public License for more details
20 */
21 
22 
23 // --------------------------------------------------------------------------------------------------------------------
24 // - public interface
25 // --------------------------------------------------------------------------------------------------------------------
26 
27 #include "IethResource.h"
28 
29 
30 
31 // --------------------------------------------------------------------------------------------------------------------
32 // - external dependencies
33 // --------------------------------------------------------------------------------------------------------------------
34 
35 
36 
37 
38 // --------------------------------------------------------------------------------------------------------------------
39 // - pimpl: private implementation (see scott meyers: item 22 of effective modern c++, item 31 of effective c++
40 // --------------------------------------------------------------------------------------------------------------------
41 
42 
43 
44 // --------------------------------------------------------------------------------------------------------------------
45 // - the class
46 // --------------------------------------------------------------------------------------------------------------------
47 
48 // - class IethResource
49 
50 using namespace eth;
51 
52 const char * IethResource::names[iethresType_numberof+1] =
53 {
54  "resManagement", "resAnalogMais", "resAnalogStrain", "resMotionControl",
55  "resSkin", "resAnalogVirtual", "resAnalogInertial", "resAnalogmultienc",
56  "resAnalogInertial3", "resAnalogTemperature", "resAnalogPSC", "resAnalogPOS","resAnalogFT",
57  "resNONE"
58 };
59 
61 {
62  iethresType_t t = this->type();
63 
64  if(iethres_none == t)
65  {
66  return names[iethresType_numberof];
67  }
68 
69  return names[t];
70 }
71 
72 bool IethResource::getEntityName(uint32_t entityId, std::string &entityName)
73 {
74  entityName.clear();
75  return true;
76 }
77 
78 
79 // - end-of-file (leave a blank line after)----------------------------------------------------------------------------
80 
81 
82 
83 
84 
virtual bool getEntityName(uint32_t entityId, std::string &entityName)
virtual iethresType_t type()=0
const char * stringOfType()
iethresType_t
Definition: IethResource.h:62
@ iethres_none
Definition: IethResource.h:63
@ iethresType_numberof
Definition: IethResource.h:79