bpp-seq
2.1.0
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Friends
Pages
AbstractSequenceContainer.h
Go to the documentation of this file.
1
//
2
// File AbstractSequenceContainer.h
3
// Created by: Guillaume Deuchst
4
// Julien Dutheil
5
//
6
7
/*
8
Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
9
10
This software is a computer program whose purpose is to provide classes
11
for sequences analysis.
12
13
This software is governed by the CeCILL license under French law and
14
abiding by the rules of distribution of free software. You can use,
15
modify and/ or redistribute the software under the terms of the CeCILL
16
license as circulated by CEA, CNRS and INRIA at the following URL
17
"http://www.cecill.info".
18
19
As a counterpart to the access to the source code and rights to copy,
20
modify and redistribute granted by the license, users are provided only
21
with a limited warranty and the software's author, the holder of the
22
economic rights, and the successive licensors have only limited
23
liability.
24
25
In this respect, the user's attention is drawn to the risks associated
26
with loading, using, modifying and/or developing or reproducing the
27
software by the user in light of its specific status of free software,
28
that may mean that it is complicated to manipulate, and that also
29
therefore means that it is reserved for developers and experienced
30
professionals having in-depth computer knowledge. Users are therefore
31
encouraged to load and test the software's suitability as regards their
32
requirements in conditions enabling the security of their systems and/or
33
data to be ensured and, more generally, to use and operate it in the
34
same conditions as regards security.
35
36
The fact that you are presently reading this means that you have had
37
knowledge of the CeCILL license and that you accept its terms.
38
*/
39
40
#ifndef _ABSTRACTSEQUENCECONTAINER_H_
41
#define _ABSTRACTSEQUENCECONTAINER_H_
42
43
#include "../Alphabet/Alphabet.h"
44
#include "../Sequence.h"
45
#include "
SequenceContainer.h
"
46
#include "
OrderedSequenceContainer.h
"
47
#include <
Bpp/Exceptions.h
>
48
49
namespace
bpp
50
{
51
57
class
AbstractSequenceContainer
:
58
public
virtual
OrderedSequenceContainer
59
{
60
private
:
61
65
const
Alphabet
*
alphabet_
;
66
70
Comments
comments_
;
71
72
public
:
73
81
AbstractSequenceContainer
(
const
Alphabet
* alpha):
82
alphabet_
(alpha),
comments_
() {}
83
84
AbstractSequenceContainer
(
const
AbstractSequenceContainer
& sc):
85
alphabet_
(sc.
alphabet_
),
comments_
(sc.
comments_
) {}
86
87
AbstractSequenceContainer
&
operator=
(
const
AbstractSequenceContainer
& sc)
88
{
89
alphabet_
= sc.
alphabet_
;
90
comments_
= sc.
comments_
;
91
return
*
this
;
92
}
93
99
AbstractSequenceContainer
(
const
SequenceContainer
& sc):
100
alphabet_
(sc.
getAlphabet
()),
comments_
(sc.
getGeneralComments
()) {}
101
107
AbstractSequenceContainer
&
operator=
(
const
SequenceContainer
& sc)
108
{
109
alphabet_
= sc.
getAlphabet
();
110
comments_
= sc.
getGeneralComments
();
111
return
*
this
;
112
}
113
114
virtual
~AbstractSequenceContainer
() {}
115
116
public
:
117
123
const
Alphabet
*
getAlphabet
()
const
{
return
alphabet_
; }
124
const
std::vector<int>&
getContent
(
const
std::string& name)
const
throw
(
SequenceNotFoundException
)
125
{
126
return
getSequence
(name).
getContent
();
127
}
128
129
std::string
toString
(
const
std::string& name)
const
throw
(
SequenceNotFoundException
)
130
{
131
return
getSequence
(name).
toString
();
132
}
133
134
const
Comments&
getComments
(
const
std::string& name)
const
throw
(
SequenceNotFoundException
)
135
{
136
return
getSequence
(name).
getComments
();
137
}
138
139
void
setComments
(
const
std::string& name,
const
Comments& comments)
throw
(
SequenceNotFoundException
);
140
const
Comments&
getGeneralComments
()
const
141
{
142
return
comments_
;
143
}
144
145
void
setGeneralComments
(
const
Comments& comments)
146
{
147
comments_
= comments;
148
}
149
150
void
deleteGeneralComments
()
151
{
152
comments_
.clear();
153
}
154
162
virtual
const
std::string&
getName
(
size_t
sequenceIndex)
const
throw
(
IndexOutOfBoundsException
)
163
{
164
return
getSequence
(sequenceIndex).
getName
();
165
}
166
167
virtual
const
std::vector<int>&
getContent
(
size_t
sequenceIndex)
const
throw
(
IndexOutOfBoundsException
)
168
{
169
return
getSequence
(sequenceIndex).
getContent
();
170
}
171
172
virtual
std::string
toString
(
size_t
sequenceIndex)
const
throw
(
IndexOutOfBoundsException
)
173
{
174
return
getSequence
(sequenceIndex).
toString
();
175
}
176
177
virtual
const
Comments&
getComments
(
size_t
sequenceIndex)
const
throw
(
IndexOutOfBoundsException
)
178
{
179
return
getSequence
(sequenceIndex).
getComments
();
180
}
181
182
virtual
void
setComments
(
size_t
sequenceIndex,
const
Comments& comments)
throw
(
IndexOutOfBoundsException
) = 0;
185
};
186
187
}
//end of namespace bpp.
188
189
#endif // _ABSTRACTSEQUENCECONTAINER_H_
190
Bpp
Seq
Container
AbstractSequenceContainer.h
Generated on Thu Mar 14 2013 16:34:50 for bpp-seq by
1.8.3.1-20130209