1 // Copyright (C) 2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Frederic Pons (OpenCascade)
21 #ifndef __XAO_STEP_HXX__
22 #define __XAO_STEP_HXX__
24 #include "XAO_XaoUtils.hxx"
30 * Base class for steps.
35 /** Default constructor. */
45 * Gets the type of the step.
48 virtual const XAO::Type getType() = 0;
51 * Gets the step index.
52 * @return the index of the step.
54 const int getStep() { return m_step; }
57 * Sets the number of the step.
58 * @param step the index to set.
60 void setStep(const int& step) { m_step = step; }
63 * Gets the stamp of the index.
64 * @return the stamp of the index.
66 const int getStamp() { return m_stamp; }
69 * Sets the stamp of the index.
70 * @param stamp the stamp to set.
72 void setStamp(const int& stamp) { m_stamp = stamp; }
75 * Gets the number of components of the step.
76 * @return the number of components.
78 const int countComponents() { return m_nbComponents; }
81 * Gets the number of elements for the step.
82 * @return the number of elements.
84 const int countElements() { return m_nbElements; }
87 * Gets the number of values for the step.
88 * @return the number of values.
90 const int countValues() { return m_nbElements * m_nbComponents; }
93 * Gets a value as a string.
94 * @param element the index of the element.
95 * @param component the index of the component.
96 * @return the value as a string.
98 virtual const std::string getStringValue(const int& element, const int& component) = 0;
101 * Sets a value as a string
102 * @param element the index of the element.
103 * @param component the index of the component.
104 * @param value the string value.
105 * @throw XAO_Exception if the value is not valid.
107 virtual void setStringValue(const int& element, const int& component, const std::string& value) = 0;
111 * Checks that given element index is in the range of element indexes.
112 * @param element the index to check.
114 void checkElementIndex(const int& element) throw (XAO_Exception);
116 * Checks that given component index is in the range of component indexes.
117 * @param component the index to check.
119 void checkComponentIndex(const int& component)throw (XAO_Exception);
122 * Checks that the given number of elements is correct.
123 * @param nbElements the number of elements to check.
125 void checkNbElements(const int& nbElements)throw (XAO_Exception);
128 * Checks that the given number of components is correct.
129 * @param nbComponents the number of components to check.
131 void checkNbComponents(const int& nbComponents)throw (XAO_Exception);
134 * checks that the given number of values is correct.
135 * @param nbValues the number of values to check.
137 void checkNbValues(const int& nbValues)throw (XAO_Exception);
140 /** the index of the step. */
142 /** The stamp of the step. */
144 /** The number of components. */
146 /** The number of elements. */
152 #endif /* __XAO_STEP_HXX__ */