OpenStructure
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
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
int
GetMinLength()
const
;
65
int
GetMaxLength()
const
;
67
impl::SequenceListImplPtr
& Impl()
const
;
68
ConstSequenceList
(
const
impl::SequenceListImplPtr
& impl);
69
protected
:
70
71
void
CheckValidity()
const
;
72
mutable
impl::SequenceListImplPtr
impl_
;
73
};
74
78
class
DLLEXPORT_OST_SEQ
SequenceList
{
79
public
:
80
81
typedef
impl::SequenceListIterator
<
SequenceHandle
,
82
impl::SequenceImplListIterator
>
Iterator
;
83
typedef
Iterator
iterator
;
84
SequenceList
();
85
void
AddSequence(
const
SequenceHandle
& sequence);
86
87
bool
SequencesHaveEqualLength()
const
;
88
// \brief get number of sequences
89
int
GetCount()
const
;
90
SequenceHandle
operator[](
int
index)
const
;
91
Iterator
Begin()
const
;
92
Iterator
End()
const
;
93
97
SequenceList
Take(
int
n)
const
;
98
100
SequenceList
Slice(
int
first,
int
n)
const
;
101
// for stl compat
102
Iterator
begin
()
const
{
return
Begin(); }
103
Iterator
end
()
const
{
return
End(); }
104
105
bool
IsValid()
const
;
106
107
int
GetMinLength()
const
;
108
int
GetMaxLength()
const
;
109
110
// \internal
111
impl::SequenceListImplPtr
& Impl()
const
;
112
SequenceList
(
const
impl::SequenceListImplPtr
& impl);
113
114
operator
ConstSequenceList
()
const
;
115
protected
:
116
void
CheckValidity()
const
;
117
118
mutable
impl::SequenceListImplPtr
impl_
;
119
};
120
121
SequenceList
DLLEXPORT_OST_SEQ
CreateSequenceList
();
122
ConstSequenceList
DLLEXPORT_OST_SEQ
CreateConstSequenceList
();
123
125
void
DLLEXPORT_OST_SEQ
SequenceListToInfo
(
const
ConstSequenceList
& seq_list,
126
info::InfoGroup
& group);
127
129
SequenceList
DLLEXPORT_OST_SEQ
SequenceListFromInfo
(
info::InfoGroup
& group);
130
}}
131
132
#endif
Generated on Thu Jun 14 2012 18:58:02 for OpenStructure by
1.8.1.1