Psi4
class_macros.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _psi_src_lib_libpsi4util_class_macros_h_
30 #define _psi_src_lib_libpsi4util_class_macros_h_
31 
32 // This macro may be used in a class to declare
33 // a private variable with a set and get function
34 #define READ_WRITE_VAR(type,name) \
35 public: \
36 type get_name() const {return name;} \
37 void set_name(type _value_) {name = _value_;} \
38 private: \
39 type name;
40 
41 // This macro may be used in a class to declare
42 // a private variable with a get function
43 #define READ_VAR(type,name) \
44 public: \
45 type get_name() const {return name;} \
46 private: \
47 type name;
48 
49 #endif // _psi_src_lib_libpsi4util_class_macros_h_