Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Struct sentry

boost::log::attributes::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 {
  // construct/copy/destruct
  sentry(string_literal const &, string_literal const &, unsigned int, 
         scope_entry::scope_name_type = scope_entry::general) noexcept;
  sentry(sentry const &) = delete;
  sentry & operator=(sentry const &) = delete;
  ~sentry();
};

Description

sentry public construct/copy/destruct

  1. sentry(string_literal const & sn, string_literal const & fn, unsigned int ln, 
           scope_entry::scope_name_type t = scope_entry::general) noexcept;

    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(sentry const &) = delete;
  3. sentry & operator=(sentry const &) = delete;
  4. ~sentry();

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


PrevUpHomeNext