OpenStructure
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/generic_property.hh>
26 
27 namespace ost { namespace mol {
28 
39  public GenericPropContainer<ChainBase> {
40 
41 public: // constructors
42  ChainBase();
43  ChainBase(const impl::ChainImplPtr& impl);
44 public:
45 
47 
48 
49 
50 
51 
52 
53 
54  operator bool() const { return this->IsValid(); }
57  bool IsValid() const { return Impl().get()!=0; }
60  String GetName() const;
61 
62  const impl::ChainImplPtr& Impl() const {
63  return impl_;
64  }
65 
67  return impl_;
68  }
69 protected:
70  GenericPropContainerImpl* GpImpl();
71 
72  const GenericPropContainerImpl* GpImpl() const;
73 
74  void CheckValidity() const;
75 private:
76  impl::ChainImplPtr impl_;
77 };
78 
79 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
80  const ChainBase& chain);
81 }} // ns
82 
83 #endif // OST_CHAIN_BASE_HH
84