itom  4.1.0
itomPlotHandle.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef ITOMPLOTHANDLE_H
29 #define ITOMPLOTHANDLE_H
30 
31 #ifdef __APPLE__
32 extern "C++" {
33 #endif
34 
35  /* includes */
36 #include "commonGlobal.h"
37 #include <string>
38 
39  namespace ito
40  {
41 
42  //----------------------------------------------------------------------------------------------------------------------------------
49  {
50  public:
52  {
53  m_objectID = 0;
54  m_pObjName = "";
55  m_pWidgetClassName = "";
56  }
57  explicit ItomPlotHandle(const char* objName, const char* widgetClassName, const unsigned int objectID)
58  {
59  m_objectID = objectID;
60  if (objName)
61  {
62  m_pObjName = std::string(objName);
63  }
64  else
65  {
66  m_pObjName = "";
67  }
68 
69  if (widgetClassName)
70  {
71  m_pWidgetClassName = std::string(widgetClassName);
72  }
73  else
74  {
75  m_pWidgetClassName = "";
76  }
77 
78  }
79  ItomPlotHandle(const ItomPlotHandle &rhs)
80  {
81  m_objectID = rhs.m_objectID;
82  m_pObjName = rhs.m_pObjName;
83  m_pWidgetClassName = rhs.m_pWidgetClassName;
84  }
85 
87  {
88  m_pObjName = "";
89  m_pWidgetClassName = "";
90  m_objectID = 0;
91  }
92 
93  inline std::string getObjName() const { return m_pObjName; }
94  inline std::string getWidgetClassName() const { return m_pWidgetClassName; }
95  inline unsigned int getObjectID() const { return m_objectID; }
96  private:
97  std::string m_pObjName;
98  std::string m_pWidgetClassName;
99  unsigned int m_objectID;
100  };
101 
102  } //end namespace ito
103 
104 #ifdef __APPLE__
105 }
106 #endif
107 
108 #endif
Definition: apiFunctionsGraph.cpp:39
class for a interval type containing the plot handle / unique id and name.
Definition: itomPlotHandle.h:48