OpenStructure
Loading...
Searching...
No Matches
build-dev
stage
include
ost
mol
property_id.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_PROPERTY_ID_HH
20
#define OST_PROPERTY_ID_HH
21
22
/*
23
Author: Marco Biasini
24
*/
25
#include <
ost/message.hh
>
26
27
#include <
ost/mol/module_config.hh
>
28
29
namespace
ost
{
namespace
mol {
30
31
struct
DLLEXPORT_OST_MOL
Prop
{
32
public
:
41
typedef
enum
{
42
RNAME, ANAME, CNAME, ELE, RNUM, ANUM, AX, AY, AZ, OCC,
AINDEX
, RTYPE,
43
ISHETATM, RBFAC,
ABFAC
, PEPTIDE, NUCLEOTIDE, ACHARGE, RINDEX, PROTEIN,
44
LIGAND
, WATER, WITHIN, UNDEF, CUSTOM
45
} ID;
46
47
typedef
enum
{
48
ATOM=0, RESIDUE=1, CHAIN=2, UNSPECIFIED=3
49
} Level;
50
51
typedef
enum
{
52
STRING, INT,
FLOAT
, VEC_DIST
53
} Type;
54
public
:
55
ID
id
;
56
Type
type
;
57
Level
level
;
58
59
Prop
(
ID
i,
Type
t,
Level
l):
60
id(i), type(t), level(l)
61
{ }
62
63
Prop
():
64
id(UNDEF), type(INT), level(ATOM)
65
{ }
66
67
bool
operator==
(
const
Prop
& rhs)
const
68
{
69
return
id
==rhs.
id
&& type==rhs.
type
&& level==rhs.
level
;
70
}
71
72
bool
operator!=
(
const
Prop
& rhs)
const
73
{
74
return
!this->operator==(rhs);
75
}
76
77
String
GetName
()
const
;
78
String
GetTypeName
()
const
;
79
};
80
83
Prop::ID
DLLEXPORT_OST_MOL
PropertyIDFromString
(
const
String
& prop);
84
87
Prop
DLLEXPORT_OST_MOL
PropertyFromString
(
const
String
& prop);
88
89
90
struct
DLLEXPORT
PropertyError
:
public
ost::Error
91
{
92
PropertyError
(
ost::mol::Prop::ID
prop):
93
ost
::
Error
(
"invalid property"
),
94
prop_(prop)
95
{}
96
virtual
~PropertyError
() throw() {}
97
98
ost::mol::Prop::ID
Prop
()
const
99
{
100
return
prop_;
101
}
102
private
:
103
ost::mol::Prop::ID
prop_;
104
};
105
106
}}
//ns
107
108
109
#endif
ost::Error
Definition
message.hh:35
message.hh
String
std::string String
Definition
base.hh:54
module_config.hh
DLLEXPORT_OST_MOL
#define DLLEXPORT_OST_MOL
Definition
module_config.hh:28
ost::mol::PropertyIDFromString
Prop::ID DLLEXPORT_OST_MOL PropertyIDFromString(const String &prop)
ost::mol::PropertyFromString
Prop DLLEXPORT_OST_MOL PropertyFromString(const String &prop)
ost
Definition
base.dox:1
ost::mol::Prop
Definition
property_id.hh:31
ost::mol::Prop::level
Level level
Definition
property_id.hh:57
ost::mol::Prop::ID
ID
Defined properties.
Definition
property_id.hh:41
ost::mol::Prop::ABFAC
@ ABFAC
Definition
property_id.hh:43
ost::mol::Prop::LIGAND
@ LIGAND
Definition
property_id.hh:44
ost::mol::Prop::AINDEX
@ AINDEX
Definition
property_id.hh:42
ost::mol::Prop::Prop
Prop()
Definition
property_id.hh:63
ost::mol::Prop::Type
Type
Definition
property_id.hh:51
ost::mol::Prop::FLOAT
@ FLOAT
Definition
property_id.hh:52
ost::mol::Prop::GetName
String GetName() const
ost::mol::Prop::Level
Level
Definition
property_id.hh:47
ost::mol::Prop::operator!=
bool operator!=(const Prop &rhs) const
Definition
property_id.hh:72
ost::mol::Prop::operator==
bool operator==(const Prop &rhs) const
Definition
property_id.hh:67
ost::mol::Prop::id
ID id
Definition
property_id.hh:55
ost::mol::Prop::Prop
Prop(ID i, Type t, Level l)
Definition
property_id.hh:59
ost::mol::Prop::GetTypeName
String GetTypeName() const
ost::mol::Prop::type
Type type
Definition
property_id.hh:56
ost::mol::PropertyError
Definition
property_id.hh:91
ost::mol::PropertyError::~PropertyError
virtual ~PropertyError()
Definition
property_id.hh:96
ost::mol::PropertyError::PropertyError
PropertyError(ost::mol::Prop::ID prop)
Definition
property_id.hh:92
ost::mol::PropertyError::Prop
ost::mol::Prop::ID Prop() const
Definition
property_id.hh:98
Generated by
1.9.8