g4tools  5.4.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::image::readers Class Reference

Public Types

typedef std::pair< std::string, ireader * > named_reader
 

Public Member Functions

 readers ()
 
virtual ~readers ()
 
 readers (const readers &a_from)
 
readersoperator= (const readers &a_from)
 
void add_reader (const std::string &a_name, ireader *a_reader)
 
const std::vector< named_reader > & named_readers () const
 

Protected Member Functions

void _clear ()
 
void _copy (const std::vector< named_reader > &a_from)
 

Protected Attributes

std::vector< named_readerm_readers
 

Detailed Description

Definition at line 35 of file image_reader.

Member Typedef Documentation

◆ named_reader

typedef std::pair<std::string,ireader*> tools::image::readers::named_reader

Definition at line 37 of file image_reader.

Constructor & Destructor Documentation

◆ readers() [1/2]

tools::image::readers::readers ( )
inline

Definition at line 39 of file image_reader.

39 {}

◆ ~readers()

virtual tools::image::readers::~readers ( )
inlinevirtual

Definition at line 40 of file image_reader.

40 {_clear();}

◆ readers() [2/2]

tools::image::readers::readers ( const readers a_from)
inline

Definition at line 42 of file image_reader.

42  {
43  _copy(a_from.m_readers);
44  }

Member Function Documentation

◆ _clear()

void tools::image::readers::_clear ( )
inlineprotected

Definition at line 56 of file image_reader.

56  {
57  tools_vforit(named_reader,m_readers,it) delete (*it).second;
58  m_readers.clear();
59  }

◆ _copy()

void tools::image::readers::_copy ( const std::vector< named_reader > &  a_from)
inlineprotected

Definition at line 60 of file image_reader.

60  {
61  _clear();
62  tools_vforcit(named_reader,a_from,it) {
63  m_readers.push_back(named_reader((*it).first,(*it).second->copy()));
64  }
65  }

◆ add_reader()

void tools::image::readers::add_reader ( const std::string &  a_name,
ireader a_reader 
)
inline

Definition at line 51 of file image_reader.

51  {
52  m_readers.push_back(named_reader(a_name,a_reader)); //take ownership of a_reader.
53  }

◆ named_readers()

const std::vector<named_reader>& tools::image::readers::named_readers ( ) const
inline

Definition at line 54 of file image_reader.

54 {return m_readers;}

◆ operator=()

readers& tools::image::readers::operator= ( const readers a_from)
inline

Definition at line 45 of file image_reader.

45  {
46  if(&a_from==this) return *this;
47  _copy(a_from.m_readers);
48  return *this;
49  }

Member Data Documentation

◆ m_readers

std::vector<named_reader> tools::image::readers::m_readers
protected

Definition at line 67 of file image_reader.


The documentation for this class was generated from the following file:
tools::image::readers::_clear
void _clear()
Definition: image_reader:56
tools_vforit
#define tools_vforit(a__T, a__v, a__it)
Definition: forit:13
tools::image::readers::_copy
void _copy(const std::vector< named_reader > &a_from)
Definition: image_reader:60
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7
tools::image::readers::m_readers
std::vector< named_reader > m_readers
Definition: image_reader:67
tools::image::readers::named_reader
std::pair< std::string, ireader * > named_reader
Definition: image_reader:37