Boost C++ Libraries

PrevUpHomeNext

Struct sentry

boost::log::attributes::basic_named_scope::sentry — Sentry object class to automatically push and pop scopes.

Synopsis

// In header: <boost/log/attributes/named_scope.hpp>



// Sentry object class to automatically push and pop scopes.

struct sentry {
  // types
  typedef basic_named_scope< char_type > named_scope_type;  // Attribute type. 

  // construct/copy/destruct
  sentry(basic_string_literal< char_type > const &, 
         basic_string_literal< char_type > const &, unsigned int);
  ~sentry();
};

Description

sentry public construct/copy/destruct

  1. sentry(basic_string_literal< char_type > const & sn, 
           basic_string_literal< char_type > const & fn, unsigned int ln);

    Constructor. Pushes the specified scope to the end of the thread-local list of scopes.

    Parameters:
    fn

    File name, in which the scope is located.

    ln

    Line number in the file.

    sn

    Scope name.

  2. ~sentry();

    Destructor. Removes the last pushed scope from the thread-local list of scopes.


PrevUpHomeNext