XdmfCore.i 20.2 KB
Newer Older
1
2
3
4
5
/*
XdmfCorePython.cpp:
swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
*/

6

7
8
%module XdmfCore
%{
9
    #include <XdmfArray.hpp>
10
    #include <XdmfArrayReference.hpp>
11
12
13
14
    #include <XdmfArrayType.hpp>
    #include <XdmfCore.hpp>
    #include <XdmfCoreItemFactory.hpp>
    #include <XdmfCoreReader.hpp>
15
    #include <XdmfError.hpp>
16
    #include <XdmfFunction.hpp>
17
18
19
20
21
22
23
    #include <XdmfHeavyDataController.hpp>
    #include <XdmfHeavyDataWriter.hpp>
    #include <XdmfHDF5Controller.hpp>
    #include <XdmfHDF5Writer.hpp>
    #include <XdmfInformation.hpp>
    #include <XdmfItem.hpp>
    #include <XdmfItemProperty.hpp>
24
    #include <XdmfSharedPtr.hpp>
25
    #include <XdmfSparseMatrix.hpp>
Andrew J. Burns (Cont's avatar
Andrew J. Burns (Cont committed
26
    #include <XdmfSubset.hpp>
27
28
29
30
    #include <XdmfSystemUtils.hpp>
    #include <XdmfVersion.hpp>
    #include <XdmfVisitor.hpp>
    #include <XdmfWriter.hpp>
31
32

    #include <ProjectVersion.hpp>
33
34
%}

35
#ifdef SWIGJAVA
36

37
// Ignore const overloaded methods
38
%ignore XdmfArray::getHeavyDataController() const;
39
40
41
%ignore XdmfArray::getValuesInternal() const;
%ignore XdmfItem::getInformation(const unsigned int) const;
%ignore XdmfItem::getInformation(const std::string &) const;
42
%ignore XdmfWriter::getHeavyDataWriter() const;
43
44
%ignore XdmfInformation::getArray(unsigned int const) const;
%ignore XdmfInformation::getArray(std::string const &) const;
45

46
47
48
// Ignore ItemTags
%ignore XdmfArray::ItemTag;
%ignore XdmfInformation::ItemTag;
49

50
// Define equality operators
51
%extend XdmfItem {
52

53
54
55
56
57
58
59
60
61
62
63
64
65
    bool equals(boost::shared_ptr<XdmfItem> item) {
        if (item == NULL) {
            return false;
        }
        return self == item.get();
    }

    bool IsEqual(boost::shared_ptr<XdmfItem> item) {
        if (item == NULL) {
            return false;
        }
        return self == item.get();
    }
66
};
67

68
%extend XdmfItemProperty {
69

70
71
72
73
74
75
76
77
78
79
80
81
82
    bool equals(boost::shared_ptr<XdmfItemProperty> itemProperty) {
        if (itemProperty == NULL) {
            return false;
        }
        return self == itemProperty.get();
    }

    bool IsEqual(boost::shared_ptr<XdmfItemProperty> itemProperty) {
        if (itemProperty == NULL) {
            return false;
        }
        return self == itemProperty.get();
    }
83
84
85

};

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
%typemap(javacode) XdmfArray %{
    public void insertValuesAsInt8(int index, char[] values) {
        for(int i = 0; i < values.length; i++)
            this.insertValueAsInt8(index+i, values[i]);
    }

    public void insertValuesAsInt16(int index, short[] values) {
        for(int i = 0; i < values.length; i++)
            this.insertValueAsInt16(index+i, values[i]);
    }

    public void insertValuesAsInt32(int index, int[] values) {
        for(int i = 0; i < values.length; i++)
            this.insertValueAsInt32(index+i, values[i]);
    }

    public void insertValuesAsFloat32(int index, float[] values) {
        for(int i = 0; i < values.length; i++)
            this.insertValueAsFloat32(index+i, values[i]);
    }

    public void insertValuesAsFloat64(int index, double[] values) {
        for(int i = 0; i < values.length; i++)
            this.insertValueAsFloat64(index+i, values[i]);
    }
%}

113
%pragma(java) jniclasscode=%{
114
115
116
117
118
    static {
        try {
            System.loadLibrary("XdmfCoreJava");
        }
        catch (UnsatisfiedLinkError e) {
119
120
            System.err.println("Native code library failed to load for" +
                               "XdmfCoreJava\n" + e);
121
122
123
            System.exit(1);
        }
    }
124
125
126
%}

#endif /* SWIGJAVA */
127

128
129
#ifdef SWIGPYTHON

Andrew J. Burns (Cont's avatar
Andrew J. Burns (Cont committed
130
/*This converts XdmfErrors to Python RuntimeErrors*/
131
132
133
134
135
136
137
138
139
140
141
142
143
%exception
{
        try
        {
                $action
        }
        catch (XdmfError e)
        {
                PyErr_SetString(PyExc_RuntimeError, e.what());
                return NULL;
        }
}

144
145
146
/*This causes it to avoid throwing a warning about overloaded functions.
  We are doing this intentionally so suppressing the warning makes sense.*/
#pragma SWIG nowarn=509
147

148
// Provide accessors from python lists to XdmfArrays
149
%extend XdmfArray {
150
151
152
153
154
155
156
157
158
159
160

    PyObject * getBuffer() {
        void *vp = $self->getValuesInternal();
        Py_ssize_t sz =
            $self->getSize() * $self->getArrayType()->getElementSize();
        PyObject * c = PyBuffer_FromMemory(vp, sz);
        return(c);
    }

    %pythoncode {
        def getNumpyArray(self):
161
            h5ctl = self.getHeavyDataController()
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
            if h5ctl == None :
                try :
                    from numpy import frombuffer as ___frombuffer
                except :
                    return None
                buf = self.getBuffer()
                aType = self.getArrayType()
                if aType == XdmfArrayType.Int8() :
                    return(___frombuffer(buf, 'int8'))
                if aType == XdmfArrayType.Int16() :
                    return(___frombuffer(buf, 'int16'))
                if aType == XdmfArrayType.Int32() :
                    return(___frombuffer(buf, 'int32'))
                if aType == XdmfArrayType.Int64() :
                    return(___frombuffer(buf, 'int64'))
                if aType == XdmfArrayType.Float32() :
                    return(___frombuffer(buf, 'float32'))
                if aType == XdmfArrayType.Float64() :
                    return(___frombuffer(buf, 'float64'))
                if aType == XdmfArrayType.UInt8() :
                    return(___frombuffer(buf, 'uint8'))
                if aType == XdmfArrayType.UInt16() :
                    return(___frombuffer(buf, 'uint16'))
                if aType == XdmfArrayType.UInt32() :
                    return(___frombuffer(buf, 'uint32'))
                return None
            else :
                h5FileName = h5ctl.getFilePath()
                h5DataSetName = h5ctl.getDataSetPath()
                if (h5FileName == None) | (h5DataSetName == None) :
                    return None
                try :
                    from h5py import File as ___File
                    from numpy import array as ___array
                    f = ___File(h5FileName, 'r')
                    if h5DataSetName in f.keys() :
                        return(___array(f[h5DataSetName]))
                except :
                    pass
                return None
    };

204
205
206
207
208
    void insertAsInt8(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, (char)(PyLong_AsLong(PyList_GetItem(list, i))));
        }
209
210
    }

211
212
213
214
215
    void insertAsInt16(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, (short)(PyLong_AsLong(PyList_GetItem(list, i))));
        }
216
217
    }

218
219
220
221
222
    void insertAsInt32(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, (int)(PyLong_AsLong(PyList_GetItem(list, i))));
        }
223
224
    }

225
226
227
228
229
    void insertAsInt64(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, PyLong_AsLong(PyList_GetItem(list, i)));
        }
230
231
    }

232
233
234
235
236
    void insertAsFloat32(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, (float)PyFloat_AsDouble(PyList_GetItem(list, i)));
        }
237
238
    }

239
240
241
242
243
    void insertAsFloat64(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, PyFloat_AsDouble(PyList_GetItem(list, i)));
        }
244
245
    }

246
247
248
249
250
    void insertAsUInt8(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, (unsigned char)(PyLong_AsUnsignedLong(PyList_GetItem(list, i))));
        }
251
252
    }

253
254
255
256
257
    void insertAsUInt16(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, (unsigned short)(PyLong_AsUnsignedLong(PyList_GetItem(list, i))));
        }
258
259
    }

260
261
262
263
264
    void insertAsUInt32(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert(i+startIndex, (unsigned int)(PyLong_AsUnsignedLong(PyList_GetItem(list, i))));
        }
265
    }
266

Kenneth Leiter's avatar
Kenneth Leiter committed
267
268
269
270
271
272
273
    void insertAsString(int startIndex, PyObject * list) {
        Py_ssize_t size = PyList_Size(list);
        for(Py_ssize_t i = 0; i < size; ++i) {
            $self->insert<std::string>(i+startIndex, PyString_AsString(PyList_GetItem(list, i)));
        }
    }

274
275
276
277
278
279
280
281
282
    static shared_ptr<XdmfArray> XdmfArrayPtr(PyObject * obj)
    {
      void * resultPointer = 0;
      swig_type_info * returnType = SWIG_TypeQuery("_p_boost__shared_ptrT_XdmfArray_t");
      SWIG_ConvertPtr(obj, &resultPointer, returnType, 0);
      shared_ptr<XdmfArray> * returnArrayPointer = reinterpret_cast<shared_ptr<XdmfArray> *>(resultPointer);
      shared_ptr<XdmfArray> returnArray = returnArrayPointer[0];
      return returnArray;
    }
283
284
};

285
286
287
%extend XdmfArrayType {
    bool __eq__(const XdmfArrayType * arrayType) {
   	return $self == arrayType;
288
    }
289
290
};

291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
%extend XdmfHeavyDataController {
    static shared_ptr<XdmfHDF5Controller> XdmfHDF5ControllerCast(PyObject * obj)
    {
      void * resultPointer = 0;
      swig_type_info * returnType = SWIG_TypeQuery("_p_boost__shared_ptrT_XdmfHeavyDataController_t");
      SWIG_ConvertPtr(obj, &resultPointer, returnType, 0);
      shared_ptr<XdmfHeavyDataController> * returnControllerPointer =
        reinterpret_cast<shared_ptr<XdmfHeavyDataController> *>(resultPointer);
      shared_ptr<XdmfHeavyDataController> returnController = returnControllerPointer[0];
      if (shared_ptr<XdmfHDF5Controller> returnHDF5Controller = shared_dynamic_cast<XdmfHDF5Controller>(returnController)) {
        return returnHDF5Controller;
      }
      else {
        XdmfError::message(XdmfError::FATAL, "Error: Attempting to cast a non HDF5 Controller to HDF5");
        return shared_ptr<XdmfHDF5Controller>();
      }
    }
};

310
311
312
/*This causes it to avoid throwing a warning for redefining fuctions that are defined for XdmfArray.
  I do this because doing so was intentional.*/
#pragma SWIG nowarn=302
313
/*Warning 325 is due to having nested classes in XdmfFunction that are not accessible when wrapped.
314
315
316
317
318
319
320
321
322
  As of right now, this is acceptable behavior. So, the warning is suppressed*/
#pragma SWIG nowarn=325

%extend XdmfFunction {

%{
    /*trying to transfer python functions*/
    /*note, accessing private members is impossible from swig.*/

Andrew J. Burns (Cont's avatar
Andrew J. Burns (Cont committed
323

324
325
326
    /*Class to wrap python functions to be compatible with the XdmfFunction code.
      This version has an execute that takes a vector of XdmfArrays as parameters,
      so it is used for functions.*/
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
    class PythonFunction : public XdmfFunction::XdmfFunctionInternal {
      public:
        static shared_ptr<PythonFunction>
        New(PyObject * functionref)
        {
          shared_ptr<PythonFunction> p (new PythonFunction(functionref));
          return p;
        }

        ~PythonFunction()
        {
        }

        virtual shared_ptr<XdmfArray> execute(std::vector<shared_ptr<XdmfArray> > valueVector)
        {
          swig_type_info * paramType = SWIG_TypeQuery("_p_std__vectorT_boost__shared_ptrT_XdmfArray_t_std__allocatorT_boost__shared_ptrT_XdmfArray_t_t_t");
          PyObject * pyVector = SWIG_NewPointerObj(static_cast<void*>(& valueVector), paramType, SWIG_POINTER_NEW);
          PyObject * args = PyTuple_New(1);
345
346
          /* In this case you could also cast a pointer to the vector
             into the PyObject * type, but that doesn't work for all types*/
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
          PyTuple_SetItem(args, 0, pyVector);
          PyObject * resultObject = PyObject_CallObject(mInternalFunction, args);
          void * resultPointer = 0;
          swig_type_info * returnType = SWIG_TypeQuery("_p_boost__shared_ptrT_XdmfArray_t");
          SWIG_ConvertPtr(resultObject, &resultPointer, returnType, 0);
          shared_ptr<XdmfArray> * returnArrayPointer = reinterpret_cast<shared_ptr<XdmfArray> *>(resultPointer);
          shared_ptr<XdmfArray> returnArray = returnArrayPointer[0];
          return returnArray;
        }
      private:
        PythonFunction(PyObject * functionref)
        {
          if (PyCallable_Check(functionref) == 1) {
            mInternalFunction = functionref;
          }
          else {
            XdmfError::message(XdmfError::FATAL,
                               "Error: Function is not callable");
          }
        }

        PyObject * mInternalFunction;
    };

371
372
373
    /*Class to wrap python functions to be compatible with the XdmfFunction Operation code.
      This version has an execute that takes two XdmfArrays as parameters,
      so it is used for binary operators.*/
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
    class PythonOperation : public XdmfFunction::XdmfOperationInternal {
      public:
        static shared_ptr<PythonOperation>
        New(PyObject * operationref)
        {
          shared_ptr<PythonOperation> p (new PythonOperation(operationref));
          return p;
        }

        ~PythonOperation()
        {
        }

        virtual shared_ptr<XdmfArray> execute(shared_ptr<XdmfArray> val1, shared_ptr<XdmfArray> val2)
        {
          swig_type_info * paramType = SWIG_TypeQuery("_p_boost__shared_ptrT_XdmfArray_t");
          PyObject * pyVal1 = SWIG_NewPointerObj(static_cast<void*>(& val1), paramType, SWIG_POINTER_NEW);
          PyObject * pyVal2 = SWIG_NewPointerObj(static_cast<void*>(& val2), paramType, SWIG_POINTER_NEW);
          PyObject * args = PyTuple_New(2);
          PyTuple_SetItem(args, 0, pyVal1);
          PyTuple_SetItem(args, 1, pyVal2);
          PyObject * resultObject = PyObject_CallObject(mInternalOperation, args);
          void * resultPointer = 0;
          swig_type_info * returnType = SWIG_TypeQuery("_p_boost__shared_ptrT_XdmfArray_t");
          SWIG_ConvertPtr(resultObject, &resultPointer, returnType, 0);
          shared_ptr<XdmfArray> * returnArrayPointer = reinterpret_cast<shared_ptr<XdmfArray> *>(resultPointer);
          shared_ptr<XdmfArray> returnArray = returnArrayPointer[0];
          return returnArray;
        }
      private:
        PythonOperation(PyObject * operationref)
        {
          if (PyCallable_Check(operationref) == 1) {
            mInternalOperation = operationref;
          }
          else {
            XdmfError::message(XdmfError::FATAL,
                               "Error: Operation is not callable");
          }
        }

        PyObject * mInternalOperation;
    };
%}

    static int addFunction(std::string newName, PyObject * functionref)
    {
      shared_ptr<PythonFunction> newFunction = PythonFunction::New(functionref);
      return XdmfFunction::addFunction(newName, newFunction);
    }

    static int addOperation(char newName, PyObject * calcref, int priority)
    {
      shared_ptr<PythonOperation> newOperation = PythonOperation::New(calcref);
      return XdmfFunction::addOperation(newName, newOperation, priority);
    }
};

432
433
#endif /* SWIGPYTHON */

434
%include boost_shared_ptr.i
435
436
437
438
439
440
441

%inline
%{
    #include <boost/shared_ptr.hpp>
    using namespace boost;
%}

442
443
%include std_string.i
%include std_vector.i
444
%include std_map.i
445

446
%shared_ptr(Loki::BaseVisitor)
447
448
449
450
%shared_ptr(Loki::BaseVisitable<void>)
%shared_ptr(Loki::Visitor<XdmfItem>)
%shared_ptr(Loki::Visitor<XdmfArray>)

451
%include loki/Visitor.h
452

453
454
// Shared Pointer Templates
%shared_ptr(XdmfArray)
455
%shared_ptr(XdmfArrayReference)
456
457
458
%shared_ptr(XdmfArrayType)
%shared_ptr(XdmfCoreItemFactory)
%shared_ptr(XdmfCoreReader)
459
%shared_ptr(XdmfFunction)
460
461
%shared_ptr(XdmfHDF5Controller)
%shared_ptr(XdmfHDF5Writer)
462
463
%shared_ptr(XdmfHeavyDataController)
%shared_ptr(XdmfHeavyDataWriter)
464
465
466
%shared_ptr(XdmfInformation)
%shared_ptr(XdmfItem)
%shared_ptr(XdmfItemProperty)
467
%shared_ptr(XdmfSparseMatrix)
Andrew J. Burns (Cont's avatar
Andrew J. Burns (Cont committed
468
%shared_ptr(XdmfSubset)
469
470
%shared_ptr(XdmfVisitor)
%shared_ptr(XdmfWriter)
471

472
473
%shared_ptr(std::vector<int>)

474
// Abstract Base Classes
475
%template(BaseVisitable) Loki::BaseVisitable<void>;
476
477
%template() Loki::Visitor<XdmfArray>;
%template() Loki::Visitor<XdmfItem>;
478

479
%include XdmfCore.hpp
480
%include XdmfError.hpp
481
482
%include XdmfItem.hpp
%include XdmfItemProperty.hpp
483
%include XdmfSparseMatrix.hpp
484
%include XdmfSystemUtils.hpp
485
%include XdmfVisitor.hpp
486
%include XdmfArrayReference.hpp
487
%include XdmfFunction.hpp
488
489
%include XdmfHeavyDataController.hpp
%include XdmfHeavyDataWriter.hpp
Andrew J. Burns (Cont's avatar
Andrew J. Burns (Cont committed
490
%include XdmfSubset.hpp
491

492
493
494
495
496
497
498
%include XdmfCoreItemFactory.hpp
%include XdmfCoreReader.hpp
%include XdmfInformation.hpp
%include XdmfHDF5Controller.hpp
%include XdmfHDF5Writer.hpp
%include XdmfWriter.hpp

499
500
501
%include CMake/VersionSuite/ProjectVersion.hpp
%include XdmfVersion.hpp

502
503
504
%include XdmfArray.hpp
%include XdmfArrayType.hpp

505
506
507
508
509
510
511
512
#ifdef SWIGPYTHON

%pythoncode {
    XdmfVersion = _XdmfCore.cvar.XdmfVersion
};

#endif /* SWIGPYTHON */

513
514
515
516
517
518
519
520
521
%template(getValueAsInt8) XdmfArray::getValue<char>;
%template(getValueAsInt16) XdmfArray::getValue<short>;
%template(getValueAsInt32) XdmfArray::getValue<int>;
%template(getValueAsInt64) XdmfArray::getValue<long>;
%template(getValueAsFloat32) XdmfArray::getValue<float>;
%template(getValueAsFloat64) XdmfArray::getValue<double>;
%template(getValueAsUInt8) XdmfArray::getValue<unsigned char>;
%template(getValueAsUInt16) XdmfArray::getValue<unsigned short>;
%template(getValueAsUInt32) XdmfArray::getValue<unsigned int>;
Kenneth Leiter's avatar
Kenneth Leiter committed
522
%template(getValueAsString) XdmfArray::getValue<std::string>;
523
524
525
526
527
528
529
530
531
532

%template(initializeAsInt8) XdmfArray::initialize<char>;
%template(initializeAsInt16) XdmfArray::initialize<short>;
%template(initializeAsInt32) XdmfArray::initialize<int>;
%template(initializeAsInt64) XdmfArray::initialize<long>;
%template(initializeAsFloat32) XdmfArray::initialize<float>;
%template(initializeAsFloat64) XdmfArray::initialize<double>;
%template(initializeAsUInt8) XdmfArray::initialize<unsigned char>;
%template(initializeAsUInt16) XdmfArray::initialize<unsigned short>;
%template(initializeAsUInt32) XdmfArray::initialize<unsigned int>;
Kenneth Leiter's avatar
Kenneth Leiter committed
533
%template(initializeAsString) XdmfArray::initialize<std::string>;
534

535
536
537
538
539
540
541
542
543
%template(insertValueAsInt8) XdmfArray::insert<char>;
%template(insertValueAsInt16) XdmfArray::insert<short>;
%template(insertValueAsInt32) XdmfArray::insert<int>;
%template(insertValueAsInt64) XdmfArray::insert<long>;
%template(insertValueAsFloat32) XdmfArray::insert<float>;
%template(insertValueAsFloat64) XdmfArray::insert<double>;
%template(insertValueAsUInt8) XdmfArray::insert<unsigned char>;
%template(insertValueAsUInt16) XdmfArray::insert<unsigned short>;
%template(insertValueAsUInt32) XdmfArray::insert<unsigned int>;
Kenneth Leiter's avatar
Kenneth Leiter committed
544
%template(insertValueAsString) XdmfArray::insert<std::string>;
545

546
547
548
549
550
551
552
553
554
%template(pushBackAsInt8) XdmfArray::pushBack<char>;
%template(pushBackAsInt16) XdmfArray::pushBack<short>;
%template(pushBackAsInt32) XdmfArray::pushBack<int>;
%template(pushBackAsInt64) XdmfArray::pushBack<long>;
%template(pushBackAsFloat32) XdmfArray::pushBack<float>;
%template(pushBackAsFloat64) XdmfArray::pushBack<double>;
%template(pushBackAsUInt8) XdmfArray::pushBack<unsigned char>;
%template(pushBackAsUInt16) XdmfArray::pushBack<unsigned short>;
%template(pushBackAsUInt32) XdmfArray::pushBack<unsigned int>;
Kenneth Leiter's avatar
Kenneth Leiter committed
555
%template(pushBackAsString) XdmfArray::pushBack<std::string>;
556
557
558
559
560
561
562
563
564
565

%template(resizeAsInt8) XdmfArray::resize<char>;
%template(resizeAsInt16) XdmfArray::resize<short>;
%template(resizeAsInt32) XdmfArray::resize<int>;
%template(resizeAsInt64) XdmfArray::resize<long>;
%template(resizeAsFloat32) XdmfArray::resize<float>;
%template(resizeAsFloat64) XdmfArray::resize<double>;
%template(resizeAsUInt8) XdmfArray::resize<unsigned char>;
%template(resizeAsUInt16) XdmfArray::resize<unsigned short>;
%template(resizeAsUInt32) XdmfArray::resize<unsigned int>;
Kenneth Leiter's avatar
Kenneth Leiter committed
566
%template(resizeAsString) XdmfArray::resize<std::string>;
567

568
569
570
571
572
573
574
575
576
%template(UInt8Vector) std::vector<unsigned char>;
%template(UInt16Vector) std::vector<unsigned short>;
%template(UInt32Vector) std::vector<unsigned int>;
%template(Int8Vector) std::vector<char>;
%template(Int16Vector) std::vector<short>;
%template(Int32Vector) std::vector<int>;
%template(Int64Vector) std::vector<long>;
%template(Float32Vector) std::vector<float>;
%template(Float64Vector) std::vector<double>;
577
%template(StringVector) std::vector<std::string>;
578
%template(ItemVector) std::vector<boost::shared_ptr<XdmfItem> >;
579
%template(ArrayMap) std::map<std::string, boost::shared_ptr<XdmfArray> >;
580
%template(StringMap) std::map<std::string, std::string>;