Skip to content

Commit a1c1601

Browse files
committed
Added isinstance() method
1 parent e27a5c7 commit a1c1601

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/exampleplugin.i

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,16 @@ public:
8080
%clear double& k;
8181

8282
/*
83-
* Add a function for casting a Force to an ExampleForce.
83+
* Add methods for casting a Force to an ExampleForce.
8484
*/
8585
%extend {
8686
static ExamplePlugin::ExampleForce& cast(OpenMM::Force& force) {
8787
return dynamic_cast<ExamplePlugin::ExampleForce&>(force);
8888
}
89+
90+
static bool isinstance(OpenMM::Force& force) {
91+
return (dynamic_cast<ExamplePlugin::ExampleForce*>(&force) != NULL);
92+
}
8993
}
9094
};
9195

0 commit comments

Comments
 (0)