ProteoWizard
Public Member Functions
pwiz::proteome::ReaderList Class Reference

Reader container (composite pattern). More...

#include <Reader.hpp>

Inheritance diagram for pwiz::proteome::ReaderList:
pwiz::proteome::Reader pwiz::proteome::DefaultReaderList pwiz::tradata::DefaultReaderList

List of all members.

Public Member Functions

virtual std::string identify (const std::string &uri) const
 returns child name iff some child identifies, else empty string
virtual std::string identify (const std::string &uri, boost::shared_ptr< std::istream > uriStreamPtr) const
 returns child name iff some child identifies, else empty string
virtual void read (const std::string &uri, ProteomeData &result) const
 delegates to first child that identifies
virtual void read (const std::string &uri, boost::shared_ptr< std::istream > uriStreamPtr, ProteomeData &result) const
 delegates to first child that identifies
ReaderListoperator+= (const ReaderList &rhs)
 appends all of the rhs operand's Readers to the list
ReaderListoperator+= (const ReaderPtr &rhs)
 appends the rhs Reader to the list
ReaderList operator+ (const ReaderList &rhs) const
 returns a concatenated list of all the Readers from the lhs and rhs operands
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 * get ()
 returns pointer to Reader of the specified type
template<typename reader_type >
const reader_type * get () const
 returns const pointer to Reader of the specified type
virtual const char * getType () const
- Public Member Functions inherited from pwiz::proteome::Reader
bool accept (const std::string &uri, boost::shared_ptr< std::istream > uriStreamPtr) const
 return true iff Reader recognizes the file as one it should handle
virtual ~Reader ()

Additional Inherited Members

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

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


Member Function Documentation

virtual std::string pwiz::proteome::ReaderList::identify ( const std::string &  uri) const
virtual

returns child name iff some child identifies, else empty string

virtual std::string pwiz::proteome::ReaderList::identify ( const std::string &  uri,
boost::shared_ptr< std::istream >  uriStreamPtr 
) const
virtual

returns child name iff some child identifies, else empty string

Implements pwiz::proteome::Reader.

virtual void pwiz::proteome::ReaderList::read ( const std::string &  uri,
ProteomeData result 
) const
virtual

delegates to first child that identifies

Reimplemented from pwiz::proteome::Reader.

Referenced by testRead().

virtual void pwiz::proteome::ReaderList::read ( const std::string &  uri,
boost::shared_ptr< std::istream >  uriStreamPtr,
ProteomeData result 
) const
virtual

delegates to first child that identifies

Implements pwiz::proteome::Reader.

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

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

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

appends the rhs Reader to the list

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

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

ReaderList pwiz::proteome::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::proteome::ReaderList::get ( )
inline

returns pointer to Reader of the specified type

Definition at line 134 of file Reader.hpp.

Referenced by testGet(), and testRead().

{
for (iterator it=begin(); it!=end(); ++it)
{
reader_type* p = dynamic_cast<reader_type*>(it->get());
if (p) return p;
}
return 0;
}
template<typename reader_type >
const reader_type* pwiz::proteome::ReaderList::get ( ) const
inline

returns const pointer to Reader of the specified type

Definition at line 147 of file Reader.hpp.

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

Implements pwiz::proteome::Reader.

Definition at line 152 of file Reader.hpp.

{return "ReaderList";} // satisfy inheritance

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