PolyBoRi
CPrintOperation.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //*****************************************************************************
00013 //*****************************************************************************
00014 // include standard stream capabilities
00015 #include <iostream>
00016 
00017 // include basic definitions
00018 #include "pbori_defs.h"
00019 
00020 #ifndef CPrint_Operation_h_
00021 #define CPrint_Operation_h_
00022 
00023 BEGIN_NAMESPACE_PBORI
00024 
00028 template <class ValueType, class LiteralType, class StreamType = std::ostream>
00029 class CPrintOperation {
00030 public:
00031  
00033   typedef StreamType stream_type;
00034 
00036   typedef ValueType value_type;
00037 
00039   typedef LiteralType literal_type;
00040 
00042   CPrintOperation(stream_type& os_): os(os_){}
00043 
00045   value_type& operator()(value_type& val, ...) const {
00046     os << literal_type()();
00047     return val;
00048   }
00050   const value_type& operator()(const value_type& val, ...) const {
00051     os << literal_type()();
00052     return val;
00053   }
00054 protected:
00055   std::ostream& os;
00056 };
00057 
00058 
00059 
00060 END_NAMESPACE_PBORI
00061 
00062 #endif