Public Member Functions | Private Attributes | List of all members
cet::ostream_handle Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/cetlib/v3_06_01/source/cetlib/ostream_handle.h"

Public Member Functions

 ostream_handle ()=default
 
 ostream_handle (std::ostream &os)
 
 ostream_handle (std::string const &fn, std::ios_base::openmode const mode=std::ios_base::out)
 
template<typename OSTREAM , typename = std::enable_if_t<std::is_base_of<std::ostream, OSTREAM>::value>>
 ostream_handle (OSTREAM &&os)
 
ostream_handleoperator<< (char const msg[])
 
template<typename T >
ostream_handleoperator<< (T const &t)
 
void flush ()
 
 operator bool () const
 
 operator std::ostream & ()
 

Private Attributes

std::unique_ptr< detail::ostream_handle_baseosh_
 

Detailed Description

Definition at line 37 of file ostream_handle.h.

Constructor & Destructor Documentation

cet::ostream_handle::ostream_handle ( )
default
cet::ostream_handle::ostream_handle ( std::ostream &  os)
inline

Definition at line 42 of file ostream_handle.h.

43  : osh_{std::make_unique<detail::ostream_observer>(os)}
44  {}
std::unique_ptr< detail::ostream_handle_base > osh_
cet::ostream_handle::ostream_handle ( std::string const &  fn,
std::ios_base::openmode const  mode = std::ios_base::out 
)
inline

Definition at line 47 of file ostream_handle.h.

References submit_nova_art::mode.

49  : osh_{std::make_unique<detail::ostream_owner<std::ofstream>>(
50  std::ofstream(fn, mode))}
51  {}
std::unique_ptr< detail::ostream_handle_base > osh_
template<typename OSTREAM , typename = std::enable_if_t<std::is_base_of<std::ostream, OSTREAM>::value>>
cet::ostream_handle::ostream_handle ( OSTREAM &&  os)
inline

Definition at line 57 of file ostream_handle.h.

58  : osh_{std::make_unique<detail::ostream_owner<OSTREAM>>(std::move(os))}
59  {}
std::unique_ptr< detail::ostream_handle_base > osh_

Member Function Documentation

void cet::ostream_handle::flush ( )
inline

Definition at line 77 of file ostream_handle.h.

References osh_.

78  {
79  osh_->stream().flush();
80  }
std::unique_ptr< detail::ostream_handle_base > osh_
cet::ostream_handle::operator bool ( ) const
inlineexplicit

Definition at line 81 of file ostream_handle.h.

References osh_.

81 { return static_cast<bool>(osh_->stream()); }
std::unique_ptr< detail::ostream_handle_base > osh_
cet::ostream_handle::operator std::ostream & ( )
inline

Definition at line 82 of file ostream_handle.h.

References osh_.

82 { return osh_->stream(); }
std::unique_ptr< detail::ostream_handle_base > osh_
ostream_handle& cet::ostream_handle::operator<< ( char const  msg[])
inline

Definition at line 62 of file ostream_handle.h.

References lem_server::msg, and osh_.

63  {
64  osh_->stream() << msg;
65  return *this;
66  }
std::unique_ptr< detail::ostream_handle_base > osh_
template<typename T >
ostream_handle& cet::ostream_handle::operator<< ( T const &  t)
inline

Definition at line 70 of file ostream_handle.h.

References osh_, and confusionMatrixTree::t.

71  {
72  osh_->stream() << t;
73  return *this;
74  }
std::unique_ptr< detail::ostream_handle_base > osh_

Member Data Documentation

std::unique_ptr<detail::ostream_handle_base> cet::ostream_handle::osh_
private

Definition at line 85 of file ostream_handle.h.

Referenced by flush(), operator bool(), operator std::ostream &(), and operator<<().


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