Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
XAO_GeometricElement.hxx
Go to the documentation of this file.
1 // Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Frederic Pons (OpenCascade)
20 
21 #ifndef __XAO_GEOMETRICELEMENT_HXX__
22 #define __XAO_GEOMETRICELEMENT_HXX__
23 
24 #include <string>
25 #include <map>
26 
27 #include "XAO.hxx"
28 #include "XAO_Exception.hxx"
29 
30 #ifdef WIN32
31 #pragma warning(disable:4290) // Warning Exception ...
32 #pragma warning(disable:4251) // Warning dll-interface ...
33 #endif
34 
35 
36 namespace XAO
37 {
43  {
44  public:
54  GeometricElement(const std::string& name, const std::string& reference);
58  virtual ~GeometricElement();
59 
64  const std::string getName()
65  {
66  return m_name;
67  }
72  void setName(const std::string& name)
73  {
74  m_name = name;
75  }
76 
81  const bool hasName();
82 
87  const std::string getReference()
88  {
89  return m_reference;
90  }
95  void setReference(const std::string& reference)
96  {
97  m_reference = reference;
98  }
99 
100  private:
102  std::string m_name;
104  std::string m_reference;
105  };
106 
112  {
113  public:
118 
123  GeometricElementList(const int& nb);
124 
129 
134  const int getSize() const { return m_count; }
135 
141  void setSize(const int& nb);
142 
150  void setElement(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception);
157  const std::string getName(const int& index) throw (XAO_Exception);
164  void setName(const int& index, const std::string& name) throw (XAO_Exception);
165 
171  const bool hasName(const int& index) throw (XAO_Exception);
172 
179  const std::string getReference(const int& index) throw (XAO_Exception);
186  void setReference(const int& index, const std::string& reference) throw (XAO_Exception);
187 
193  const int getIndexByReference(const std::string& reference) throw (XAO_Exception);
194 
198  typedef std::map<int, GeometricElement>::iterator iterator;
199 
204  iterator begin() { return m_elements.begin(); }
205 
210  iterator end() { return m_elements.end(); }
211 
212  private:
213  void checkElementIndex(const int& index) const throw (XAO_Exception);
214 
215  private:
216  int m_count;
217  std::map<int, GeometricElement> m_elements;
218  };
219 }
220 
221 #endif /* __XAO_GEOMETRICELEMENT_HXX__ */