ProteoWizard
Public Member Functions | List of all members
pwiz::msdata::ReaderList Class Reference

Reader container (composite pattern). More...

#include <Reader.hpp>

Inheritance diagram for pwiz::msdata::ReaderList:
pwiz::msdata::Reader pwiz::msdata::DefaultReaderList pwiz::msdata::ExtendedReaderList

Public Member Functions

virtual std::string identify (const std::string &filename) const
 returns child name iff some child identifies, else empty string More...
 
virtual std::string identify (const std::string &filename, const std::string &head) const
 returns child name iff some child identifies, else empty string More...
 
virtual void read (const std::string &filename, MSData &result, int runIndex=0, const Config &config=Config()) const
 delegates to first child that identifies More...
 
virtual void read (const std::string &filename, const std::string &head, MSData &result, int runIndex=0, const Config &config=Config()) const
 delegates to first child that identifies More...
 
virtual void read (const std::string &filename, std::vector< MSDataPtr > &results, const Config &config=Config()) const
 delegates to first child that identifies; provides support for multi-run input files More...
 
virtual void read (const std::string &filename, const std::string &head, std::vector< MSDataPtr > &results, const Config &config=Config()) const
 delegates to first child that identifies; provides support for multi-run input files More...
 
virtual void readIds (const std::string &filename, std::vector< std::string > &results, const Config &config=Config()) const
 delegates to first child that identifies; provides support for multi-run input files More...
 
virtual void readIds (const std::string &filename, const std::string &head, std::vector< std::string > &results, const Config &config=Config()) const
 delegates to first child that identifies; provides support for multi-run input files More...
 
ReaderListoperator+= (const ReaderList &rhs)
 appends all of the rhs operand's Readers to the list More...
 
ReaderListoperator+= (const ReaderPtr &rhs)
 appends the rhs Reader to the list More...
 
ReaderList operator+ (const ReaderList &rhs) const
 returns a concatenated list of all the Readers from the lhs and rhs operands More...
 
ReaderList operator+ (const ReaderPtr &rhs) const
 returns a concatenated list of all the Readers from the lhs and rhs operands More...
 
template<typename reader_type >
reader_type * get ()
 returns pointer to Reader of the specified type More...
 
template<typename reader_type >
const reader_type * get () const
 returns const pointer to Reader of the specified type More...
 
virtual const char * getType () const
 returns a unique string identifying the reader type More...
 
- Public Member Functions inherited from pwiz::msdata::Reader
bool accept (const std::string &filename, const std::string &head) const
 return true iff Reader recognizes the file as one it should handle More...
 
virtual ~Reader ()
 

Detailed Description

Reader container (composite pattern).

The template get<reader_type>() gives access to child Readers by type, to facilitate Reader-specific configuration at runtime.

Definition at line 134 of file Reader.hpp.

Member Function Documentation

§ identify() [1/2]

virtual std::string pwiz::msdata::ReaderList::identify ( const std::string &  filename) const
virtual

returns child name iff some child identifies, else empty string

§ identify() [2/2]

virtual std::string pwiz::msdata::ReaderList::identify ( const std::string &  filename,
const std::string &  head 
) const
virtual

returns child name iff some child identifies, else empty string

Implements pwiz::msdata::Reader.

§ read() [1/4]

virtual void pwiz::msdata::ReaderList::read ( const std::string &  filename,
MSData result,
int  runIndex = 0,
const Config config = Config() 
) const
virtual

delegates to first child that identifies

Referenced by testRead().

§ read() [2/4]

virtual void pwiz::msdata::ReaderList::read ( const std::string &  filename,
const std::string &  head,
MSData result,
int  runIndex = 0,
const Config config = Config() 
) const
virtual

delegates to first child that identifies

Implements pwiz::msdata::Reader.

§ read() [3/4]

virtual void pwiz::msdata::ReaderList::read ( const std::string &  filename,
std::vector< MSDataPtr > &  results,
const Config config = Config() 
) const
virtual

delegates to first child that identifies; provides support for multi-run input files

§ read() [4/4]

virtual void pwiz::msdata::ReaderList::read ( const std::string &  filename,
const std::string &  head,
std::vector< MSDataPtr > &  results,
const Config config = Config() 
) const
virtual

delegates to first child that identifies; provides support for multi-run input files

Implements pwiz::msdata::Reader.

§ readIds() [1/2]

virtual void pwiz::msdata::ReaderList::readIds ( const std::string &  filename,
std::vector< std::string > &  results,
const Config config = Config() 
) const
virtual

delegates to first child that identifies; provides support for multi-run input files

§ readIds() [2/2]

virtual void pwiz::msdata::ReaderList::readIds ( const std::string &  filename,
const std::string &  head,
std::vector< std::string > &  results,
const Config config = Config() 
) const
virtual

delegates to first child that identifies; provides support for multi-run input files

Reimplemented from pwiz::msdata::Reader.

§ operator+=() [1/2]

ReaderList& pwiz::msdata::ReaderList::operator+= ( const ReaderList rhs)

appends all of the rhs operand's Readers to the list

§ operator+=() [2/2]

ReaderList& pwiz::msdata::ReaderList::operator+= ( const ReaderPtr rhs)

appends the rhs Reader to the list

§ operator+() [1/2]

ReaderList pwiz::msdata::ReaderList::operator+ ( const ReaderList rhs) const

returns a concatenated list of all the Readers from the lhs and rhs operands

§ operator+() [2/2]

ReaderList pwiz::msdata::ReaderList::operator+ ( const ReaderPtr rhs) const

returns a concatenated list of all the Readers from the lhs and rhs operands

§ get() [1/2]

template<typename reader_type >
reader_type* pwiz::msdata::ReaderList::get ( )
inline

returns pointer to Reader of the specified type

Definition at line 199 of file Reader.hpp.

Referenced by testGet(), and testRead().

200  {
201  for (iterator it=begin(); it!=end(); ++it)
202  {
203  reader_type* p = dynamic_cast<reader_type*>(it->get());
204  if (p) return p;
205  }
206 
207  return 0;
208  }

§ get() [2/2]

template<typename reader_type >
const reader_type* pwiz::msdata::ReaderList::get ( ) const
inline

returns const pointer to Reader of the specified type

Definition at line 212 of file Reader.hpp.

213  {
214  return const_cast<ReaderList*>(this)->get<reader_type>();
215  }

§ getType()

virtual const char* pwiz::msdata::ReaderList::getType ( ) const
inlinevirtual

returns a unique string identifying the reader type

Implements pwiz::msdata::Reader.

Definition at line 217 of file Reader.hpp.

References pwiz::msdata::identifyFileFormat(), pwiz::msdata::operator+(), and PWIZ_API_DECL.

217 {return "ReaderList";} // satisfy inheritance

The documentation for this class was generated from the following file: