1 // -*- C++ -*-
2 //
3 // KimTemplates.h: Redefinition of Asap templates for OpenKIM use.
4 //
5 // Copyright (C) 2012-2013 Jakob Schiotz and the Department of Physics,
6 // Technical University of Denmark.  Email: schiotz@fysik.dtu.dk
7 //
8 // This file is part of Asap version 3.
9 // Asap is released under the GNU Lesser Public License (LGPL) version 3.
10 // However, the parts of Asap distributed within the OpenKIM project
11 // (including this file) are also released under the Common Development
12 // and Distribution License (CDDL) version 1.0.
13 //
14 // This program is free software: you can redistribute it and/or
15 // modify it under the terms of the GNU Lesser General Public License
16 // version 3 as published by the Free Software Foundation.  Permission
17 // to use other versions of the GNU Lesser General Public License may
18 // granted by Jakob Schiotz or the head of department of the
19 // Department of Physics, Technical University of Denmark, as
20 // described in section 14 of the GNU General Public License.
21 //
22 // This program is distributed in the hope that it will be useful,
23 // but WITHOUT ANY WARRANTY; without even the implied warranty of
24 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25 // GNU General Public License for more details.
26 //
27 // You should have received a copy of the GNU General Public License
28 // and the GNU Lesser Public License along with this program.  If not,
29 // see <http://www.gnu.org/licenses/>.
30 
31 
32 #ifndef KIMTEMPLATES_H
33 #define KIMTEMPLATES_H
34 
35 #include "AsapNamespace.h"
36 #include <stdlib.h>
37 
38 namespace ASAPSPACE {
39 
40 template<class T>
PyAsap_Dealloc(PyObject * self)41 static void PyAsap_Dealloc(PyObject *self)
42 {
43   if ( ((T*)self)->cobj != NULL )
44     delete ((T*)self)->cobj;
45   free(self);
46 }
47 
48 } // end namespace
49 
50 #endif // not KIMTEMPLATES_H
51