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 {

  // public member functions
  sentry(string_literal const &, string_literal const &, unsigned int, 
         scope_entry::scope_name_type = scope_entry::general) noexcept;
  ~sentry() noexcept;
  sentry(sentry const &) = delete;
  sentry & operator=(sentry const &) = delete;
};

Description

sentry public member functions

  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:

    sn

    Scope name.

    fn

    File name, in which the scope is located.

    ln

    Line number in the file.

    t

    Scope name type.

  2. ~sentry() noexcept;

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

  3. sentry(sentry const &) = delete;
  4. sentry & operator=(sentry const &) = delete;

PrevUpHomeNext