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 id.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 08.01.2012 Chris@16: * Chris@16: * \brief This header is the Boost.Log library implementation, see the library documentation Chris@16: * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_DETAIL_ID_HPP_INCLUDED_ Chris@16: #define BOOST_LOG_DETAIL_ID_HPP_INCLUDED_ Chris@16: 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: namespace aux { Chris@16: Chris@16: //! Generic identifier class Chris@16: template< typename DescriptorT > Chris@16: class id Chris@16: { Chris@16: public: Chris@16: //! Native type of the process id Chris@16: typedef typename DescriptorT::native_type native_type; Chris@16: Chris@16: private: Chris@16: native_type m_NativeID; Chris@16: Chris@16: public: Chris@16: BOOST_CONSTEXPR id() BOOST_NOEXCEPT : m_NativeID(0) {} Chris@16: Chris@16: explicit id(native_type native) BOOST_NOEXCEPT : m_NativeID(native) {} Chris@16: Chris@16: native_type native_id() const BOOST_NOEXCEPT { return m_NativeID; } Chris@16: Chris@16: bool operator== (id const& that) const BOOST_NOEXCEPT Chris@16: { Chris@16: return (m_NativeID == that.m_NativeID); Chris@16: } Chris@16: bool operator!= (id const& that) const BOOST_NOEXCEPT Chris@16: { Chris@16: return (m_NativeID != that.m_NativeID); Chris@16: } Chris@16: bool operator< (id const& that) const BOOST_NOEXCEPT Chris@16: { Chris@16: return (m_NativeID < that.m_NativeID); Chris@16: } Chris@16: bool operator> (id const& that) const BOOST_NOEXCEPT Chris@16: { Chris@16: return (m_NativeID > that.m_NativeID); Chris@16: } Chris@16: bool operator<= (id const& that) const BOOST_NOEXCEPT Chris@16: { Chris@16: return (m_NativeID <= that.m_NativeID); Chris@16: } Chris@16: bool operator>= (id const& that) const BOOST_NOEXCEPT Chris@16: { Chris@16: return (m_NativeID >= that.m_NativeID); Chris@16: } Chris@16: }; Chris@16: Chris@16: } // namespace aux 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_DETAIL_ID_HPP_INCLUDED_