Psyllid  v1.12.4
Project 8 Data Acquisisition Software
psyllid_error.hh
Go to the documentation of this file.
1 #ifndef _psyllid_error_hh_
2 #define _psyllid_error_hh_
3 
4 #include <exception>
5 #include <string>
6 #include <sstream>
7 
8 namespace psyllid
9 {
10 
11  class error : public std::exception
12  {
13  public:
14  error();
15  error( const error& p_copy );
16  error& operator=( const error& p_copy );
17  virtual ~error() throw ();
18 
19  template< class x_type >
20  error& operator<<( const x_type& p_fragment );
21 
22  const char* what() const throw ();
23 
24  protected:
25  std::string f_message;
26  };
27 
28  template< class x_type >
29  error& error::operator<<( const x_type& p_fragment )
30  {
31  std::stringstream f_converter;
32  f_converter << f_message << p_fragment;
33  f_message.assign( f_converter.str() );
34  return (*this);
35  }
36 
37 }
38 
39 #endif
const char * what() const
error & operator<<(const x_type &p_fragment)
std::string f_message
virtual ~error()
error & operator=(const error &p_copy)