/[escript]/branches/subworld2/escriptcore/src/Dodgy.h
ViewVC logotype

Contents of /branches/subworld2/escriptcore/src/Dodgy.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5504 - (show annotations)
Wed Mar 4 22:58:13 2015 UTC (4 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 1678 byte(s)
Again with a more up to date copy


1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2009-2015 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 #ifndef ES_DODGY_H
18 #define ES_DODGY_H
19
20 // This file contains functions which do bad things like violate the C standard
21 // Functions in here should not go into general use and should only be used on
22 // systems where the users are willing to accept responsibility for things working.
23
24 // Do not add functions here without explaining why they are problematic
25
26 namespace escript
27 {
28 // first param is output, next two are input data1 and2 the 3 ints are the size [in doubles]
29 // of the first three params in order
30 typedef int (*binOpFnPtr)(double*, const double*, const double*, int, int, int);
31
32 /**
33 ** Casts a void* to a function pointer taking 3 double* and 3 int
34 ** \warning The C standard does not guarantee that void* and function pointer
35 ** are the same size.
36 **
37 ** Why do we have this? To allow us to pass function pointers between modules via python.
38 ** To do this without using a custom object we use void*
39 */
40 binOpFnPtr binOpFnPtrFromVoidPtr(void* v);
41
42 /**
43 Why do we have this? Only to act as an inverse to the above function
44 */
45 void* voidPtrFromBinOpFnPtr(binOpFnPtr f);
46
47 }
48
49 #endif

  ViewVC Help
Powered by ViewVC 1.1.26