OpenStructure
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
stage
include
ost
seq
sequence_list.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_SEQ_SEQUENCE_LIST_HH
20
#define OST_SEQ_SEQUENCE_LIST_HH
21
22
#include <
ost/seq/impl/sequence_list_impl_fw.hh
>
23
#include <
ost/seq/impl/sequence_list_iterator.hh
>
24
#include <
ost/seq/sequence_handle.hh
>
25
26
namespace
ost {
namespace
seq {
27
28
class
SequenceList
;
29
33
class
DLLEXPORT_OST_SEQ
ConstSequenceList
{
34
public
:
35
friend
class
SequenceList
;
36
typedef
impl::SequenceListIterator
<
ConstSequenceHandle
,
37
impl::SequenceImplListIterator
>
Iterator
;
38
typedef
Iterator
iterator
;
39
ConstSequenceList
();
40
41
void
AddSequence(
const
ConstSequenceHandle
& sequence);
42
44
int
GetCount()
const
;
45
46
ConstSequenceHandle
operator[](
int
index)
const
;
47
Iterator
Begin()
const
;
48
Iterator
End()
const
;
49
50
// for stl compat
51
Iterator
begin
()
const
{
return
Begin(); }
52
Iterator
end
()
const
{
return
End(); }
53
54
bool
SequencesHaveEqualLength()
const
;
55
bool
IsValid()
const
;
56
60
ConstSequenceList
Take(
int
n)
const
;
61
63
ConstSequenceList
Slice(
int
first,
int
n)
const
;
64
65
ConstSequenceHandle
FindSequence(
const
String
& name)
const
;
66
int
GetMinLength()
const
;
67
int
GetMaxLength()
const
;
69
impl::SequenceListImplPtr
& Impl()
const
;
70
ConstSequenceList
(
const
impl::SequenceListImplPtr
& impl);
71
protected
:
72
73
void
CheckValidity()
const
;
74
mutable
impl::SequenceListImplPtr
impl_
;
75
};
76
80
class
DLLEXPORT_OST_SEQ
SequenceList
{
81
public
:
82
83
typedef
impl::SequenceListIterator
<
SequenceHandle
,
84
impl::SequenceImplListIterator
>
Iterator
;
85
typedef
Iterator
iterator
;
86
SequenceList
();
87
void
AddSequence(
const
SequenceHandle
& sequence);
88
89
bool
SequencesHaveEqualLength()
const
;
90
// \brief get number of sequences
91
int
GetCount()
const
;
92
SequenceHandle
operator[](
int
index)
const
;
93
Iterator
Begin()
const
;
94
Iterator
End()
const
;
95
99
SequenceList
Take(
int
n)
const
;
100
102
SequenceList
Slice(
int
first,
int
n)
const
;
103
// for stl compat
104
Iterator
begin
()
const
{
return
Begin(); }
105
Iterator
end
()
const
{
return
End(); }
106
107
bool
IsValid()
const
;
108
109
int
GetMinLength()
const
;
110
int
GetMaxLength()
const
;
111
112
SequenceHandle
FindSequence(
const
String
& name)
const
;
113
// \internal
114
impl::SequenceListImplPtr
& Impl()
const
;
115
SequenceList
(
const
impl::SequenceListImplPtr
& impl);
116
117
operator
ConstSequenceList
()
const
;
118
protected
:
119
void
CheckValidity()
const
;
120
121
mutable
impl::SequenceListImplPtr
impl_
;
122
};
123
124
SequenceList
DLLEXPORT_OST_SEQ
CreateSequenceList
();
125
ConstSequenceList
DLLEXPORT_OST_SEQ
CreateConstSequenceList
();
126
127
#if(OST_INFO_ENABLED)
128
129
void
DLLEXPORT_OST_SEQ
SequenceListToInfo(
const
ConstSequenceList
& seq_list,
130
info::InfoGroup
& group);
131
133
SequenceList
DLLEXPORT_OST_SEQ
SequenceListFromInfo(
info::InfoGroup
& group);
134
#endif
135
}}
136
137
#endif
Generated on Thu Mar 5 2015 15:19:07 for OpenStructure by
1.8.1.1