rec::robotino::api2 C++ interface
Factory4McData.h
1 // Copyright (C) 2004-2015, Robotics Equipment Corporation GmbH
2 
3 //Copyright (c) ...
4 //
5 //REC Robotics Equipment Corporation GmbH, Planegg, Germany. All rights reserved.
6 //Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7 //1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8 //2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 //
10 //THIS SOFTWARE IS PROVIDED BY REC ROBOTICS EQUIPMENT CORPORATION GMBH ?AS IS? AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
11 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL REC ROBOTICS EQUIPMENT CORPORATION GMBH
12 //BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
13 //GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
14 //LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 //
16 //Copyright (c) ...
17 //
18 //REC Robotics Equipment Corporation GmbH, Planegg, Germany. Alle Rechte vorbehalten.
19 //Weiterverbreitung und Verwendung in nichtkompilierter oder kompilierter Form, mit oder ohne Ver?nderung, sind unter den folgenden Bedingungen zul?ssig:
20 //1) Weiterverbreitete nichtkompilierte Exemplare m?ssen das obige Copyright, diese Liste der Bedingungen und den folgenden Haftungsausschluss im Quelltext enthalten.
21 //2) Weiterverbreitete kompilierte Exemplare m?ssen das obige Copyright, diese Liste der Bedingungen und den folgenden Haftungsausschluss in der Dokumentation und/oder anderen Materialien, die mit dem Exemplar verbreitet werden, enthalten.
22 //
23 //DIESE SOFTWARE WIRD VON REC ROBOTICS EQUIPMENT CORPORATION GMBH OHNE JEGLICHE SPEZIELLE ODER IMPLIZIERTE GARANTIEN ZUR VERF?GUNG GESTELLT, DIE UNTER
24 //ANDEREM EINSCHLIESSEN: DIE IMPLIZIERTE GARANTIE DER VERWENDBARKEIT DER SOFTWARE F?R EINEN BESTIMMTEN ZWECK. AUF KEINEN FALL IST REC ROBOTICS EQUIPMENT CORPORATION GMBH
25 //F?R IRGENDWELCHE DIREKTEN, INDIREKTEN, ZUF?LLIGEN, SPEZIELLEN, BEISPIELHAFTEN ODER FOLGESCH?DEN (UNTER ANDEREM VERSCHAFFEN VON ERSATZG?TERN ODER -DIENSTLEISTUNGEN;
26 //EINSCHR?NKUNG DER NUTZUNGSF?HIGKEIT; VERLUST VON NUTZUNGSF?HIGKEIT; DATEN; PROFIT ODER GESCH?FTSUNTERBRECHUNG), WIE AUCH IMMER VERURSACHT UND UNTER WELCHER VERPFLICHTUNG
27 //AUCH IMMER, OB IN VERTRAG, STRIKTER VERPFLICHTUNG ODER UNERLAUBTER HANDLUNG (INKLUSIVE FAHRL?SSIGKEIT) VERANTWORTLICH, AUF WELCHEM WEG SIE AUCH IMMER DURCH DIE BENUTZUNG
28 //DIESER SOFTWARE ENTSTANDEN SIND, SOGAR, WENN SIE AUF DIE M?GLICHKEIT EINES SOLCHEN SCHADENS HINGEWIESEN WORDEN SIND.
29 
30 #ifndef FACTORY4MCDATA_H
31 #define FACTORY4MCDATA_H
32 
33 namespace rec
34 {
35  namespace robotino
36  {
37  namespace api2
38  {
40  {
41  public:
43  : id(-1)
44  , x(0)
45  , y(0)
46  , pose(-1)
47  , path(-1)
48  {
49 
50  }
51 
52  int id;
53  double x, y;
54  int pose;
55  int path;
56  };
57 
59  {
60  public:
62  : id(-1)
63  , status(-1)
64  , rId(-1)
65  {
66 
67  }
68 
69  int id;
70  int status;
71  int rId;
72  };
73 
75  {
76  public:
78  : _size(0)
79  , _data(0)
80  {
81  }
82 
83  Factory4McLayout( const unsigned int size )
84  : _size(size)
85  , _data(0)
86  {
87  if (_size > 0)
88  {
89  _data = new Factory4LayoutData[_size];
90  }
91  }
92 
94  : _size(other._size)
95  , _data(0)
96  {
97  if (_size > 0)
98  {
99  _data = new Factory4LayoutData[_size];
100  for (int i = 0; i < _size; ++i)
101  {
102  _data[i] = other._data[i];
103  }
104  }
105  }
106 
108  {
109  delete[] _data;
110  }
111 
112  const unsigned int size() const
113  {
114  return _size;
115  }
116 
118  const Factory4LayoutData& operator[](int index) const
119  {
120  return _data[index];
121  }
122 
123  Factory4LayoutData& operator[](int index)
124  {
125  return _data[index];
126  }
127 
128  Factory4McLayout& operator=(const Factory4McLayout& other)
129  {
130  delete[] _data;
131  _data = 0;
132  _size = 0;
133  if (other._size > 0)
134  {
135  _size = other._size;
136  _data = new Factory4LayoutData[_size];
137  for (int i = 0; i < _size; ++i)
138  {
139  _data[i] = other._data[i];
140  }
141  }
142  return *this;
143  }
144 
145  private:
146  unsigned int _size;
147  Factory4LayoutData* _data;
148  };
149 
151  {
152  public:
154  : _size(0)
155  , _data(0)
156  {
157  }
158 
159  Factory4McStatus(const unsigned int size)
160  : _size(size)
161  , _data(0)
162  {
163  if (_size > 0)
164  {
165  _data = new Factory4StatusData[_size];
166  }
167  }
168 
169  Factory4McStatus(const Factory4McStatus& other)
170  : _size(other._size)
171  , _data(0)
172  {
173  if (_size > 0)
174  {
175  _data = new Factory4StatusData[_size];
176  for (int i = 0; i < _size; ++i)
177  {
178  _data[i] = other._data[i];
179  }
180  }
181  }
182 
184  {
185  delete[] _data;
186  }
187 
188  const unsigned int size() const
189  {
190  return _size;
191  }
192 
194  const Factory4StatusData& operator[](int index) const
195  {
196  return _data[index];
197  }
198 
199  Factory4StatusData& operator[](int index)
200  {
201  return _data[index];
202  }
203 
204  Factory4McStatus& operator=(const Factory4McStatus& other)
205  {
206  delete[] _data;
207  _data = 0;
208  _size = 0;
209  if (other._size > 0)
210  {
211  _size = other._size;
212  _data = new Factory4StatusData[_size];
213  for (int i = 0; i < _size; ++i)
214  {
215  _data[i] = other._data[i];
216  }
217  }
218  return *this;
219  }
220 
221  private:
222  unsigned int _size;
223  Factory4StatusData* _data;
224  };
225  }
226  }
227 }
228 #endif // FACTORY4MCDATA_H
const Factory4LayoutData & operator[](int index) const
Enables access via index.
Definition: Factory4McData.h:118
Definition: Factory4McData.h:150
Definition: Factory4McData.h:58
Definition: AnalogInput.h:36
Definition: Factory4McData.h:39
const Factory4StatusData & operator[](int index) const
Enables access via index.
Definition: Factory4McData.h:194
Definition: Factory4McData.h:74