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-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_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 { return Impl().get()!=0; }
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 IsPolypeptide() const;
88 
90  bool IsPolynucleotide() const;
91 
93  return impl_;
94  }
95 protected:
96  GenericPropContainerImpl* GpImpl();
97 
98  const GenericPropContainerImpl* GpImpl() const;
99 
100  void CheckValidity() const;
101 private:
102  impl::ChainImplPtr impl_;
103 };
104 
105 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
106  const ChainBase& chain);
107 }} // ns
108 
109 #endif // OST_CHAIN_BASE_HH
110 
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:92
base class for the implementation
bool IsValid() const
check validity of handle
Definition: chain_base.hh:58
const impl::ChainImplPtr & Impl() const
Definition: chain_base.hh:73
base class for the handler classes