src/common/stream-tracer.h
changeset 134 150a7ff4f780
parent 131 f4fb87e77034
child 150 663120712cd9
equal deleted inserted replaced
133:8a8e9891792d 134:150a7ff4f780
    36 public:
    36 public:
    37     StreamTracer ()
    37     StreamTracer ()
    38         : m_os (0) {}
    38         : m_os (0) {}
    39     template <typename T>
    39     template <typename T>
    40     StreamTracer &operator << (T const&v) {
    40     StreamTracer &operator << (T const&v) {
    41         if (m_os != 0) {
    41         if (m_os != 0) 
       
    42           {
    42             (*m_os) << v;
    43             (*m_os) << v;
    43         }
    44           }
    44         return *this;
    45         return *this;
    45     }
    46     }
    46     template <typename T>
    47     template <typename T>
    47     StreamTracer &operator << (T &v) {
    48     StreamTracer &operator << (T &v) {
    48         if (m_os != 0) {
    49         if (m_os != 0) 
       
    50           {
    49             (*m_os) << v;
    51             (*m_os) << v;
    50         }
    52           }
    51         return *this;
    53         return *this;
    52     }
    54     }
    53     StreamTracer &operator << (std::ostream &(*v) (std::ostream &)) {
    55     StreamTracer &operator << (std::ostream &(*v) (std::ostream &)) {
    54         if (m_os != 0) {
    56         if (m_os != 0) 
       
    57           {
    55             (*m_os) << v;
    58             (*m_os) << v;
    56         }
    59           }
    57         return *this;
    60         return *this;
    58     }
    61     }
    59 
    62 
    60     /**
    63     /**
    61      * \param os the output stream to store
    64      * \param os the output stream to store