OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
chain_base.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_CHAIN_BASE_HH
20 #define OST_CHAIN_BASE_HH
21 
22 #include <ost/mol/module_config.hh>
24 
25 #include <ost/mol/chain_type.hh>
26 #include <ost/generic_property.hh>
27 
28 namespace ost { namespace mol {
29 
40  public GenericPropContainer<ChainBase> {
41 
42 public: // constructors
43  ChainBase();
44  ChainBase(const impl::ChainImplPtr& impl);
45 public:
46 
48 
49  operator bool() const { return this->IsValid(); }
58  bool IsValid() const;
61  String GetName() const;
62 
66  ChainType GetType() const;
67 
71  String GetDescription() const;
72 
73  const impl::ChainImplPtr& Impl() const {
74  return impl_;
75  }
76 
81  bool IsPolymer() const;
82 
84  bool IsPolysaccharide() const;
85 
87  bool IsOligosaccharide() const;
88 
90  bool IsPolypeptide() const;
91 
93  bool IsPolynucleotide() const;
94 
96  return impl_;
97  }
98 protected:
99  GenericPropContainerImpl* GpImpl();
100 
101  const GenericPropContainerImpl* GpImpl() const;
102 
103  void CheckValidity() const;
104 private:
105  impl::ChainImplPtr impl_;
106 };
107 
108 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
109  const ChainBase& chain);
110 }} // ns
111 
112 #endif // OST_CHAIN_BASE_HH
113 
std::string String
Definition: base.hh:54
base class for ChainHandle and ChainView
Definition: chain_base.hh:39
boost::shared_ptr< ChainImpl > ChainImplPtr
DLLEXPORT_OST_MOL std::ostream & operator<<(std::ostream &os, const AtomBase &atom)
#define DLLEXPORT_OST_MOL
impl::ChainImplPtr & Impl()
Definition: chain_base.hh:95
base class for the implementation
const impl::ChainImplPtr & Impl() const
Definition: chain_base.hh:73
base class for the handler classes