]> SALOME platform Git repositories - tools/medcoupling.git/blob - src/ICoCo/ICoCoMEDIntField.hxx
Salome HOME
Fix compilation error due to integration of windows porting 894bcbdeb7
[tools/medcoupling.git] / src / ICoCo / ICoCoMEDIntField.hxx
1 // Copyright (C) 2007-2019  CEA/DEN, EDF R&D
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
20 // WARNING: this file is part of the official ICoCo API and should not be modified.
21 // The official version can be found at the following URL:
22 //
23 //    https://github.com/cea-trust-platform/icoco-coupling
24
25 #ifndef ICoCoMEDIntField_included
26 #define ICoCoMEDIntField_included
27
28 #include "ICoCoField.hxx"
29
30 namespace MEDCoupling
31 {
32   class MEDCouplingFieldInt32;
33 }
34
35 namespace ICoCo
36 {
37   /*! @brief Field data stored internally as a MEDCoupling object.
38    *
39    * This class is a wrapper around a MEDCoupling::MEDCouplingFieldInt32 object, which holds the field data.
40    * In version 2 of ICoCo, MEDCoupling objects are not anymore exposed directly into the API
41    * of ICoCo::Problem. The rationale is to make the interface ICoCo::Problem free of external dependencies
42    * (MEDCoupling particularly).
43    *
44    * @sa the MEDCoupling documentation, notably the reference counter mechanism used to manage the lifecycle of
45    * MEDCoupling objects.
46    */
47 #ifndef SWIG
48   class MEDCOUPLINGICOCO_EXPORT MEDIntField : public ICoCo::Field
49 #else
50   class MEDIntField : public ICoCo::Field
51 #endif
52   {
53   public:
54     /*! Builds an empty field (internal MEDCoupling object not set).
55      */
56     MEDIntField();
57
58     /*! @brief Builds a field and assign its internal MEDCouplingField object.
59      *
60      * The name of 'this' is also automatically set the name of the MEDCouplingField object. If 'field' is null
61      * the name is set to the empty string.
62      *
63      * @param field MEDCoupling field instance to use for field data. The field reference counter is incremented.
64      */
65     MEDIntField(MEDCoupling::MEDCouplingFieldInt32* field);
66
67     /*! @brief Copy construcotr.
68      */
69     MEDIntField(const MEDIntField& field);
70
71     /*! @brief Assignement operator.
72      * @param field another MEDDoubleField instance. The previous internal MEDCoupling field reference (if any) has
73      * its counter decremented.
74      */
75     MEDIntField& operator=(const MEDIntField& field);
76
77     /*! @brief Destructor.
78      */
79     virtual ~MEDIntField();
80
81     /*! @brief Get the internal MEDCoupling field object.
82      * @return a pointer to the MEDCouplingField object detained by this instance. Note that the corresponding
83      * object should not be deleted, or its reference counter should not be decreased! Doing so will result in an
84      * invalid instance of the current MEDField.
85      */
86     MEDCoupling::MEDCouplingFieldInt32 *getMCField() const;
87
88     /*! @brief Set the internal MEDCoupling field object.
89      *
90      * Any previously set field is discarded (its reference counter is decreased) and the reference counter of the
91      * field being set is increased.
92      *
93      * The name of 'this' is also automatically set the name of the MEDCouplingField object. If 'field' is nullptr
94      * the name is reset to the empty string.
95      *
96      * @param field MEDCouplingFieldDouble object to be used.
97      */
98     void setMCField(MEDCoupling::MEDCouplingFieldInt32 * f);
99
100   private:
101     MEDCoupling::MEDCouplingFieldInt32 *_field;
102   };
103 } // namespace ICoCo
104
105 #endif