Chris@16: /* Chris@101: * Copyright Andrey Semashev 2007 - 2015. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: /*! Chris@16: * \file current_process_id.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 12.09.2009 Chris@16: * Chris@16: * The header contains implementation of a current process id attribute Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_ATTRIBUTES_CURRENT_PROCESS_ID_HPP_INCLUDED_ Chris@16: #define BOOST_LOG_ATTRIBUTES_CURRENT_PROCESS_ID_HPP_INCLUDED_ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #ifdef BOOST_HAS_PRAGMA_ONCE Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: BOOST_LOG_OPEN_NAMESPACE Chris@16: Chris@16: //! Process identifier type used by the library Chris@16: typedef boost::log::aux::process::id process_id; Chris@16: Chris@16: namespace attributes { Chris@16: Chris@16: /*! Chris@16: * \brief A class of an attribute that holds the current process identifier Chris@16: */ Chris@16: class current_process_id : Chris@16: public constant< process_id > Chris@16: { Chris@16: typedef constant< process_id > base_type; Chris@16: Chris@16: public: Chris@16: /*! Chris@16: * Constructor. Initializes the attribute with the current process identifier. Chris@16: */ Chris@16: current_process_id() : base_type(boost::log::aux::this_process::get_id()) {} Chris@16: /*! Chris@16: * Constructor for casting support Chris@16: */ Chris@16: explicit current_process_id(cast_source const& source) : Chris@16: base_type(source) Chris@16: { Chris@16: } Chris@16: }; Chris@16: Chris@16: } // namespace attributes Chris@16: Chris@16: BOOST_LOG_CLOSE_NAMESPACE // namespace log Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_LOG_ATTRIBUTES_CURRENT_PROCESS_ID_HPP_INCLUDED_