RestoreOutputStreamState.h

Go to the documentation of this file.
00001 /*
00002 *
00003 *
00004 * Distributed under the OpenDDS License.
00005 * See: http://www.opendds.org/license.html
00006 */
00007 
00008 #ifndef OPENDDS_DCPS_RESTORE_OUTPUT_STREAM_STATE_H
00009 #define OPENDDS_DCPS_RESTORE_OUTPUT_STREAM_STATE_H
00010 
00011 #include "../Versioned_Namespace.h"
00012 #include <ostream>
00013 
00014 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00015 
00016 namespace OpenDDS {
00017 namespace DCPS {
00018 
00019 struct RestoreOutputStreamState {
00020   explicit RestoreOutputStreamState(std::ostream& o)
00021     : os_(o), state_(o.flags()) {}
00022   ~RestoreOutputStreamState() {
00023     os_.flags(state_);
00024   }
00025   std::ostream& os_;
00026   std::ios_base::fmtflags state_;
00027 };
00028 
00029 } // namespace DCPS
00030 } // namespace OpenDDS
00031 
00032 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00033 
00034 #endif /* OPENDDS_DCPS_RESTORE_OUTPUT_STREAM_STATE_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1