OpenStructure
Loading...
Searching...
No Matches
entity_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_ENTITY_BASE_HT
20#define OST_ENTITY_BASE_HT
21
24
26
27namespace ost { namespace mol {
28
31 public GenericPropContainer<EntityBase> {
32public:
36
40 const String& GetName() const;
41
47 void SetName(const String& ent_name);
48
49public:
50
52
53
59 operator bool() const { return this->IsValid(); }
62 bool IsValid() const { return Impl().get()!=0; }
64 const impl::EntityImplPtr& Impl() const;
65protected:
66
68
70
71 void CheckValidity() const;
72private:
74};
75
76DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
77 const EntityBase& ent);
78}} // ns
79
80#endif // OST_ENTITY_BASE_HH
81
base class for the handler classes
base class for the implementation
definition of EntityBase
const String & GetName() const
Get entity name.
const impl::EntityImplPtr & Impl() const
impl::EntityImplPtr & Impl()
void SetName(const String &ent_name)
Set entity name.
void CheckValidity() const
EntityBase(const impl::EntityImplPtr &impl)
bool IsValid() const
check validity of handle
GenericPropContainerImpl * GpImpl()
const GenericPropContainerImpl * GpImpl() const
std::string String
Definition base.hh:54
#define DLLEXPORT_OST_MOL
boost::shared_ptr< EntityImpl > EntityImplPtr
DLLEXPORT_OST_MOL std::ostream & operator<<(std::ostream &os, const AtomBase &atom)
Definition base.dox:1