OpenStructure
Loading...
Searching...
No Matches
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-2020 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>
31
32namespace ost { namespace mol {
33
34
36public:
45 EntityPropertyMapper(const String& prop_name,
46 Prop::Level level=Prop::UNSPECIFIED);
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
119private:
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
Handle to atom datatype.
definition of AtomView
Definition atom_view.hh:34
linear chain of residues
definition of ChainView
Definition chain_view.hh:37
Real Get(const ChainHandle &atom, Real default_value) const
get float property, returning default if the property does not exist
Real Get(const ResidueView &atom, Real default_value) const
get float property, returning default if the property does not exist
Real Get(const ResidueHandle &atom) const
get float property throwing an exception when the value does not exist
EntityPropertyMapper(const String &prop_name, Prop::Level level=Prop::UNSPECIFIED)
construct new property mapper for the property of the given name
Real Get(const ChainHandle &atom) const
get float property throwing an exception when the value does not exist
Real Get(const ResidueHandle &atom, Real default_value) const
get float property, returning default if the property does not exist
Real Get(const AtomView &atom, Real default_value) const
get float property, returning default if the property does not exist
Real Get(const ChainView &atom, Real default_value) const
get float property, returning default if the property does not exist
Real Get(const ChainView &atom) const
get float property throwing an exception when the value does not exist
Real Get(const AtomView &atom) const
get float property throwing an exception when the value does not exist
Real Get(const AtomHandle &atom, Real default_value) const
get float property, returning default if the property does not exist
Real Get(const ResidueView &atom) const
get float property throwing an exception when the value does not exist
Real Get(const AtomHandle &atom) const
get float property throwing an exception when the value does not exist
float Real
Definition base.hh:44
std::string String
Definition base.hh:54
#define DLLEXPORT_OST_MOL
Definition base.dox:1