27#include <boost/assign.hpp>
34using namespace boost::assign;
35using boost::logic::tribool;
43 os <<
"size: " << pl.
size() << endl;
45 for (
size_t i=0, end=pl.
size(); i<end; i++)
48 os << protein->index <<
" "
59 for (
size_t i=0; i<10; ++i)
61 ProteinPtr protein(
new Protein(
"Pro" + lexical_cast<string>(i+1), i,
"",
string(16,
'A'+i)));
62 pl->proteins.push_back(protein);
67 *
os_ <<
"original protein list:\n";
86 return (protein.
index==1 ||
100 if (
os_) *
os_ <<
"testSelectedIndices:\n";
119 if (
os_) *
os_ <<
"testIndexSet:\n";
145 if (
os_) *
os_ <<
"testIdSet:\n";
148 idSet +=
"Pro2",
"Pro3",
"Pro4",
"Pro7";
175int main(
int argc,
char* argv[])
181 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
int main(int argc, char *argv[])
void testIndexSet(ProteinListPtr pl)
ProteinListPtr createProteinList()
void printProteinList(const ProteinList &pl, ostream &os)
void testIdSet(ProteinListPtr pl)
void testSelectedIndices(ProteinListPtr pl)
ProteinList filter, for creating Protein sub-lists.
virtual ProteinPtr protein(size_t index, bool getSequence=true) const =0
virtual size_t size() const =0
a virtual container of integers, accessible via an iterator interface, stored as union of intervals
void insert(Interval interval)
insert an interval of integers into the virtual container
boost::shared_ptr< Protein > ProteinPtr
boost::shared_ptr< ProteinList > ProteinListPtr
virtual bool done() const
return true iff done accepting chromatograms; this allows early termination of the iteration through ...
virtual tribool accept(const Protein &protein) const
return true iff Protein is accepted
client-implemented filter predicate – called during construction of ProteinList_Filter to create the ...
#define unit_assert_operator_equal(expected, actual)
#define TEST_PROLOG(argc, argv)