f724ef1f20e21f3c6bdf52f37046390522cf5d3f
[alexxy/gromacs.git] / src / python / sip / trajectoryanalysis / modules.sip
1
2 template <T> class shared_ptr /NoDefaultCtors/ {
3 %TypeHeaderCode
4 #include <boost/shared_ptr.hpp>
5 using namespace boost;
6 %End
7 };
8
9 typedef shared_ptr<TrajectoryAnalysisModule> TrajectoryAnalysisModulePointer;
10
11 template <TYPE>
12 %MappedType py_shared_ptr<TYPE> /NoRelease/ {
13 %TypeHeaderCode
14 #include <boost/shared_ptr.hpp>
15 template <typename T> using py_shared_ptr = boost::shared_ptr<T>;
16 %End
17
18 %ConvertFromTypeCode
19     PyObject *wrp = sipConvertFromType(sipCpp->get(), sipType_TYPE, NULL);
20     PyObject *ptr = sipConvertFromNewType(sipCpp, sipType_TYPEPointer, wrp);
21
22     return wrp;
23 %End
24
25 %ConvertToTypeCode
26     // Make it impossible to convert into this type
27     if (!sipIsErr)
28         return 0;
29
30     GMX_ASSERT(true, "Converting something into shared_ptr. This should not happen!");
31     return 0;
32 %End
33 };
34
35 class AngleInfo {
36 %TypeHeaderCode
37 #include "gromacs/trajectoryanalysis/modules/angle.h"
38 using namespace gmx::analysismodules;
39 %End
40 private:
41 public:
42     static const char* name /NoSetter/;
43     static const char* shortDescription /NoSetter/;
44     static py_shared_ptr<TrajectoryAnalysisModule> create() /Factory/;
45 };
46
47 class DistanceInfo {
48 %TypeHeaderCode
49 #include "gromacs/trajectoryanalysis/modules/distance.h"
50 using namespace gmx::analysismodules;
51 %End
52 private:
53 public:
54     static const char* name /NoSetter/;
55     static const char* shortDescription /NoSetter/;
56     static py_shared_ptr<TrajectoryAnalysisModule> create() /Factory/;
57 };
58
59 class FreeVolumeInfo {
60 %TypeHeaderCode
61 #include "gromacs/trajectoryanalysis/modules/freevolume.h"
62 using namespace gmx::analysismodules;
63 %End
64 private:
65 public:
66     static const char* name /NoSetter/;
67     static const char* shortDescription /NoSetter/;
68     static py_shared_ptr<TrajectoryAnalysisModule> create() /Factory/;
69 };
70
71 class PairDistanceInfo {
72 %TypeHeaderCode
73 #include "gromacs/trajectoryanalysis/modules/pairdist.h"
74 using namespace gmx::analysismodules;
75 %End
76 private:
77 public:
78     static const char* name /NoSetter/;
79     static const char* shortDescription /NoSetter/;
80     static py_shared_ptr<TrajectoryAnalysisModule> create() /Factory/;
81 };
82
83 class RdfInfo {
84 %TypeHeaderCode
85 #include "gromacs/trajectoryanalysis/modules/rdf.h"
86 using namespace gmx::analysismodules;
87 %End
88 private:
89 public:
90     static const char* name /NoSetter/;
91     static const char* shortDescription /NoSetter/;
92     static py_shared_ptr<TrajectoryAnalysisModule> create() /Factory/;
93 };
94
95 class SasaInfo {
96 %TypeHeaderCode
97 #include "gromacs/trajectoryanalysis/modules/sasa.h"
98 using namespace gmx::analysismodules;
99 %End
100 private:
101 public:
102     static const char* name /NoSetter/;
103     static const char* shortDescription /NoSetter/;
104     static py_shared_ptr<TrajectoryAnalysisModule> create() /Factory/;
105 };
106
107 class SelectInfo {
108 %TypeHeaderCode
109 #include "gromacs/trajectoryanalysis/modules/select.h"
110 using namespace gmx::analysismodules;
111 %End
112 private:
113 public:
114     static const char* name /NoSetter/;
115     static const char* shortDescription /NoSetter/;
116     static py_shared_ptr<TrajectoryAnalysisModule> create() /Factory/;
117 };