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

Reader container (composite pattern). More...

#include <Reader.hpp>

Inheritance diagram for pwiz::identdata::ReaderList:
pwiz::identdata::Reader pwiz::identdata::DefaultReaderList

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, IdentData &result, const Config &config=Config()) const
 delegates to first child that identifies More...
 
virtual void read (const std::string &filename, const std::string &head, IdentData &result, const Config &config=Config()) const
 delegates to first child that identifies More...
 
virtual void read (const std::string &filename, IdentDataPtr &result, const Config &config=Config()) const
 delegates to first child that identifies More...
 
virtual void read (const std::string &filename, const std::string &head, IdentDataPtr &result, const Config &config=Config()) const
 delegates to first child that identifies More...
 
virtual void read (const std::string &filename, std::vector< IdentDataPtr > &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< IdentDataPtr > &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
 
- Public Member Functions inherited from pwiz::identdata::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 ()
 

Additional Inherited Members

- Public Attributes inherited from std::vector< T >
elements
 STL member. More...
 

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 135 of file Reader.hpp.

Member Function Documentation

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

returns child name iff some child identifies, else empty string

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

returns child name iff some child identifies, else empty string

Implements pwiz::identdata::Reader.

virtual void pwiz::identdata::ReaderList::read ( const std::string &  filename,
IdentData result,
const Config config = Config() 
) const
virtual

delegates to first child that identifies

Reimplemented from pwiz::identdata::Reader.

Referenced by testSerialize().

virtual void pwiz::identdata::ReaderList::read ( const std::string &  filename,
const std::string &  head,
IdentData result,
const Config config = Config() 
) const
virtual

delegates to first child that identifies

Implements pwiz::identdata::Reader.

virtual void pwiz::identdata::ReaderList::read ( const std::string &  filename,
IdentDataPtr result,
const Config config = Config() 
) const
virtual

delegates to first child that identifies

Reimplemented from pwiz::identdata::Reader.

virtual void pwiz::identdata::ReaderList::read ( const std::string &  filename,
const std::string &  head,
IdentDataPtr result,
const Config config = Config() 
) const
virtual

delegates to first child that identifies

Implements pwiz::identdata::Reader.

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

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

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

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

Implements pwiz::identdata::Reader.

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

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

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

appends the rhs Reader to the list

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

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

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

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

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

returns pointer to Reader of the specified type

Definition at line 196 of file Reader.hpp.

197  {
198  for (iterator it=begin(); it!=end(); ++it)
199  {
200  reader_type* p = dynamic_cast<reader_type*>(it->get());
201  if (p) return p;
202  }
203 
204  return 0;
205  }
template<typename reader_type >
const reader_type* pwiz::identdata::ReaderList::get ( ) const
inline

returns const pointer to Reader of the specified type

Definition at line 209 of file Reader.hpp.

210  {
211  return const_cast<ReaderList*>(this)->get<reader_type>();
212  }
virtual const char* pwiz::identdata::ReaderList::getType ( ) const
inlinevirtual

Implements pwiz::identdata::Reader.

Definition at line 214 of file Reader.hpp.

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

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