STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
basic_ostream< _Elem, _Traits >::sentry Class Reference
Inheritance diagram for basic_ostream< _Elem, _Traits >::sentry:
basic_ostream< _Elem, _Traits >::_Sentry_base

Public Member Functions

__CLR_OR_THIS_CALL sentry (_Myt &_Ostr)
 
__CLR_OR_THIS_CALL ~sentry () _NOEXCEPT
 
__CLR_OR_THIS_CALL operator bool () const
 
__CLR_OR_THIS_CALL sentry (const sentry &)=delete
 
sentry &__CLR_OR_THIS_CALL operator= (const sentry &)=delete
 
- Public Member Functions inherited from basic_ostream< _Elem, _Traits >::_Sentry_base
__CLR_OR_THIS_CALL _Sentry_base (_Myt &_Ostr)
 
__CLR_OR_THIS_CALL ~_Sentry_base () _NOEXCEPT
 

Private Attributes

bool _Ok
 

Additional Inherited Members

- Public Attributes inherited from basic_ostream< _Elem, _Traits >::_Sentry_base
_Myt_Myostr
 

Constructor & Destructor Documentation

template<class _Elem, class _Traits>
__CLR_OR_THIS_CALL basic_ostream< _Elem, _Traits >::sentry::sentry ( _Myt _Ostr)
inlineexplicit
122  : _Sentry_base(_Ostr)
123  { // construct locking and testing stream
124  if (_Ostr.good() && _Ostr.tie() != 0 && _Ostr.tie() != &_Ostr)
125  _Ostr.tie()->flush();
126  _Ok = _Ostr.good(); // store test only after flushing tie
127  }
__CLR_OR_THIS_CALL _Sentry_base(_Myt &_Ostr)
Definition: ostream:98
bool _Ok
Definition: ostream:149
template<class _Elem, class _Traits>
__CLR_OR_THIS_CALL basic_ostream< _Elem, _Traits >::sentry::~sentry ( )
inline
130  { // destroy the object
131  #if _HAS_EXCEPTIONS
132  if (!_XSTD uncaught_exception())
133  this->_Myostr._Osfx();
134 
135  #else /* _HAS_EXCEPTIONS */
136  this->_Myostr._Osfx();
137  #endif /* _HAS_EXCEPTIONS */
138  }
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL uncaught_exception() _NOEXCEPT
#define _XSTD
Definition: xstddef:21
_Myt & _Myostr
Definition: ostream:111
template<class _Elem, class _Traits>
__CLR_OR_THIS_CALL basic_ostream< _Elem, _Traits >::sentry::sentry ( const sentry )
delete

Member Function Documentation

template<class _Elem, class _Traits>
__CLR_OR_THIS_CALL basic_ostream< _Elem, _Traits >::sentry::operator bool ( ) const
inlineexplicit
141  { // test if stream state okay
142  return (_Ok);
143  }
bool _Ok
Definition: ostream:149
template<class _Elem, class _Traits>
sentry& __CLR_OR_THIS_CALL basic_ostream< _Elem, _Traits >::sentry::operator= ( const sentry )
delete

Member Data Documentation

template<class _Elem, class _Traits>
bool basic_ostream< _Elem, _Traits >::sentry::_Ok
private

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