mirror of https://gitee.com/bigwinds/arangodb
added even more files
This commit is contained in:
parent
1db6f9dfc7
commit
1bcc75f237
|
@ -0,0 +1,32 @@
|
|||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_CORE_HPP
|
||||
#define BOOST_COMPUTE_CORE_HPP
|
||||
|
||||
/// \file
|
||||
///
|
||||
/// Meta-header to include all Boost.Compute core headers.
|
||||
|
||||
#include <boost/compute/buffer.hpp>
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <boost/compute/config.hpp>
|
||||
#include <boost/compute/context.hpp>
|
||||
#include <boost/compute/device.hpp>
|
||||
#include <boost/compute/event.hpp>
|
||||
#include <boost/compute/kernel.hpp>
|
||||
#include <boost/compute/memory_object.hpp>
|
||||
#include <boost/compute/platform.hpp>
|
||||
#include <boost/compute/program.hpp>
|
||||
#include <boost/compute/system.hpp>
|
||||
#include <boost/compute/user_event.hpp>
|
||||
#include <boost/compute/version.hpp>
|
||||
|
||||
#endif // BOOST_COMPUTE_CORE_HPP
|
|
@ -0,0 +1,72 @@
|
|||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_INTEROP_EIGEN_EIGEN_HPP
|
||||
#define BOOST_COMPUTE_INTEROP_EIGEN_EIGEN_HPP
|
||||
|
||||
#include <Eigen/Core>
|
||||
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <boost/compute/algorithm/copy_n.hpp>
|
||||
#include <boost/compute/iterator/buffer_iterator.hpp>
|
||||
#include <boost/compute/type_traits/type_name.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
/// Copies \p matrix to \p buffer.
|
||||
template<class Derived>
|
||||
inline void eigen_copy_matrix_to_buffer(const Eigen::PlainObjectBase<Derived> &matrix,
|
||||
buffer_iterator<typename Derived::Scalar> buffer,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
::boost::compute::copy_n(matrix.data(), matrix.size(), buffer, queue);
|
||||
}
|
||||
|
||||
/// Copies \p buffer to \p matrix.
|
||||
template<class Derived>
|
||||
inline void eigen_copy_buffer_to_matrix(const buffer_iterator<typename Derived::Scalar> buffer,
|
||||
Eigen::PlainObjectBase<Derived> &matrix,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
::boost::compute::copy_n(buffer, matrix.size(), matrix.data(), queue);
|
||||
}
|
||||
|
||||
/// Converts an \c Eigen::Matrix4f to a \c float16_.
|
||||
inline float16_ eigen_matrix4f_to_float16(const Eigen::Matrix4f &matrix)
|
||||
{
|
||||
float16_ result;
|
||||
std::memcpy(&result, matrix.data(), 16 * sizeof(float));
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Converts an \c Eigen::Matrix4d to a \c double16_.
|
||||
inline double16_ eigen_matrix4d_to_double16(const Eigen::Matrix4d &matrix)
|
||||
{
|
||||
double16_ result;
|
||||
std::memcpy(&result, matrix.data(), 16 * sizeof(double));
|
||||
return result;
|
||||
}
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Vector2i, int2)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Vector4i, int4)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Vector2f, float2)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Vector4f, float4)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Matrix2f, float8)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Matrix4f, float16)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Vector2d, double2)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Vector4d, double4)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Matrix2d, double8)
|
||||
BOOST_COMPUTE_TYPE_NAME(Eigen::Matrix4d, double16)
|
||||
|
||||
#endif // BOOST_COMPUTE_INTEROP_EIGEN_EIGEN_HPP
|
|
@ -0,0 +1,141 @@
|
|||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_INTEROP_OPENCV_CORE_HPP
|
||||
#define BOOST_COMPUTE_INTEROP_OPENCV_CORE_HPP
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
#include <boost/compute/algorithm/copy_n.hpp>
|
||||
#include <boost/compute/exception/opencl_error.hpp>
|
||||
#include <boost/compute/image/image2d.hpp>
|
||||
#include <boost/compute/image/image_format.hpp>
|
||||
#include <boost/compute/iterator/buffer_iterator.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace compute {
|
||||
|
||||
template<class T>
|
||||
inline void opencv_copy_mat_to_buffer(const cv::Mat &mat,
|
||||
buffer_iterator<T> buffer,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
BOOST_ASSERT(mat.isContinuous());
|
||||
|
||||
::boost::compute::copy_n(
|
||||
reinterpret_cast<T *>(mat.data), mat.rows * mat.cols, buffer, queue
|
||||
);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void opencv_copy_buffer_to_mat(const buffer_iterator<T> buffer,
|
||||
cv::Mat &mat,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
BOOST_ASSERT(mat.isContinuous());
|
||||
|
||||
::boost::compute::copy_n(
|
||||
buffer, mat.cols * mat.rows, reinterpret_cast<T *>(mat.data), queue
|
||||
);
|
||||
}
|
||||
|
||||
inline void opencv_copy_mat_to_image(const cv::Mat &mat,
|
||||
image2d &image,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
BOOST_ASSERT(mat.data != 0);
|
||||
BOOST_ASSERT(mat.isContinuous());
|
||||
BOOST_ASSERT(image.get_context() == queue.get_context());
|
||||
|
||||
queue.enqueue_write_image(image, image.origin(), image.size(), mat.data);
|
||||
}
|
||||
|
||||
inline void opencv_copy_image_to_mat(const image2d &image,
|
||||
cv::Mat &mat,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
BOOST_ASSERT(mat.isContinuous());
|
||||
BOOST_ASSERT(image.get_context() == queue.get_context());
|
||||
|
||||
queue.enqueue_read_image(image, image.origin(), image.size(), mat.data);
|
||||
}
|
||||
|
||||
inline image_format opencv_get_mat_image_format(const cv::Mat &mat)
|
||||
{
|
||||
switch(mat.type()){
|
||||
case CV_8UC4:
|
||||
return image_format(CL_BGRA, CL_UNORM_INT8);
|
||||
case CV_16UC4:
|
||||
return image_format(CL_BGRA, CL_UNORM_INT16);
|
||||
case CV_32F:
|
||||
return image_format(CL_INTENSITY, CL_FLOAT);
|
||||
case CV_32FC4:
|
||||
return image_format(CL_RGBA, CL_FLOAT);
|
||||
case CV_8UC1:
|
||||
return image_format(CL_INTENSITY, CL_UNORM_INT8);
|
||||
}
|
||||
|
||||
BOOST_THROW_EXCEPTION(opencl_error(CL_IMAGE_FORMAT_NOT_SUPPORTED));
|
||||
}
|
||||
|
||||
inline cv::Mat opencv_create_mat_with_image2d(const image2d &image,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
BOOST_ASSERT(image.get_context() == queue.get_context());
|
||||
|
||||
cv::Mat mat;
|
||||
image_format format = image.get_format();
|
||||
const cl_image_format *cl_image_format = format.get_format_ptr();
|
||||
|
||||
if(cl_image_format->image_channel_data_type == CL_UNORM_INT8 &&
|
||||
cl_image_format->image_channel_order == CL_BGRA)
|
||||
{
|
||||
mat = cv::Mat(image.height(), image.width(), CV_8UC4);
|
||||
}
|
||||
else if(cl_image_format->image_channel_data_type == CL_UNORM_INT16 &&
|
||||
cl_image_format->image_channel_order == CL_BGRA)
|
||||
{
|
||||
mat = cv::Mat(image.height(), image.width(), CV_16UC4);
|
||||
}
|
||||
else if(cl_image_format->image_channel_data_type == CL_FLOAT &&
|
||||
cl_image_format->image_channel_order == CL_INTENSITY)
|
||||
{
|
||||
mat = cv::Mat(image.height(), image.width(), CV_32FC1);
|
||||
}
|
||||
else
|
||||
{
|
||||
mat = cv::Mat(image.height(), image.width(), CV_8UC1);
|
||||
}
|
||||
|
||||
opencv_copy_image_to_mat(image, mat, queue);
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
inline image2d opencv_create_image2d_with_mat(const cv::Mat &mat,
|
||||
cl_mem_flags flags,
|
||||
command_queue &queue = system::default_queue())
|
||||
{
|
||||
const context &context = queue.get_context();
|
||||
const image_format format = opencv_get_mat_image_format(mat);
|
||||
|
||||
image2d image(context, mat.cols, mat.rows, format, flags);
|
||||
|
||||
opencv_copy_mat_to_image(mat, image, queue);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
} // end compute namespace
|
||||
} // end boost namespace
|
||||
|
||||
#endif // BOOST_COMPUTE_INTEROP_OPENCV_CORE_HPP
|
|
@ -0,0 +1,22 @@
|
|||
/*!
|
||||
@file
|
||||
Defines the @ref group-core module.
|
||||
|
||||
@copyright Louis Dionne 2013-2016
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_HANA_CORE_HPP
|
||||
#define BOOST_HANA_CORE_HPP
|
||||
|
||||
#include <boost/hana/core/common.hpp>
|
||||
#include <boost/hana/core/to.hpp>
|
||||
#include <boost/hana/core/default.hpp>
|
||||
#include <boost/hana/core/dispatch.hpp>
|
||||
#include <boost/hana/core/is_a.hpp>
|
||||
#include <boost/hana/core/make.hpp>
|
||||
#include <boost/hana/core/tag_of.hpp>
|
||||
#include <boost/hana/core/when.hpp>
|
||||
|
||||
#endif // !BOOST_HANA_CORE_HPP
|
|
@ -0,0 +1,21 @@
|
|||
/*!
|
||||
@file
|
||||
Forward declares the @ref group-core module.
|
||||
|
||||
@copyright Louis Dionne 2013-2016
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_HANA_FWD_CORE_HPP
|
||||
#define BOOST_HANA_FWD_CORE_HPP
|
||||
|
||||
#include <boost/hana/fwd/core/common.hpp>
|
||||
#include <boost/hana/fwd/core/to.hpp>
|
||||
#include <boost/hana/fwd/core/default.hpp>
|
||||
#include <boost/hana/fwd/core/is_a.hpp>
|
||||
#include <boost/hana/fwd/core/make.hpp>
|
||||
#include <boost/hana/fwd/core/tag_of.hpp>
|
||||
#include <boost/hana/fwd/core/when.hpp>
|
||||
|
||||
#endif // !BOOST_HANA_FWD_CORE_HPP
|
|
@ -0,0 +1,79 @@
|
|||
// -- core.hpp -- Boost Lambda Library -------------------------------------
|
||||
//
|
||||
// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// For more information, see www.boost.org
|
||||
//
|
||||
// Includes the core of LL, without any real features for client:
|
||||
//
|
||||
// tuples, lambda functors, return type deduction templates,
|
||||
// argument substitution mechanism (select functions)
|
||||
//
|
||||
// Some functionality comes as well:
|
||||
// Assignment and subscript operators, as well as function
|
||||
// call operator for placeholder variables.
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_LAMBDA_CORE_HPP
|
||||
#define BOOST_LAMBDA_CORE_HPP
|
||||
|
||||
#include "boost/type_traits/transform_traits.hpp"
|
||||
#include "boost/type_traits/cv_traits.hpp"
|
||||
|
||||
#include "boost/tuple/tuple.hpp"
|
||||
|
||||
// inject some of the tuple names into lambda
|
||||
namespace boost {
|
||||
namespace lambda {
|
||||
|
||||
using ::boost::tuples::tuple;
|
||||
using ::boost::tuples::null_type;
|
||||
|
||||
} // lambda
|
||||
} // boost
|
||||
|
||||
#include "boost/lambda/detail/lambda_config.hpp"
|
||||
#include "boost/lambda/detail/lambda_fwd.hpp"
|
||||
|
||||
#include "boost/lambda/detail/arity_code.hpp"
|
||||
#include "boost/lambda/detail/actions.hpp"
|
||||
|
||||
#include "boost/lambda/detail/lambda_traits.hpp"
|
||||
|
||||
#include "boost/lambda/detail/function_adaptors.hpp"
|
||||
#include "boost/lambda/detail/return_type_traits.hpp"
|
||||
|
||||
#include "boost/lambda/detail/select_functions.hpp"
|
||||
|
||||
#include "boost/lambda/detail/lambda_functor_base.hpp"
|
||||
|
||||
#include "boost/lambda/detail/lambda_functors.hpp"
|
||||
|
||||
#include "boost/lambda/detail/ret.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace lambda {
|
||||
|
||||
namespace {
|
||||
|
||||
// These are constants types and need to be initialised
|
||||
boost::lambda::placeholder1_type free1 = boost::lambda::placeholder1_type();
|
||||
boost::lambda::placeholder2_type free2 = boost::lambda::placeholder2_type();
|
||||
boost::lambda::placeholder3_type free3 = boost::lambda::placeholder3_type();
|
||||
|
||||
boost::lambda::placeholder1_type& _1 = free1;
|
||||
boost::lambda::placeholder2_type& _2 = free2;
|
||||
boost::lambda::placeholder3_type& _3 = free3;
|
||||
// _1, _2, ... naming scheme by Peter Dimov
|
||||
} // unnamed
|
||||
|
||||
} // lambda
|
||||
} // boost
|
||||
|
||||
|
||||
#endif //BOOST_LAMBDA_CORE_HPP
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright Andrey Semashev 2007 - 2015.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/*!
|
||||
* \file log/core.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 19.04.2007
|
||||
*
|
||||
* This header includes Boost.Log headers related to the logging core.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_LOG_CORE_HPP_INCLUDED_
|
||||
#define BOOST_LOG_CORE_HPP_INCLUDED_
|
||||
|
||||
#include <boost/log/detail/config.hpp>
|
||||
|
||||
#include <boost/log/core/core.hpp>
|
||||
#include <boost/log/core/record.hpp>
|
||||
#include <boost/log/core/record_view.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#endif // BOOST_LOG_CORE_HPP_INCLUDED_
|
|
@ -0,0 +1,329 @@
|
|||
/*
|
||||
* Copyright Andrey Semashev 2007 - 2015.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/*!
|
||||
* \file core/core.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 19.04.2007
|
||||
*
|
||||
* This header contains logging core class definition.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_LOG_CORE_CORE_HPP_INCLUDED_
|
||||
#define BOOST_LOG_CORE_CORE_HPP_INCLUDED_
|
||||
|
||||
#include <utility>
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
#include <boost/log/detail/config.hpp>
|
||||
#include <boost/log/detail/light_function.hpp>
|
||||
#include <boost/log/core/record.hpp>
|
||||
#include <boost/log/attributes/attribute_set.hpp>
|
||||
#include <boost/log/attributes/attribute_name.hpp>
|
||||
#include <boost/log/attributes/attribute.hpp>
|
||||
#include <boost/log/attributes/attribute_value_set.hpp>
|
||||
#include <boost/log/expressions/filter.hpp>
|
||||
#include <boost/log/detail/header.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
BOOST_LOG_OPEN_NAMESPACE
|
||||
|
||||
#ifndef BOOST_LOG_DOXYGEN_PASS
|
||||
|
||||
namespace sinks {
|
||||
|
||||
class sink;
|
||||
|
||||
} // namespace sinks
|
||||
|
||||
#endif // BOOST_LOG_DOXYGEN_PASS
|
||||
|
||||
class core;
|
||||
|
||||
typedef shared_ptr< core > core_ptr;
|
||||
|
||||
/*!
|
||||
* \brief Logging library core class
|
||||
*
|
||||
* The logging core is used to interconnect log sources and sinks. It also provides
|
||||
* a number of basic features, like global filtering and global and thread-specific attribute storage.
|
||||
*
|
||||
* The logging core is a singleton. Users can acquire the core instance by calling the static method <tt>get</tt>.
|
||||
*/
|
||||
class core
|
||||
{
|
||||
public:
|
||||
//! Exception handler function type
|
||||
typedef boost::log::aux::light_function< void () > exception_handler_type;
|
||||
|
||||
private:
|
||||
//! Implementation type
|
||||
struct implementation;
|
||||
friend struct implementation;
|
||||
|
||||
private:
|
||||
//! A pointer to the implementation
|
||||
implementation* m_impl;
|
||||
|
||||
private:
|
||||
//! \cond
|
||||
core();
|
||||
//! \endcond
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Destructor. Destroys the core, releases any sinks and attributes that were registered.
|
||||
*/
|
||||
~core();
|
||||
|
||||
/*!
|
||||
* \return The method returns a pointer to the logging core singleton instance.
|
||||
*/
|
||||
BOOST_LOG_API static core_ptr get();
|
||||
|
||||
/*!
|
||||
* The method enables or disables logging.
|
||||
*
|
||||
* Setting this status to \c false allows you to completely wipe out any logging activity, including
|
||||
* filtering and generation of attribute values. It is useful if you want to completely disable logging
|
||||
* in a running application. The state of logging does not alter any other properties of the logging
|
||||
* library, such as filters or sinks, so you can enable logging with the very same settings that you had
|
||||
* when the logging was disabled.
|
||||
* This feature may also be useful if you want to perform major changes to logging configuration and
|
||||
* don't want your application to block on opening or pushing a log record.
|
||||
*
|
||||
* By default logging is enabled.
|
||||
*
|
||||
* \param enabled The actual flag of logging activity.
|
||||
* \return The previous value of enabled/disabled logging flag
|
||||
*/
|
||||
BOOST_LOG_API bool set_logging_enabled(bool enabled = true);
|
||||
/*!
|
||||
* The method allows to detect if logging is enabled. See the comment for \c set_logging_enabled.
|
||||
*/
|
||||
BOOST_LOG_API bool get_logging_enabled() const;
|
||||
|
||||
/*!
|
||||
* The method sets the global logging filter. The filter is applied to every log record that is processed.
|
||||
*
|
||||
* \param filter The filter function object to be installed.
|
||||
*/
|
||||
BOOST_LOG_API void set_filter(filter const& filter);
|
||||
/*!
|
||||
* The method removes the global logging filter. All log records are passed to sinks without global filtering applied.
|
||||
*/
|
||||
BOOST_LOG_API void reset_filter();
|
||||
|
||||
/*!
|
||||
* The method adds a new sink. The sink is included into logging process immediately after being added and until being removed.
|
||||
* No sink can be added more than once at the same time. If the sink is already registered, the call is ignored.
|
||||
*
|
||||
* \param s The sink to be registered.
|
||||
*/
|
||||
BOOST_LOG_API void add_sink(shared_ptr< sinks::sink > const& s);
|
||||
/*!
|
||||
* The method removes the sink from the output. The sink will not receive any log records after removal.
|
||||
* The call has no effect if the sink is not registered.
|
||||
*
|
||||
* \param s The sink to be unregistered.
|
||||
*/
|
||||
BOOST_LOG_API void remove_sink(shared_ptr< sinks::sink > const& s);
|
||||
/*!
|
||||
* The method removes all registered sinks from the output. The sinks will not receive any log records after removal.
|
||||
*/
|
||||
BOOST_LOG_API void remove_all_sinks();
|
||||
|
||||
/*!
|
||||
* The method performs flush on all registered sinks.
|
||||
*
|
||||
* \note This method may take long time to complete as it may block until all sinks manage to process all buffered log records.
|
||||
* The call will also block all logging attempts until the operation completes.
|
||||
*/
|
||||
BOOST_LOG_API void flush();
|
||||
|
||||
/*!
|
||||
* The method adds an attribute to the global attribute set. The attribute will be implicitly added to every log record.
|
||||
*
|
||||
* \param name The attribute name.
|
||||
* \param attr The attribute factory.
|
||||
* \return A pair of values. If the second member is \c true, then the attribute is added and the first member points to the
|
||||
* attribute. Otherwise the attribute was not added and the first member points to the attribute that prevents
|
||||
* addition.
|
||||
*/
|
||||
BOOST_LOG_API std::pair< attribute_set::iterator, bool > add_global_attribute(attribute_name const& name, attribute const& attr);
|
||||
/*!
|
||||
* The method removes an attribute from the global attribute set.
|
||||
*
|
||||
* \pre The attribute was added with the \c add_global_attribute call.
|
||||
* \post The attribute is no longer registered as a global attribute. The iterator is invalidated after removal.
|
||||
*
|
||||
* \param it Iterator to the previously added attribute.
|
||||
*/
|
||||
BOOST_LOG_API void remove_global_attribute(attribute_set::iterator it);
|
||||
|
||||
/*!
|
||||
* The method returns a copy of the complete set of currently registered global attributes.
|
||||
*/
|
||||
BOOST_LOG_API attribute_set get_global_attributes() const;
|
||||
/*!
|
||||
* The method replaces the complete set of currently registered global attributes with the provided set.
|
||||
*
|
||||
* \note The method invalidates all iterators and references that may have been returned
|
||||
* from the \c add_global_attribute method.
|
||||
*
|
||||
* \param attrs The set of attributes to be installed.
|
||||
*/
|
||||
BOOST_LOG_API void set_global_attributes(attribute_set const& attrs);
|
||||
|
||||
/*!
|
||||
* The method adds an attribute to the thread-specific attribute set. The attribute will be implicitly added to
|
||||
* every log record made in the current thread.
|
||||
*
|
||||
* \note In single-threaded build the effect is the same as adding the attribute globally. This, however, does
|
||||
* not imply that iterators to thread-specific and global attributes are interchangeable.
|
||||
*
|
||||
* \param name The attribute name.
|
||||
* \param attr The attribute factory.
|
||||
* \return A pair of values. If the second member is \c true, then the attribute is added and the first member points to the
|
||||
* attribute. Otherwise the attribute was not added and the first member points to the attribute that prevents
|
||||
* addition.
|
||||
*/
|
||||
BOOST_LOG_API std::pair< attribute_set::iterator, bool > add_thread_attribute(attribute_name const& name, attribute const& attr);
|
||||
/*!
|
||||
* The method removes an attribute from the thread-specific attribute set.
|
||||
*
|
||||
* \pre The attribute was added with the \c add_thread_attribute call.
|
||||
* \post The attribute is no longer registered as a thread-specific attribute. The iterator is invalidated after removal.
|
||||
*
|
||||
* \param it Iterator to the previously added attribute.
|
||||
*/
|
||||
BOOST_LOG_API void remove_thread_attribute(attribute_set::iterator it);
|
||||
|
||||
/*!
|
||||
* The method returns a copy of the complete set of currently registered thread-specific attributes.
|
||||
*/
|
||||
BOOST_LOG_API attribute_set get_thread_attributes() const;
|
||||
/*!
|
||||
* The method replaces the complete set of currently registered thread-specific attributes with the provided set.
|
||||
*
|
||||
* \note The method invalidates all iterators and references that may have been returned
|
||||
* from the \c add_thread_attribute method.
|
||||
*
|
||||
* \param attrs The set of attributes to be installed.
|
||||
*/
|
||||
BOOST_LOG_API void set_thread_attributes(attribute_set const& attrs);
|
||||
|
||||
/*!
|
||||
* The method sets exception handler function. The function will be called with no arguments
|
||||
* in case if an exception occurs during either \c open_record or \c push_record method
|
||||
* execution. Since exception handler is called from a \c catch statement, the exception
|
||||
* can be rethrown in order to determine its type.
|
||||
*
|
||||
* By default no handler is installed, thus any exception is propagated as usual.
|
||||
*
|
||||
* \sa See also: <tt>utility/exception_handler.hpp</tt>
|
||||
* \param handler Exception handling function
|
||||
*
|
||||
* \note The exception handler can be invoked in several threads concurrently.
|
||||
* Thread interruptions are not affected by exception handlers.
|
||||
*/
|
||||
BOOST_LOG_API void set_exception_handler(exception_handler_type const& handler);
|
||||
|
||||
/*!
|
||||
* The method attempts to open a new record to be written. While attempting to open a log record all filtering is applied.
|
||||
* A successfully opened record can be pushed further to sinks by calling the \c push_record method or simply destroyed by
|
||||
* destroying the returned object.
|
||||
*
|
||||
* More than one open records are allowed, such records exist independently. All attribute values are acquired during opening
|
||||
* the record and do not interact between records.
|
||||
*
|
||||
* The returned records can be copied, however, they must not be passed between different threads.
|
||||
*
|
||||
* \param source_attributes The set of source-specific attributes to be attached to the record to be opened.
|
||||
* \return A valid log record if the record is opened, an invalid record object if not (e.g. because it didn't pass filtering).
|
||||
*
|
||||
* \b Throws: If an exception handler is installed, only throws if the handler throws. Otherwise may
|
||||
* throw if one of the sinks throws, or some system resource limitation is reached.
|
||||
*/
|
||||
BOOST_LOG_API record open_record(attribute_set const& source_attributes);
|
||||
/*!
|
||||
* The method attempts to open a new record to be written. While attempting to open a log record all filtering is applied.
|
||||
* A successfully opened record can be pushed further to sinks by calling the \c push_record method or simply destroyed by
|
||||
* destroying the returned object.
|
||||
*
|
||||
* More than one open records are allowed, such records exist independently. All attribute values are acquired during opening
|
||||
* the record and do not interact between records.
|
||||
*
|
||||
* The returned records can be copied, however, they must not be passed between different threads.
|
||||
*
|
||||
* \param source_attributes The set of source-specific attribute values to be attached to the record to be opened.
|
||||
* \return A valid log record if the record is opened, an invalid record object if not (e.g. because it didn't pass filtering).
|
||||
*
|
||||
* \b Throws: If an exception handler is installed, only throws if the handler throws. Otherwise may
|
||||
* throw if one of the sinks throws, or some system resource limitation is reached.
|
||||
*/
|
||||
BOOST_LOG_API record open_record(attribute_value_set const& source_attributes);
|
||||
/*!
|
||||
* The method attempts to open a new record to be written. While attempting to open a log record all filtering is applied.
|
||||
* A successfully opened record can be pushed further to sinks by calling the \c push_record method or simply destroyed by
|
||||
* destroying the returned object.
|
||||
*
|
||||
* More than one open records are allowed, such records exist independently. All attribute values are acquired during opening
|
||||
* the record and do not interact between records.
|
||||
*
|
||||
* The returned records can be copied, however, they must not be passed between different threads.
|
||||
*
|
||||
* \param source_attributes The set of source-specific attribute values to be attached to the record to be opened. The contents
|
||||
* of this container are unspecified after this call.
|
||||
* \return A valid log record if the record is opened, an invalid record object if not (e.g. because it didn't pass filtering).
|
||||
*
|
||||
* \b Throws: If an exception handler is installed, only throws if the handler throws. Otherwise may
|
||||
* throw if one of the sinks throws, or some system resource limitation is reached.
|
||||
*/
|
||||
BOOST_FORCEINLINE record open_record(BOOST_RV_REF(attribute_value_set) source_attributes)
|
||||
{
|
||||
return open_record_move(static_cast< attribute_value_set& >(source_attributes));
|
||||
}
|
||||
|
||||
/*!
|
||||
* The method pushes the record to sinks. The record is moved from in the process.
|
||||
*
|
||||
* \pre <tt>!!rec == true</tt>
|
||||
* \post <tt>!rec == true</tt>
|
||||
* \param rec A previously successfully opened log record.
|
||||
*
|
||||
* \b Throws: If an exception handler is installed, only throws if the handler throws. Otherwise may
|
||||
* throw if one of the sinks throws.
|
||||
*/
|
||||
BOOST_FORCEINLINE void push_record(BOOST_RV_REF(record) rec)
|
||||
{
|
||||
push_record_move(static_cast< record& >(rec));
|
||||
}
|
||||
|
||||
BOOST_DELETED_FUNCTION(core(core const&))
|
||||
BOOST_DELETED_FUNCTION(core& operator= (core const&))
|
||||
|
||||
#ifndef BOOST_LOG_DOXYGEN_PASS
|
||||
private:
|
||||
//! Opens log record. This function is mostly needed to maintain ABI stable between C++03 and C++11.
|
||||
BOOST_LOG_API record open_record_move(attribute_value_set& source_attributes);
|
||||
//! The method pushes the record to sinks.
|
||||
BOOST_LOG_API void push_record_move(record& rec);
|
||||
#endif // BOOST_LOG_DOXYGEN_PASS
|
||||
};
|
||||
|
||||
BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/log/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_LOG_CORE_CORE_HPP_INCLUDED_
|
|
@ -0,0 +1,502 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2012-2012.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/move for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! \file
|
||||
//! This header implements macros to define movable classes and
|
||||
//! move-aware functions
|
||||
|
||||
#ifndef BOOST_MOVE_CORE_HPP
|
||||
#define BOOST_MOVE_CORE_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
#
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
#include <boost/move/detail/workaround.hpp>
|
||||
|
||||
// @cond
|
||||
|
||||
//boost_move_no_copy_constructor_or_assign typedef
|
||||
//used to detect noncopyable types for other Boost libraries.
|
||||
#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
|
||||
private:\
|
||||
TYPE(TYPE &);\
|
||||
TYPE& operator=(TYPE &);\
|
||||
public:\
|
||||
typedef int boost_move_no_copy_constructor_or_assign; \
|
||||
private:\
|
||||
//
|
||||
#else
|
||||
#define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \
|
||||
public:\
|
||||
TYPE(TYPE const &) = delete;\
|
||||
TYPE& operator=(TYPE const &) = delete;\
|
||||
public:\
|
||||
typedef int boost_move_no_copy_constructor_or_assign; \
|
||||
private:\
|
||||
//
|
||||
#endif //BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
|
||||
// @endcond
|
||||
|
||||
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
|
||||
#include <boost/move/detail/type_traits.hpp>
|
||||
|
||||
#if defined(BOOST_MOVE_ADDRESS_SANITIZER_ON)
|
||||
#define BOOST_MOVE_TO_RV_CAST(RV_TYPE, ARG) reinterpret_cast<RV_TYPE>(ARG)
|
||||
#else
|
||||
#define BOOST_MOVE_TO_RV_CAST(RV_TYPE, ARG) static_cast<RV_TYPE>(ARG)
|
||||
#endif
|
||||
|
||||
//Move emulation rv breaks standard aliasing rules so add workarounds for some compilers
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4) && \
|
||||
(\
|
||||
defined(BOOST_GCC) || \
|
||||
(defined(BOOST_INTEL) && (BOOST_INTEL_CXX_VERSION >= 1300)) \
|
||||
)
|
||||
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
|
||||
#else
|
||||
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// struct rv
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
template <class T>
|
||||
class rv
|
||||
: public ::boost::move_detail::if_c
|
||||
< ::boost::move_detail::is_class<T>::value
|
||||
, T
|
||||
, ::boost::move_detail::nat
|
||||
>::type
|
||||
{
|
||||
rv();
|
||||
~rv() throw();
|
||||
rv(rv const&);
|
||||
void operator=(rv const&);
|
||||
} BOOST_MOVE_ATTRIBUTE_MAY_ALIAS;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// is_rv
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace move_detail {
|
||||
|
||||
template <class T>
|
||||
struct is_rv
|
||||
//Derive from integral constant because some Boost code assummes it has
|
||||
//a "type" internal typedef
|
||||
: integral_constant<bool, ::boost::move_detail::is_rv_impl<T>::value >
|
||||
{};
|
||||
|
||||
template <class T>
|
||||
struct is_not_rv
|
||||
{
|
||||
static const bool value = !is_rv<T>::value;
|
||||
};
|
||||
|
||||
} //namespace move_detail {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// has_move_emulation_enabled
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
template<class T>
|
||||
struct has_move_emulation_enabled
|
||||
: ::boost::move_detail::has_move_emulation_enabled_impl<T>
|
||||
{};
|
||||
|
||||
template<class T>
|
||||
struct has_move_emulation_disabled
|
||||
{
|
||||
static const bool value = !::boost::move_detail::has_move_emulation_enabled_impl<T>::value;
|
||||
};
|
||||
|
||||
} //namespace boost {
|
||||
|
||||
#define BOOST_RV_REF(TYPE)\
|
||||
::boost::rv< TYPE >& \
|
||||
//
|
||||
|
||||
#define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
|
||||
::boost::rv< TYPE<ARG1, ARG2> >& \
|
||||
//
|
||||
|
||||
#define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
|
||||
::boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
|
||||
//
|
||||
|
||||
#define BOOST_RV_REF_BEG\
|
||||
::boost::rv< \
|
||||
//
|
||||
|
||||
#define BOOST_RV_REF_END\
|
||||
>& \
|
||||
//
|
||||
|
||||
#define BOOST_RV_REF_BEG_IF_CXX11 \
|
||||
\
|
||||
//
|
||||
|
||||
#define BOOST_RV_REF_END_IF_CXX11 \
|
||||
\
|
||||
//
|
||||
|
||||
#define BOOST_FWD_REF(TYPE)\
|
||||
const TYPE & \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF(TYPE)\
|
||||
const ::boost::rv< TYPE >& \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF_BEG \
|
||||
const ::boost::rv< \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF_END \
|
||||
>& \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
|
||||
const ::boost::rv< TYPE<ARG1, ARG2> >& \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
|
||||
const ::boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
|
||||
//
|
||||
|
||||
#define BOOST_CATCH_CONST_RLVALUE(TYPE)\
|
||||
const ::boost::rv< TYPE >& \
|
||||
//
|
||||
|
||||
namespace boost {
|
||||
namespace move_detail {
|
||||
|
||||
template <class Ret, class T>
|
||||
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
|
||||
< ::boost::move_detail::is_lvalue_reference<Ret>::value ||
|
||||
!::boost::has_move_emulation_enabled<T>::value
|
||||
, T&>::type
|
||||
move_return(T& x) BOOST_NOEXCEPT
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
template <class Ret, class T>
|
||||
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
|
||||
< !::boost::move_detail::is_lvalue_reference<Ret>::value &&
|
||||
::boost::has_move_emulation_enabled<T>::value
|
||||
, ::boost::rv<T>&>::type
|
||||
move_return(T& x) BOOST_NOEXCEPT
|
||||
{
|
||||
return *BOOST_MOVE_TO_RV_CAST(::boost::rv<T>*, ::boost::move_detail::addressof(x));
|
||||
}
|
||||
|
||||
template <class Ret, class T>
|
||||
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
|
||||
< !::boost::move_detail::is_lvalue_reference<Ret>::value &&
|
||||
::boost::has_move_emulation_enabled<T>::value
|
||||
, ::boost::rv<T>&>::type
|
||||
move_return(::boost::rv<T>& x) BOOST_NOEXCEPT
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
} //namespace move_detail {
|
||||
} //namespace boost {
|
||||
|
||||
#define BOOST_MOVE_RET(RET_TYPE, REF)\
|
||||
boost::move_detail::move_return< RET_TYPE >(REF)
|
||||
//
|
||||
|
||||
#define BOOST_MOVE_BASE(BASE_TYPE, ARG) \
|
||||
::boost::move((BASE_TYPE&)(ARG))
|
||||
//
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BOOST_MOVABLE_BUT_NOT_COPYABLE
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
|
||||
BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\
|
||||
public:\
|
||||
BOOST_MOVE_FORCEINLINE operator ::boost::rv<TYPE>&() \
|
||||
{ return *BOOST_MOVE_TO_RV_CAST(::boost::rv<TYPE>*, this); }\
|
||||
BOOST_MOVE_FORCEINLINE operator const ::boost::rv<TYPE>&() const \
|
||||
{ return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv<TYPE>*, this); }\
|
||||
private:\
|
||||
//
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BOOST_COPYABLE_AND_MOVABLE
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
|
||||
public:\
|
||||
BOOST_MOVE_FORCEINLINE TYPE& operator=(TYPE &t)\
|
||||
{ this->operator=(const_cast<const TYPE&>(t)); return *this;}\
|
||||
public:\
|
||||
BOOST_MOVE_FORCEINLINE operator ::boost::rv<TYPE>&() \
|
||||
{ return *BOOST_MOVE_TO_RV_CAST(::boost::rv<TYPE>*, this); }\
|
||||
BOOST_MOVE_FORCEINLINE operator const ::boost::rv<TYPE>&() const \
|
||||
{ return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv<TYPE>*, this); }\
|
||||
private:\
|
||||
//
|
||||
|
||||
#define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\
|
||||
public:\
|
||||
BOOST_MOVE_FORCEINLINE operator ::boost::rv<TYPE>&() \
|
||||
{ return *BOOST_MOVE_TO_RV_CAST(::boost::rv<TYPE>*, this); }\
|
||||
BOOST_MOVE_FORCEINLINE operator const ::boost::rv<TYPE>&() const \
|
||||
{ return *BOOST_MOVE_TO_RV_CAST(const ::boost::rv<TYPE>*, this); }\
|
||||
private:\
|
||||
//
|
||||
|
||||
namespace boost{
|
||||
namespace move_detail{
|
||||
|
||||
template< class T>
|
||||
struct forward_type
|
||||
{ typedef const T &type; };
|
||||
|
||||
template< class T>
|
||||
struct forward_type< boost::rv<T> >
|
||||
{ typedef T type; };
|
||||
|
||||
}}
|
||||
|
||||
#else //BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
//! This macro marks a type as movable but not copyable, disabling copy construction
|
||||
//! and assignment. The user will need to write a move constructor/assignment as explained
|
||||
//! in the documentation to fully write a movable but not copyable class.
|
||||
#define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
|
||||
BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\
|
||||
public:\
|
||||
typedef int boost_move_emulation_t;\
|
||||
private:\
|
||||
//
|
||||
|
||||
//! This macro marks a type as copyable and movable.
|
||||
//! The user will need to write a move constructor/assignment and a copy assignment
|
||||
//! as explained in the documentation to fully write a copyable and movable class.
|
||||
#define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
|
||||
//
|
||||
|
||||
#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
#define BOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\
|
||||
//
|
||||
#endif //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
|
||||
namespace boost {
|
||||
|
||||
//!This trait yields to a compile-time true boolean if T was marked as
|
||||
//!BOOST_MOVABLE_BUT_NOT_COPYABLE or BOOST_COPYABLE_AND_MOVABLE and
|
||||
//!rvalue references are not available on the platform. False otherwise.
|
||||
template<class T>
|
||||
struct has_move_emulation_enabled
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct has_move_emulation_disabled
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
} //namespace boost{
|
||||
|
||||
//!This macro is used to achieve portable syntax in move
|
||||
//!constructors and assignments for classes marked as
|
||||
//!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE
|
||||
#define BOOST_RV_REF(TYPE)\
|
||||
TYPE && \
|
||||
//
|
||||
|
||||
//!This macro is used to achieve portable syntax in move
|
||||
//!constructors and assignments for template classes marked as
|
||||
//!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE.
|
||||
//!As macros have problems with comma-separated template arguments,
|
||||
//!the template argument must be preceded with BOOST_RV_REF_BEG
|
||||
//!and ended with BOOST_RV_REF_END
|
||||
#define BOOST_RV_REF_BEG\
|
||||
\
|
||||
//
|
||||
|
||||
//!This macro is used to achieve portable syntax in move
|
||||
//!constructors and assignments for template classes marked as
|
||||
//!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE.
|
||||
//!As macros have problems with comma-separated template arguments,
|
||||
//!the template argument must be preceded with BOOST_RV_REF_BEG
|
||||
//!and ended with BOOST_RV_REF_END
|
||||
#define BOOST_RV_REF_END\
|
||||
&& \
|
||||
//
|
||||
|
||||
//!This macro expands to BOOST_RV_REF_BEG if BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
//!is not defined, empty otherwise
|
||||
#define BOOST_RV_REF_BEG_IF_CXX11 \
|
||||
BOOST_RV_REF_BEG \
|
||||
//
|
||||
|
||||
//!This macro expands to BOOST_RV_REF_END if BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
//!is not defined, empty otherwise
|
||||
#define BOOST_RV_REF_END_IF_CXX11 \
|
||||
BOOST_RV_REF_END \
|
||||
//
|
||||
|
||||
//!This macro is used to achieve portable syntax in copy
|
||||
//!assignment for classes marked as BOOST_COPYABLE_AND_MOVABLE.
|
||||
#define BOOST_COPY_ASSIGN_REF(TYPE)\
|
||||
const TYPE & \
|
||||
//
|
||||
|
||||
//! This macro is used to implement portable perfect forwarding
|
||||
//! as explained in the documentation.
|
||||
#define BOOST_FWD_REF(TYPE)\
|
||||
TYPE && \
|
||||
//
|
||||
|
||||
#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
|
||||
#define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
|
||||
TYPE<ARG1, ARG2> && \
|
||||
//
|
||||
|
||||
#define BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
|
||||
TYPE<ARG1, ARG2, ARG3> && \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF_BEG \
|
||||
const \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF_END \
|
||||
& \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
|
||||
const TYPE<ARG1, ARG2> & \
|
||||
//
|
||||
|
||||
#define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
|
||||
const TYPE<ARG1, ARG2, ARG3>& \
|
||||
//
|
||||
|
||||
#define BOOST_CATCH_CONST_RLVALUE(TYPE)\
|
||||
const TYPE & \
|
||||
//
|
||||
|
||||
#endif //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
|
||||
#if !defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
|
||||
//!This macro is used to achieve portable move return semantics.
|
||||
//!The C++11 Standard allows implicit move returns when the object to be returned
|
||||
//!is designated by a lvalue and:
|
||||
//! - The criteria for elision of a copy operation are met OR
|
||||
//! - The criteria would be met save for the fact that the source object is a function parameter
|
||||
//!
|
||||
//!For C++11 conforming compilers this macros only yields to REF:
|
||||
//! <code>return BOOST_MOVE_RET(RET_TYPE, REF);</code> -> <code>return REF;</code>
|
||||
//!
|
||||
//!For compilers without rvalue references
|
||||
//!this macro does an explicit move if the move emulation is activated
|
||||
//!and the return type (RET_TYPE) is not a reference.
|
||||
//!
|
||||
//!For non-conforming compilers with rvalue references like Visual 2010 & 2012,
|
||||
//!an explicit move is performed if RET_TYPE is not a reference.
|
||||
//!
|
||||
//! <b>Caution</b>: When using this macro in non-conforming or C++03
|
||||
//!compilers, a move will be performed even if the C++11 standard does not allow it
|
||||
//!(e.g. returning a static variable). The user is responsible for using this macro
|
||||
//!only to return local objects that met C++11 criteria.
|
||||
#define BOOST_MOVE_RET(RET_TYPE, REF)\
|
||||
REF
|
||||
//
|
||||
|
||||
#else //!defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
|
||||
#include <boost/move/detail/meta_utils.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace move_detail {
|
||||
|
||||
template <class Ret, class T>
|
||||
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
|
||||
< ::boost::move_detail::is_lvalue_reference<Ret>::value
|
||||
, T&>::type
|
||||
move_return(T& x) BOOST_NOEXCEPT
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
template <class Ret, class T>
|
||||
BOOST_MOVE_FORCEINLINE typename ::boost::move_detail::enable_if_c
|
||||
< !::boost::move_detail::is_lvalue_reference<Ret>::value
|
||||
, Ret && >::type
|
||||
move_return(T&& t) BOOST_NOEXCEPT
|
||||
{
|
||||
return static_cast< Ret&& >(t);
|
||||
}
|
||||
|
||||
} //namespace move_detail {
|
||||
} //namespace boost {
|
||||
|
||||
#define BOOST_MOVE_RET(RET_TYPE, REF)\
|
||||
boost::move_detail::move_return< RET_TYPE >(REF)
|
||||
//
|
||||
|
||||
#endif //!defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||
|
||||
//!This macro is used to achieve portable optimal move constructors.
|
||||
//!
|
||||
//!When implementing the move constructor, in C++03 compilers the moved-from argument must be
|
||||
//!cast to the base type before calling `::boost::move()` due to rvalue reference limitations.
|
||||
//!
|
||||
//!In C++11 compilers the cast from a rvalue reference of a derived type to a rvalue reference of
|
||||
//!a base type is implicit.
|
||||
#define BOOST_MOVE_BASE(BASE_TYPE, ARG) \
|
||||
::boost::move((BASE_TYPE&)(ARG))
|
||||
//
|
||||
|
||||
namespace boost {
|
||||
namespace move_detail {
|
||||
|
||||
template< class T> struct forward_type { typedef T type; };
|
||||
|
||||
}}
|
||||
|
||||
#endif //BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_CORE_HPP
|
|
@ -0,0 +1,25 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2001-2010 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef BOOST_PHOENIX_CORE_HPP
|
||||
#define BOOST_PHOENIX_CORE_HPP
|
||||
|
||||
#include <boost/phoenix/version.hpp>
|
||||
#include <boost/phoenix/core/limits.hpp>
|
||||
#include <boost/phoenix/core/actor.hpp>
|
||||
#include <boost/phoenix/core/debug.hpp>
|
||||
#include <boost/phoenix/core/is_actor.hpp>
|
||||
#include <boost/phoenix/core/argument.hpp>
|
||||
#include <boost/phoenix/core/value.hpp>
|
||||
#include <boost/phoenix/core/reference.hpp>
|
||||
#include <boost/phoenix/core/nothing.hpp>
|
||||
#include <boost/phoenix/core/function_equal.hpp>
|
||||
#include <boost/phoenix/core/visit_each.hpp>
|
||||
#include <boost/phoenix/core/v2_eval.hpp>
|
||||
#include <boost/phoenix/scope/local_variable.hpp> // to fix 5824
|
||||
#include <boost/proto/generate.hpp> // attempt to fix problems in intel 14.0.1
|
||||
|
||||
#endif
|
|
@ -0,0 +1,30 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file core.hpp
|
||||
/// Includes the core of Proto. Not included are the contexts, transforms and
|
||||
/// debugging utilities.
|
||||
//
|
||||
// Copyright 2008 Eric Niebler. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PROTO_CORE_HPP_EAN_04_01_2005
|
||||
#define BOOST_PROTO_CORE_HPP_EAN_04_01_2005
|
||||
|
||||
#include <boost/proto/proto_fwd.hpp>
|
||||
#include <boost/proto/args.hpp>
|
||||
#include <boost/proto/tags.hpp>
|
||||
#include <boost/proto/eval.hpp>
|
||||
#include <boost/proto/expr.hpp>
|
||||
#include <boost/proto/repeat.hpp>
|
||||
#include <boost/proto/traits.hpp>
|
||||
#include <boost/proto/domain.hpp>
|
||||
#include <boost/proto/fusion.hpp>
|
||||
#include <boost/proto/matches.hpp>
|
||||
#include <boost/proto/extends.hpp>
|
||||
#include <boost/proto/literal.hpp>
|
||||
#include <boost/proto/generate.hpp>
|
||||
#include <boost/proto/operators.hpp>
|
||||
#include <boost/proto/deep_copy.hpp>
|
||||
#include <boost/proto/make_expr.hpp>
|
||||
|
||||
#endif
|
|
@ -0,0 +1,73 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 1998-2003 Joel de Guzman
|
||||
Copyright (c) 2001-2003 Daniel Nuffer
|
||||
Copyright (c) 2001-2003 Hartmut Kaiser
|
||||
Copyright (c) 2002-2003 Martin Wille
|
||||
Copyright (c) 2002 Raghavendra Satish
|
||||
Copyright (c) 2001 Bruce Florman
|
||||
http://spirit.sourceforge.net/
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#if !defined(BOOST_SPIRIT_CORE_MAIN_HPP)
|
||||
#define BOOST_SPIRIT_CORE_MAIN_HPP
|
||||
|
||||
#include <boost/spirit/home/classic/version.hpp>
|
||||
#include <boost/spirit/home/classic/debug.hpp>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Spirit.Core includes
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Spirit.Core.Kernel
|
||||
#include <boost/spirit/home/classic/core/config.hpp>
|
||||
#include <boost/spirit/home/classic/core/nil.hpp>
|
||||
#include <boost/spirit/home/classic/core/match.hpp>
|
||||
#include <boost/spirit/home/classic/core/parser.hpp>
|
||||
|
||||
// Spirit.Core.Primitives
|
||||
#include <boost/spirit/home/classic/core/primitives/primitives.hpp>
|
||||
#include <boost/spirit/home/classic/core/primitives/numerics.hpp>
|
||||
|
||||
// Spirit.Core.Scanner
|
||||
#include <boost/spirit/home/classic/core/scanner/scanner.hpp>
|
||||
#include <boost/spirit/home/classic/core/scanner/skipper.hpp>
|
||||
|
||||
// Spirit.Core.NonTerminal
|
||||
#include <boost/spirit/home/classic/core/non_terminal/subrule.hpp>
|
||||
#include <boost/spirit/home/classic/core/non_terminal/rule.hpp>
|
||||
#include <boost/spirit/home/classic/core/non_terminal/grammar.hpp>
|
||||
|
||||
// Spirit.Core.Composite
|
||||
#include <boost/spirit/home/classic/core/composite/actions.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/composite.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/directives.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/epsilon.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/sequence.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/sequential_and.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/sequential_or.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/alternative.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/difference.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/intersection.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/exclusive_or.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/kleene_star.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/positive.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/optional.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/list.hpp>
|
||||
#include <boost/spirit/home/classic/core/composite/no_actions.hpp>
|
||||
|
||||
// Deprecated interface includes
|
||||
#include <boost/spirit/home/classic/actor/assign_actor.hpp>
|
||||
#include <boost/spirit/home/classic/actor/push_back_actor.hpp>
|
||||
|
||||
#if defined(BOOST_SPIRIT_DEBUG)
|
||||
//////////////////////////////////
|
||||
#include <boost/spirit/home/classic/debug/parser_names.hpp>
|
||||
|
||||
#endif // BOOST_SPIRIT_DEBUG
|
||||
|
||||
#endif // BOOST_SPIRIT_CORE_MAIN_HPP
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2001-2014 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_SPIRIT_X3_CORE_APRIL_04_2012_0318PM)
|
||||
#define BOOST_SPIRIT_X3_CORE_APRIL_04_2012_0318PM
|
||||
|
||||
#include <boost/spirit/home/x3/core/parse.hpp>
|
||||
//~ #include <boost/spirit/home/x3/core/parse_attr.hpp>
|
||||
#include <boost/spirit/home/x3/core/parser.hpp>
|
||||
#include <boost/spirit/home/x3/core/skip_over.hpp>
|
||||
#include <boost/spirit/home/x3/core/action.hpp>
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue