1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef UTILCLIENT_HXX_
24 #define UTILCLIENT_HXX_
27 #include <utilities.h>
28 #include "MEDMEM_PointerOf.hxx"
31 template <typename TLocal,
34 inline void convertCorbaArray (TLocal * & T, Tint &nT, const TCorbaSeq & S)
36 Tint i, n = S->length();
39 T = n > 0 ? new TLocal[n] : NULL;
46 template <typename TLocal,
49 inline void convertCorbaArray2 (TLocal& tab, Tint &nT, const TCorbaSeq s)
51 Tint i, n = s.length();
60 template <typename TCorba,
63 inline void convertCorbaArray (TLocal * & T, long &nT, const TCorbaSeq & S,
66 int i, n = S->length();
70 T = n > 0 ? new TLocal[n] : NULL;
72 typedef TLocal (*pfn) (const TCorba &T);
77 T[i] = convert((*S)[i]);
82 template <typename TLocal,
84 inline void convertCorbaArray (std::vector<TLocal> & T, int &nT,
87 int i, n = S->length();
93 for (i=0; i<nT; i++) {
95 T[i] = convert((*S)[i]);
101 template <typename TCorba,
104 inline void convertCorbaArray (std::vector<TLocal> & T, int &nT,
108 int i, n = S->length();
114 typedef TLocal (*pfn) (const TCorba &T);
116 pfn convert = pfn(f);
117 for (i=0; i<nT; i++) {
119 T[i] = convert((*S)[i]);
126 template <typename TCorba,
130 inline void convertCorbaArray (std::vector<TLocal> & T,
134 int i, n = S->length();
140 typedef TLocal (*pfn) (const TCorba & , TInfo);
142 pfn convert = pfn(f);
143 for (i=0; i<nT; i++) {
145 T[i] = convert((*S)[i], M);