SerializationProxyRegistration.cpp 10.7 KB
Newer Older
1
2
3
4
5
6
7
8
/* -------------------------------------------------------------------------- *
 *                                   OpenMM                                   *
 * -------------------------------------------------------------------------- *
 * This is part of the OpenMM molecular simulation toolkit originating from   *
 * Simbios, the NIH National Center for Physics-Based Simulation of           *
 * Biological Structures at Stanford, funded under the NIH Roadmap for        *
 * Medical Research, grant U54 GM072970. See https://simtk.org.               *
 *                                                                            *
9
 * Portions copyright (c) 2010-2021 Stanford University and the Authors.      *
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 * Authors: Peter Eastman                                                     *
 * Contributors:                                                              *
 *                                                                            *
 * Permission is hereby granted, free of charge, to any person obtaining a    *
 * copy of this software and associated documentation files (the "Software"), *
 * to deal in the Software without restriction, including without limitation  *
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,   *
 * and/or sell copies of the Software, and to permit persons to whom the      *
 * Software is furnished to do so, subject to the following conditions:       *
 *                                                                            *
 * The above copyright notice and this permission notice shall be included in *
 * all copies or substantial portions of the Software.                        *
 *                                                                            *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   *
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    *
 * THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,    *
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR      *
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE  *
 * USE OR OTHER DEALINGS IN THE SOFTWARE.                                     *
 * -------------------------------------------------------------------------- */

32
#include "openmm/AndersenThermostat.h"
33
#include "openmm/ATMForce.h"
34
#include "openmm/BrownianIntegrator.h"
35
36
#include "openmm/CMAPTorsionForce.h"
#include "openmm/CMMotionRemover.h"
37
#include "openmm/CompoundIntegrator.h"
38
39
#include "openmm/CustomAngleForce.h"
#include "openmm/CustomBondForce.h"
40
#include "openmm/CustomCentroidBondForce.h"
41
#include "openmm/CustomCompoundBondForce.h"
42
#include "openmm/CustomCVForce.h"
43
#include "openmm/CustomExternalForce.h"
44
45
#include "openmm/CustomGBForce.h"
#include "openmm/CustomHbondForce.h"
46
#include "openmm/CustomIntegrator.h"
47
#include "openmm/CustomManyParticleForce.h"
48
#include "openmm/CustomNonbondedForce.h"
49
#include "openmm/CustomTorsionForce.h"
50
#include "openmm/GayBerneForce.h"
51
#include "openmm/GBSAOBCForce.h"
52
#include "openmm/HarmonicAngleForce.h"
53
#include "openmm/HarmonicBondForce.h"
54
#include "openmm/LangevinIntegrator.h"
55
#include "openmm/LangevinMiddleIntegrator.h"
56
#include "openmm/MonteCarloAnisotropicBarostat.h"
57
#include "openmm/MonteCarloBarostat.h"
58
#include "openmm/MonteCarloFlexibleBarostat.h"
59
#include "openmm/MonteCarloMembraneBarostat.h"
60
#include "openmm/NonbondedForce.h"
61
#include "openmm/NoseHooverIntegrator.h"
62
63
#include "openmm/PeriodicTorsionForce.h"
#include "openmm/RBTorsionForce.h"
64
#include "openmm/RMSDForce.h"
65
#include "openmm/System.h"
66
#include "openmm/TabulatedFunction.h"
67
68
69
70
#include "openmm/VariableLangevinIntegrator.h"
#include "openmm/VariableVerletIntegrator.h"
#include "openmm/VerletIntegrator.h"

71
#include "openmm/serialization/SerializationProxy.h"
72
#include "openmm/serialization/BrownianIntegratorProxy.h"
73
#include "openmm/serialization/AndersenThermostatProxy.h"
74
#include "openmm/serialization/ATMForceProxy.h"
75
76
#include "openmm/serialization/CMAPTorsionForceProxy.h"
#include "openmm/serialization/CMMotionRemoverProxy.h"
77
#include "openmm/serialization/CompoundIntegratorProxy.h"
78
79
#include "openmm/serialization/CustomAngleForceProxy.h"
#include "openmm/serialization/CustomBondForceProxy.h"
80
#include "openmm/serialization/CustomCentroidBondForceProxy.h"
81
#include "openmm/serialization/CustomCompoundBondForceProxy.h"
82
#include "openmm/serialization/CustomCVForceProxy.h"
83
#include "openmm/serialization/CustomExternalForceProxy.h"
84
85
#include "openmm/serialization/CustomGBForceProxy.h"
#include "openmm/serialization/CustomHbondForceProxy.h"
86
#include "openmm/serialization/CustomIntegratorProxy.h"
87
#include "openmm/serialization/CustomManyParticleForceProxy.h"
88
#include "openmm/serialization/CustomNonbondedForceProxy.h"
89
#include "openmm/serialization/CustomTorsionForceProxy.h"
90
#include "openmm/serialization/GayBerneForceProxy.h"
91
#include "openmm/serialization/GBSAOBCForceProxy.h"
92
93
#include "openmm/serialization/HarmonicAngleForceProxy.h"
#include "openmm/serialization/HarmonicBondForceProxy.h"
94
#include "openmm/serialization/LangevinIntegratorProxy.h"
95
#include "openmm/serialization/LangevinMiddleIntegratorProxy.h"
96
#include "openmm/serialization/MonteCarloAnisotropicBarostatProxy.h"
97
#include "openmm/serialization/MonteCarloBarostatProxy.h"
98
#include "openmm/serialization/MonteCarloFlexibleBarostatProxy.h"
99
#include "openmm/serialization/MonteCarloMembraneBarostatProxy.h"
100
#include "openmm/serialization/NonbondedForceProxy.h"
101
#include "openmm/serialization/NoseHooverIntegratorProxy.h"
102
103
#include "openmm/serialization/PeriodicTorsionForceProxy.h"
#include "openmm/serialization/RBTorsionForceProxy.h"
104
#include "openmm/serialization/RMSDForceProxy.h"
105
#include "openmm/serialization/StateProxy.h"
106
107
#include "openmm/serialization/SystemProxy.h"
#include "openmm/serialization/TabulatedFunctionProxies.h"
108
109
110
#include "openmm/serialization/VariableLangevinIntegratorProxy.h"
#include "openmm/serialization/VariableVerletIntegratorProxy.h"
#include "openmm/serialization/VerletIntegratorProxy.h"
111
112
113

#if defined(WIN32)
    #include <windows.h>
114
    extern "C" void registerSerializationProxies();
115
116
117
118
119
120
121
122
123
124
125
126
    BOOL WINAPI DllMain(HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved) {
        if (ul_reason_for_call == DLL_PROCESS_ATTACH)
            registerSerializationProxies();
        return TRUE;
    }
#else
    extern "C" void __attribute__((constructor)) registerSerializationProxies();
#endif

using namespace OpenMM;

extern "C" void registerSerializationProxies() {
127
    SerializationProxy::registerProxy(typeid(AndersenThermostat), new AndersenThermostatProxy());
128
    SerializationProxy::registerProxy(typeid(ATMForce), new ATMForceProxy());
129
    SerializationProxy::registerProxy(typeid(BrownianIntegrator), new BrownianIntegratorProxy());
130
131
    SerializationProxy::registerProxy(typeid(CMAPTorsionForce), new CMAPTorsionForceProxy());
    SerializationProxy::registerProxy(typeid(CMMotionRemover), new CMMotionRemoverProxy());
132
    SerializationProxy::registerProxy(typeid(CompoundIntegrator), new CompoundIntegratorProxy());
133
134
135
    SerializationProxy::registerProxy(typeid(Continuous1DFunction), new Continuous1DFunctionProxy());
    SerializationProxy::registerProxy(typeid(Continuous2DFunction), new Continuous2DFunctionProxy());
    SerializationProxy::registerProxy(typeid(Continuous3DFunction), new Continuous3DFunctionProxy());
136
137
    SerializationProxy::registerProxy(typeid(CustomAngleForce), new CustomAngleForceProxy());
    SerializationProxy::registerProxy(typeid(CustomBondForce), new CustomBondForceProxy());
138
    SerializationProxy::registerProxy(typeid(CustomCentroidBondForce), new CustomCentroidBondForceProxy());
139
    SerializationProxy::registerProxy(typeid(CustomCompoundBondForce), new CustomCompoundBondForceProxy());
140
    SerializationProxy::registerProxy(typeid(CustomCVForce), new CustomCVForceProxy());
141
    SerializationProxy::registerProxy(typeid(CustomExternalForce), new CustomExternalForceProxy());
142
143
    SerializationProxy::registerProxy(typeid(CustomGBForce), new CustomGBForceProxy());
    SerializationProxy::registerProxy(typeid(CustomHbondForce), new CustomHbondForceProxy());
144
    SerializationProxy::registerProxy(typeid(CustomIntegrator), new CustomIntegratorProxy());
145
    SerializationProxy::registerProxy(typeid(CustomManyParticleForce), new CustomManyParticleForceProxy());
146
    SerializationProxy::registerProxy(typeid(CustomNonbondedForce), new CustomNonbondedForceProxy());
147
    SerializationProxy::registerProxy(typeid(CustomTorsionForce), new CustomTorsionForceProxy());
148
149
150
    SerializationProxy::registerProxy(typeid(Discrete1DFunction), new Discrete1DFunctionProxy());
    SerializationProxy::registerProxy(typeid(Discrete2DFunction), new Discrete2DFunctionProxy());
    SerializationProxy::registerProxy(typeid(Discrete3DFunction), new Discrete3DFunctionProxy());
151
    SerializationProxy::registerProxy(typeid(GayBerneForce), new GayBerneForceProxy());
152
    SerializationProxy::registerProxy(typeid(GBSAOBCForce), new GBSAOBCForceProxy());
153
154
    SerializationProxy::registerProxy(typeid(HarmonicAngleForce), new HarmonicAngleForceProxy());
    SerializationProxy::registerProxy(typeid(HarmonicBondForce), new HarmonicBondForceProxy());
155
    SerializationProxy::registerProxy(typeid(LangevinIntegrator), new LangevinIntegratorProxy());
156
    SerializationProxy::registerProxy(typeid(LangevinMiddleIntegrator), new LangevinMiddleIntegratorProxy());
157
    SerializationProxy::registerProxy(typeid(MonteCarloAnisotropicBarostat), new MonteCarloAnisotropicBarostatProxy());
158
    SerializationProxy::registerProxy(typeid(MonteCarloBarostat), new MonteCarloBarostatProxy());
159
    SerializationProxy::registerProxy(typeid(MonteCarloFlexibleBarostat), new MonteCarloFlexibleBarostatProxy());
160
    SerializationProxy::registerProxy(typeid(MonteCarloMembraneBarostat), new MonteCarloMembraneBarostatProxy());
161
    SerializationProxy::registerProxy(typeid(NonbondedForce), new NonbondedForceProxy());
162
    SerializationProxy::registerProxy(typeid(NoseHooverIntegrator), new NoseHooverIntegratorProxy());
163
164
    SerializationProxy::registerProxy(typeid(PeriodicTorsionForce), new PeriodicTorsionForceProxy());
    SerializationProxy::registerProxy(typeid(RBTorsionForce), new RBTorsionForceProxy());
165
    SerializationProxy::registerProxy(typeid(RMSDForce), new RMSDForceProxy());
166
    SerializationProxy::registerProxy(typeid(System), new SystemProxy());
167
    SerializationProxy::registerProxy(typeid(State), new StateProxy());
168
169
170
    SerializationProxy::registerProxy(typeid(VariableLangevinIntegrator), new VariableLangevinIntegratorProxy());
    SerializationProxy::registerProxy(typeid(VariableVerletIntegrator), new VariableVerletIntegratorProxy());
    SerializationProxy::registerProxy(typeid(VerletIntegrator), new VerletIntegratorProxy());
171
}