OpenStructure
entity_property_mapper.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_ENTITY_PROPERTY_MAPPER_HH
20 #define OST_ENTITY_PROPERTY_MAPPER_HH
21 
22 /*
23  work in progress
24 
25  Author: Ansgar Philippsen, Marco Biasini
26 */
27 
28 #include <vector>
29 #include <ost/mol/mol.hh>
30 #include <ost/mol/module_config.hh>
31 
32 namespace ost { namespace mol {
33 
34 
36 public:
45  EntityPropertyMapper(const String& prop_name,
52  Real Get(const AtomHandle& atom) const;
55  Real Get(const AtomHandle& atom, Real default_value) const;
56 
62  Real Get(const AtomView& atom) const;
65  Real Get(const AtomView& atom, Real default_value) const;
66 
67 
73  Real Get(const ResidueHandle& atom) const;
76  Real Get(const ResidueHandle& atom, Real default_value) const;
77 
83  Real Get(const ResidueView& atom) const;
86  Real Get(const ResidueView& atom, Real default_value) const;
87 
88 
89 
90 
91 
92 
93 
99  Real Get(const ChainHandle& atom) const;
102  Real Get(const ChainHandle& atom, Real default_value) const;
103 
109  Real Get(const ChainView& atom) const;
112  Real Get(const ChainView& atom, Real default_value) const;
113 
114 
115 
116 
117 
118 
119 private:
120  template <typename T, bool B>
121  Real get_property(const T& atom, Real default_value) const;
122  Prop prop_;
123  String prop_name_;
124 };
125 
126 }} // ns
127 
128 #endif