├── .gitignore ├── CMakeLists.txt ├── CMakeModules ├── BoostUtils.cmake ├── FindCheck.cmake └── XslTransform.cmake ├── README.md ├── doc ├── CMakeLists.txt ├── boostbook_catalog.xml ├── html │ ├── boostbook.css │ ├── docutils.css │ ├── images │ │ ├── alert.png │ │ ├── blank.png │ │ ├── callouts │ │ │ ├── 1.png │ │ │ ├── 1.svg │ │ │ ├── 10.png │ │ │ ├── 10.svg │ │ │ ├── 11.png │ │ │ ├── 11.svg │ │ │ ├── 12.png │ │ │ ├── 12.svg │ │ │ ├── 13.png │ │ │ ├── 13.svg │ │ │ ├── 14.png │ │ │ ├── 14.svg │ │ │ ├── 15.png │ │ │ ├── 15.svg │ │ │ ├── 16.svg │ │ │ ├── 17.svg │ │ │ ├── 18.svg │ │ │ ├── 19.svg │ │ │ ├── 2.png │ │ │ ├── 2.svg │ │ │ ├── 20.svg │ │ │ ├── 21.svg │ │ │ ├── 22.svg │ │ │ ├── 23.svg │ │ │ ├── 24.svg │ │ │ ├── 25.svg │ │ │ ├── 26.svg │ │ │ ├── 27.svg │ │ │ ├── 28.svg │ │ │ ├── 29.svg │ │ │ ├── 3.png │ │ │ ├── 3.svg │ │ │ ├── 30.svg │ │ │ ├── 4.png │ │ │ ├── 4.svg │ │ │ ├── 5.png │ │ │ ├── 5.svg │ │ │ ├── 6.png │ │ │ ├── 6.svg │ │ │ ├── 7.png │ │ │ ├── 7.svg │ │ │ ├── 8.png │ │ │ ├── 8.svg │ │ │ ├── 9.png │ │ │ └── 9.svg │ │ ├── caution.png │ │ ├── caution.svg │ │ ├── draft.png │ │ ├── home.png │ │ ├── home.svg │ │ ├── important.png │ │ ├── important.svg │ │ ├── next.png │ │ ├── next.svg │ │ ├── next_disabled.png │ │ ├── note.png │ │ ├── note.svg │ │ ├── prev.png │ │ ├── prev.svg │ │ ├── prev_disabled.png │ │ ├── smiley.png │ │ ├── tip.png │ │ ├── tip.svg │ │ ├── toc-blank.png │ │ ├── toc-minus.png │ │ ├── toc-plus.png │ │ ├── up.png │ │ ├── up.svg │ │ ├── up_disabled.png │ │ ├── warning.png │ │ └── warning.svg │ ├── minimal.css │ └── reference.css ├── noncopyable_dox.txt ├── quickref.xml ├── reference.dox ├── reference.xsl ├── requirements │ ├── CancellableQueue.qbk │ └── SimpleQueue.qbk ├── std_exception_dox.txt └── yamail.qbk ├── include ├── boost │ ├── tti │ │ ├── detail │ │ │ ├── dcomp_mem_fun.hpp │ │ │ ├── ddata.hpp │ │ │ ├── ddeftype.hpp │ │ │ ├── dftclass.hpp │ │ │ ├── dfunction.hpp │ │ │ ├── dlambda.hpp │ │ │ ├── dmem_data.hpp │ │ │ ├── dmem_fun.hpp │ │ │ ├── dmem_type.hpp │ │ │ ├── dmetafunc.hpp │ │ │ ├── dnotype.hpp │ │ │ ├── dnullptr.hpp │ │ │ ├── dplaceholder.hpp │ │ │ ├── dptmf.hpp │ │ │ ├── dstatic_mem_data.hpp │ │ │ ├── dstatic_mem_fun.hpp │ │ │ ├── dtclass.hpp │ │ │ ├── dtemplate.hpp │ │ │ ├── dtemplate_params.hpp │ │ │ ├── dtfunction.hpp │ │ │ ├── dtype.hpp │ │ │ └── dvm_template_params.hpp │ │ ├── gen │ │ │ ├── has_data_gen.hpp │ │ │ ├── has_function_gen.hpp │ │ │ ├── has_member_data_gen.hpp │ │ │ ├── has_member_function_gen.hpp │ │ │ ├── has_static_member_data_gen.hpp │ │ │ ├── has_static_member_function_gen.hpp │ │ │ ├── has_template_gen.hpp │ │ │ ├── has_type_gen.hpp │ │ │ ├── member_type_gen.hpp │ │ │ └── namespace_gen.hpp │ │ ├── has_data.hpp │ │ ├── has_function.hpp │ │ ├── has_member_data.hpp │ │ ├── has_member_function.hpp │ │ ├── has_static_member_data.hpp │ │ ├── has_static_member_function.hpp │ │ ├── has_template.hpp │ │ ├── has_type.hpp │ │ ├── member_type.hpp │ │ └── tti.hpp │ └── type_erasure │ │ ├── any.hpp │ │ ├── any_cast.hpp │ │ ├── binding.hpp │ │ ├── binding_of.hpp │ │ ├── builtin.hpp │ │ ├── call.hpp │ │ ├── callable.hpp │ │ ├── check_match.hpp │ │ ├── concept_interface.hpp │ │ ├── concept_of.hpp │ │ ├── config.hpp │ │ ├── constructible.hpp │ │ ├── deduced.hpp │ │ ├── derived.hpp │ │ ├── detail │ │ ├── access.hpp │ │ ├── adapt_to_vtable.hpp │ │ ├── any_base.hpp │ │ ├── check_call.hpp │ │ ├── check_map.hpp │ │ ├── const.hpp │ │ ├── construct.hpp │ │ ├── extract_concept.hpp │ │ ├── get_placeholders.hpp │ │ ├── get_signature.hpp │ │ ├── instantiate.hpp │ │ ├── macro.hpp │ │ ├── normalize.hpp │ │ ├── normalize_deduced.hpp │ │ ├── null.hpp │ │ ├── rebind_placeholders.hpp │ │ ├── storage.hpp │ │ └── vtable.hpp │ │ ├── exception.hpp │ │ ├── free.hpp │ │ ├── is_empty.hpp │ │ ├── is_placeholder.hpp │ │ ├── is_subconcept.hpp │ │ ├── iterator.hpp │ │ ├── member.hpp │ │ ├── operators.hpp │ │ ├── param.hpp │ │ ├── placeholder.hpp │ │ ├── placeholder_of.hpp │ │ ├── rebind_any.hpp │ │ ├── relaxed.hpp │ │ ├── require_match.hpp │ │ ├── same_type.hpp │ │ ├── static_binding.hpp │ │ ├── tuple.hpp │ │ └── typeid_of.hpp └── yamail │ ├── all.h │ ├── compat.h │ ├── compat │ ├── basics.h │ ├── bind.h │ ├── chrono.h │ ├── chrono_io.h │ ├── config.h │ ├── exception.h │ ├── function.h │ ├── make_unique.h │ ├── move.h │ ├── mutex.h │ ├── namespace.h │ ├── optional.h │ ├── ratio_io.h │ ├── shared_ptr.h │ ├── static_assert.h │ ├── system.h │ ├── thread.h │ ├── type_traits.h │ ├── unordered.h │ └── variant.h │ ├── concurrency.h │ ├── concurrency │ ├── async.h │ ├── coroutine.h │ ├── coroutine │ │ ├── all.h │ │ ├── attributes.h │ │ ├── clock_type.h │ │ ├── coroutine.h │ │ ├── coroutine_manager.h │ │ ├── coroutine_manager.inl │ │ ├── detail │ │ │ ├── coroutine_base.h │ │ │ ├── css.h │ │ │ ├── fifo.h │ │ │ ├── flags.h │ │ │ ├── scheduler.h │ │ │ ├── spawn.h │ │ │ ├── waiting_queue.h │ │ │ ├── worker_coroutine.h │ │ │ └── yield.h │ │ ├── error_code.h │ │ ├── namespace.h │ │ ├── round_robin.h │ │ ├── spawn.h │ │ └── yield.h │ ├── future.h │ ├── future │ │ ├── ChangeLog.txt │ │ ├── deprecated_cancel.html │ │ ├── future-doc.html │ │ ├── future.h │ │ ├── future_detail.h │ │ ├── future_error.h │ │ ├── future_exceptions.h │ │ ├── future_group.h │ │ └── future_stream.h │ ├── namespace.h │ └── spinlock.h │ ├── config.h │ ├── cplusplus.h │ ├── data.h │ ├── data │ ├── config │ │ ├── ast.h │ │ ├── ast_io.h │ │ ├── comments_parser.h │ │ ├── config_parser.h │ │ ├── detail │ │ │ ├── ast_cache_fwd.h │ │ │ ├── boost_fs_handler.h │ │ │ ├── file_cache.h │ │ │ ├── file_cache_fwd.h │ │ │ ├── fs_handler.h │ │ │ ├── importer.h │ │ │ ├── include_cache.h │ │ │ ├── include_dummy.h │ │ │ ├── include_opener.h │ │ │ ├── line_forward_iterator.h │ │ │ ├── line_iterator_fixed.h │ │ │ ├── normalize_path.h │ │ │ ├── parse.h │ │ │ └── parse_file.h │ │ ├── error_wrapper.h │ │ ├── grammar.h │ │ ├── namespace.h │ │ ├── parse_file.h │ │ ├── parse_iterator.h │ │ ├── parse_stream.h │ │ ├── parser.h │ │ ├── path_traits.h │ │ ├── paths_type.h │ │ └── utf8_parser.h │ ├── namespace.h │ ├── select_map.h │ └── zerocopy │ │ ├── fragment.h │ │ ├── iterator.h │ │ ├── namespace.h │ │ ├── segment.h │ │ └── streambuf.h │ ├── error.h │ ├── error │ └── error.h │ ├── iterator.h │ ├── iterator │ ├── boundary_iterator.h │ ├── codecvt_iterator.h │ ├── escape_iterator.h │ └── namespace.h │ ├── log.h │ ├── log │ ├── compat.h │ ├── detail │ │ └── process_name.h │ ├── log.h │ ├── log_rotate.h │ ├── namespace.h │ ├── rotate_text_file_backend.h │ ├── tskv_backend.h │ ├── typed.h │ ├── typed_backend.h │ ├── typed_backend_attr.h │ ├── typed_predefined.h │ ├── typed_xml.h │ └── uniq_task_log_attr.h │ ├── memory.h │ ├── memory │ ├── composite_limiter_factory.h │ ├── limited_allocator.h │ ├── limiters.h │ ├── limiters_repository.h │ └── namespace.h │ ├── namespace.h │ ├── traits.h │ ├── traits │ ├── disable_if_same_or_derived.h │ ├── enable_if_convertible.h │ ├── enable_if_value_or_ref.h │ ├── enable_type.h │ ├── is_complete.h │ └── namespace.h │ ├── utility.h │ ├── utility │ ├── apply.h │ ├── capture.h │ ├── copy_test.h │ ├── expected.h │ ├── in.h │ ├── list_of.h │ ├── namespace.h │ ├── rref.h │ ├── storage.h │ ├── update_iterator.h │ └── variant.h │ └── version.h ├── libyamail.spec ├── src ├── log │ ├── CMakeLists.txt │ ├── datetime_formatter.h │ ├── log-144.h │ ├── log-146.h │ ├── log-154.h │ ├── log.cc │ ├── log_rotate.cc │ ├── rotate_text_file_backend.cc │ └── uniq_task_log_attr.cc └── memory │ ├── composite_limiter_factory.cc │ ├── limiters.cc │ └── limiters_repository.cc └── tests ├── CMakeLists.txt ├── concurrency ├── CMakeLists.txt └── future │ ├── CMakeLists.txt │ └── future_group.cc ├── data ├── CMakeLists.txt ├── config │ ├── CMakeLists.txt │ ├── include_opener-2.cc │ ├── include_opener.cc │ ├── t │ └── t.cc ├── select_map ├── select_map.cc └── zerocopy │ ├── .gitignore │ ├── CMakeLists.txt │ ├── allocator_mock.h │ ├── fragment-test.cc │ ├── iterator-test.cc │ ├── segment-test.cc │ └── streambuf-test.cc ├── dummy-test.cc ├── main.cc └── memory ├── CMakeLists.txt ├── limited_allocator.cc └── limiters_repository.cc /.gitignore: -------------------------------------------------------------------------------- 1 | ThirdParty/ 2 | build/ 3 | *.swp 4 | *.swo 5 | *.h- 6 | CMakeFiles/ 7 | Makefile 8 | CMakeCache.txt 9 | tests/main-test 10 | 11 | # Compiled Object files 12 | *.slo 13 | *.lo 14 | *.o 15 | 16 | # Compiled Dynamic libraries 17 | *.so 18 | *.dylib 19 | 20 | # Compiled Static libraries 21 | *.lai 22 | *.la 23 | *.a 24 | -------------------------------------------------------------------------------- /CMakeModules/FindCheck.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the CHECK libraries 2 | # Once done this will define 3 | # 4 | # CHECK_FOUND - system has check 5 | # CHECK_INCLUDE_DIR - the check include directory 6 | # CHECK_LIBRARIES - check library 7 | # 8 | # Copyright (c) 2007 Daniel Gollub 9 | # Copyright (c) 2007 Bjoern Ricks 10 | # 11 | # Redistribution and use is allowed according to the terms of the New 12 | # BSD license. 13 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 14 | 15 | 16 | INCLUDE( FindPkgConfig ) 17 | 18 | # Take care about check.pc settings 19 | PKG_SEARCH_MODULE( CHECK check ) 20 | 21 | # Look for CHECK include dir and libraries 22 | IF( NOT CHECK_FOUND ) 23 | 24 | FIND_PATH( CHECK_INCLUDE_DIR check.h ) 25 | 26 | FIND_LIBRARY( CHECK_LIBRARIES NAMES check ) 27 | 28 | IF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) 29 | SET( CHECK_FOUND 1 ) 30 | IF ( NOT Check_FIND_QUIETLY ) 31 | MESSAGE ( STATUS "Found CHECK: ${CHECK_LIBRARIES}" ) 32 | ENDIF ( NOT Check_FIND_QUIETLY ) 33 | ELSE ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) 34 | IF ( Check_FIND_REQUIRED ) 35 | MESSAGE( FATAL_ERROR "Could NOT find CHECK" ) 36 | ELSE ( Check_FIND_REQUIRED ) 37 | IF ( NOT Check_FIND_QUIETLY ) 38 | MESSAGE( STATUS "Could NOT find CHECK" ) 39 | ENDIF ( NOT Check_FIND_QUIETLY ) 40 | ENDIF ( Check_FIND_REQUIRED ) 41 | ENDIF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES ) 42 | ENDIF( NOT CHECK_FOUND ) 43 | 44 | # Hide advanced variables from CMake GUIs 45 | MARK_AS_ADVANCED( CHECK_INCLUDE_DIR CHECK_LIBRARIES ) 46 | 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The project was forked into https://github.com/YandexMail/yamail. 2 | Please, use that project instead. 3 | -------------------------------------------------------------------------------- /doc/boostbook_catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/html/images/alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/alert.png -------------------------------------------------------------------------------- /doc/html/images/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/blank.png -------------------------------------------------------------------------------- /doc/html/images/callouts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/1.png -------------------------------------------------------------------------------- /doc/html/images/callouts/1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /doc/html/images/callouts/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/10.png -------------------------------------------------------------------------------- /doc/html/images/callouts/10.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/images/callouts/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/11.png -------------------------------------------------------------------------------- /doc/html/images/callouts/11.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/html/images/callouts/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/12.png -------------------------------------------------------------------------------- /doc/html/images/callouts/12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/images/callouts/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/13.png -------------------------------------------------------------------------------- /doc/html/images/callouts/13.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/14.png -------------------------------------------------------------------------------- /doc/html/images/callouts/14.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/html/images/callouts/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/15.png -------------------------------------------------------------------------------- /doc/html/images/callouts/15.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/16.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/17.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/html/images/callouts/18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/html/images/callouts/19.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/2.png -------------------------------------------------------------------------------- /doc/html/images/callouts/2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/html/images/callouts/20.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/21.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/images/callouts/22.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/23.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/html/images/callouts/24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/25.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/html/images/callouts/26.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/html/images/callouts/27.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/28.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/html/images/callouts/29.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/html/images/callouts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/3.png -------------------------------------------------------------------------------- /doc/html/images/callouts/3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/30.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 17 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/html/images/callouts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/4.png -------------------------------------------------------------------------------- /doc/html/images/callouts/4.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/html/images/callouts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/5.png -------------------------------------------------------------------------------- /doc/html/images/callouts/5.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/images/callouts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/6.png -------------------------------------------------------------------------------- /doc/html/images/callouts/6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/7.png -------------------------------------------------------------------------------- /doc/html/images/callouts/7.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/html/images/callouts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/8.png -------------------------------------------------------------------------------- /doc/html/images/callouts/8.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/callouts/9.png -------------------------------------------------------------------------------- /doc/html/images/callouts/9.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/caution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/caution.png -------------------------------------------------------------------------------- /doc/html/images/draft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/draft.png -------------------------------------------------------------------------------- /doc/html/images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/home.png -------------------------------------------------------------------------------- /doc/html/images/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | ]> 11 | 12 | 13 | 14 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/images/important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/important.png -------------------------------------------------------------------------------- /doc/html/images/important.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | ]> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/images/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/next.png -------------------------------------------------------------------------------- /doc/html/images/next.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | ]> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/next_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/next_disabled.png -------------------------------------------------------------------------------- /doc/html/images/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/note.png -------------------------------------------------------------------------------- /doc/html/images/note.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ]> 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /doc/html/images/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/prev.png -------------------------------------------------------------------------------- /doc/html/images/prev.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | ]> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/prev_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/prev_disabled.png -------------------------------------------------------------------------------- /doc/html/images/smiley.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/smiley.png -------------------------------------------------------------------------------- /doc/html/images/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/tip.png -------------------------------------------------------------------------------- /doc/html/images/toc-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/toc-blank.png -------------------------------------------------------------------------------- /doc/html/images/toc-minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/toc-minus.png -------------------------------------------------------------------------------- /doc/html/images/toc-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/toc-plus.png -------------------------------------------------------------------------------- /doc/html/images/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/up.png -------------------------------------------------------------------------------- /doc/html/images/up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | ]> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/up_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/up_disabled.png -------------------------------------------------------------------------------- /doc/html/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/images/warning.png -------------------------------------------------------------------------------- /doc/html/images/warning.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | ]> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/html/minimal.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/doc/html/minimal.css -------------------------------------------------------------------------------- /doc/html/reference.css: -------------------------------------------------------------------------------- 1 | /*============================================================================ 2 | Copyright 2003-2004 Douglas Gregor 3 | Distributed under the Boost Software License, Version 1.0. (See accompany- 4 | ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | ============================================================================*/ 6 | 7 | PRE.synopsis { 8 | background-color: #e0ffff; 9 | border: thin solid blue; 10 | padding: 1em 11 | } -------------------------------------------------------------------------------- /doc/noncopyable_dox.txt: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | 8 | /** 9 | \namespace boost 10 | */ 11 | 12 | /** 13 | \class noncopyable 14 | */ 15 | -------------------------------------------------------------------------------- /doc/requirements/CancellableQueue.qbk: -------------------------------------------------------------------------------- 1 | [/ 2 | / Copyright (c) 2008-2012 Nikki Chumakov (nikki at yandex-team dot ru) 3 | / 4 | / Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | /] 7 | 8 | [section:CancellableQueue Cancellable Queue requirements] 9 | 10 | A simple queue must meet the requirements of `CopyConstructible` types (C++ Std, 11 | 20.1.3), and the requirements of `Assignable` types (C++ Std, 23.1). 12 | 13 | In the table below, `X` denotes a simple queue class, and `a` denotes a value of 14 | `X`, `Y` denotes X::value_type type, and `v` denotes a value of `Y`, and `e` 15 | denotes the reference to `Y` value. 16 | 17 | [table CancellableQueue requirements 18 | [[expression] [return type] [assertion/note[br]pre/post-conditions]] 19 | [ 20 | [`a.push_iter_i(v);`] 21 | [`X::iterator`] 22 | [ 23 | post: ... 24 | ] 25 | ] 26 | [ 27 | [`a.pop_iter_i(e);`] 28 | [`X::iterator`] 29 | [ 30 | post: `e` contains the value from `a`. 31 | ] 32 | ] 33 | [ 34 | [`a.erase_iter_i(i);`] 35 | [] 36 | [ 37 | post: `e` contains the value from `a`. 38 | ] 39 | ] 40 | ] 41 | 42 | [endsect] 43 | -------------------------------------------------------------------------------- /doc/requirements/SimpleQueue.qbk: -------------------------------------------------------------------------------- 1 | [/ 2 | / Copyright (c) 2008-2012 Nikki Chumakov (nikki at yandex-team dot ru) 3 | / 4 | / Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | /] 7 | 8 | [section:SimpleQueue Simple Queue requirements] 9 | 10 | A simple queue must meet the requirements of `CopyConstructible` types (C++ Std, 11 | 20.1.3), and the requirements of `Assignable` types (C++ Std, 23.1). 12 | 13 | In the table below, `X` denotes a simple queue class, and `a` denotes a 14 | value of `X`, `Y` denotes X::value_type type, and `v` denotes a value of `Y`, 15 | and `e` denotes the reference to `Y` value. 16 | 17 | [table SimpleQueue requirements 18 | [[expression] [return type] [assertion/note[br]pre/post-conditions]] 19 | [ 20 | [`a.push_i(v);`] 21 | [] 22 | [ 23 | post: ... 24 | ] 25 | ] 26 | [ 27 | [`a.pop_i(e);`] 28 | [] 29 | [ 30 | post: `e` contains the value from `a`. 31 | ] 32 | ] 33 | ] 34 | 35 | [endsect] 36 | -------------------------------------------------------------------------------- /doc/std_exception_dox.txt: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | 8 | /** 9 | \namespace std 10 | */ 11 | 12 | /** 13 | \class std::exception 14 | */ 15 | -------------------------------------------------------------------------------- /doc/yamail.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | YaMail 3 | 4 | Use, modification and distribution is subject to the Boost Software License, 5 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | http://www.boost.org/LICENSE_1_0.txt) 7 | =============================================================================/] 8 | 9 | [library YaMail 10 | [quickbook 1.6] 11 | [version 1.0] 12 | [id yamail] 13 | [purpose Networking library] 14 | [authors [Chumakov, Nikki]] 15 | [copyright 2014 Yandex LLC] 16 | [category template] 17 | [category io] 18 | [license 19 | Distributed under the Boost Software License, Version 1.0. 20 | (See accompanying file LICENSE_1_0.txt or copy at 21 | [@http://www.boost.org/LICENSE_1_0.txt]) 22 | ] 23 | [source-mode c++] 24 | ] 25 | 26 | [def __boost__ Boost] 27 | [def __yamail__ YaMail] 28 | [def __boost_asio__ [@http://www.boost.org/libs/asio/ Boost.ASIO]] 29 | [def __boost_thread__ [@http://www.boost.org/libs/thread/ Boost.Thread]] 30 | [def __boost_filesystem__ [@http://www.boost.org/libs/filesystem/ Boost.Filesystem]] 31 | [def __boost_iostreams__ [@http://www.boost.org/libs/iostreams/ Boost.Iostreams]] 32 | 33 | [import ../include/yamail/config.h] 34 | 35 | [section:introduction Introduction] 36 | __yamail__ is a network asyncronous library and a branch of helper function. 37 | 38 | As a very quick example of minimal usage: 39 | 40 | [call_example] 41 | 42 | [endsect] [/introduction] 43 | 44 | [include reference.qbk] 45 | [/ 46 | include design_rationale.qbk 47 | include compiling.qbk 48 | include quickstart.qbk 49 | include reference.qbk 50 | include advanced_topics.qbk 51 | include release_notes.qbk 52 | include acknowledgments.qbk/] 53 | -------------------------------------------------------------------------------- /include/boost/tti/detail/ddata.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_DATA_HPP) 8 | #define BOOST_TTI_DETAIL_DATA_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define BOOST_TTI_DETAIL_TRAIT_HAS_DATA(trait,name) \ 16 | BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA(trait,name) \ 17 | BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \ 18 | template \ 19 | struct BOOST_PP_CAT(trait,_detail_hd) : \ 20 | boost::mpl::or_ \ 21 | < \ 22 | BOOST_PP_CAT(trait,_detail_hmd_with_enclosing_class), \ 23 | BOOST_PP_CAT(trait,_detail_hsd) \ 24 | > \ 25 | { \ 26 | }; \ 27 | /**/ 28 | 29 | #endif // BOOST_TTI_DETAIL_DATA_HPP 30 | -------------------------------------------------------------------------------- /include/boost/tti/detail/ddeftype.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_DEFTYPE_HPP) 8 | #define BOOST_TTI_DETAIL_DEFTYPE_HPP 9 | 10 | namespace boost 11 | { 12 | namespace tti 13 | { 14 | namespace detail 15 | { 16 | struct deftype 17 | { 18 | }; 19 | } 20 | } 21 | } 22 | 23 | #endif // BOOST_TTI_DETAIL_DEFTYPE_HPP 24 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dftclass.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_FTCLASS_HPP) 8 | #define BOOST_TTI_DETAIL_FTCLASS_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | namespace boost 17 | { 18 | namespace tti 19 | { 20 | namespace detail 21 | { 22 | template 23 | struct class_type : 24 | boost::mpl::at 25 | < 26 | typename 27 | boost::function_types::parameter_types 28 | < 29 | BOOST_TTI_DETAIL_TP_F, 30 | boost::mpl::quote1 31 | < 32 | boost::mpl::identity 33 | > 34 | >::type, 35 | boost::mpl::int_<0> 36 | > 37 | { 38 | }; 39 | } 40 | } 41 | } 42 | 43 | #endif // BOOST_TTI_DETAIL_FTCLASS_HPP 44 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dfunction.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_FUNCTION_HPP) 8 | #define BOOST_TTI_DETAIL_FUNCTION_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION(trait,name) \ 17 | BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \ 18 | BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \ 19 | template \ 20 | struct BOOST_PP_CAT(trait,_detail_hf) : \ 21 | boost::mpl::or_ \ 22 | < \ 23 | BOOST_PP_CAT(trait,_detail_call_types), \ 24 | BOOST_PP_CAT(trait,_detail_ihsmf) \ 25 | < \ 26 | BOOST_TTI_DETAIL_TP_T, \ 27 | typename BOOST_TTI_NAMESPACE::detail::tfunction_seq::type \ 28 | > \ 29 | > \ 30 | { \ 31 | }; \ 32 | /**/ 33 | 34 | #endif // BOOST_TTI_DETAIL_FUNCTION_HPP 35 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dlambda.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_LAMBDA_HPP) 8 | #define BOOST_TTI_DETAIL_LAMBDA_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace boost 16 | { 17 | namespace tti 18 | { 19 | namespace detail 20 | { 21 | template 22 | struct is_lambda_expression : 23 | boost::mpl::or_ 24 | < 25 | BOOST_TTI_NAMESPACE::detail::is_metafunction_class, 26 | BOOST_TTI_NAMESPACE::detail::is_placeholder_expression 27 | > 28 | { 29 | }; 30 | } 31 | } 32 | } 33 | 34 | #endif // BOOST_TTI_DETAIL_LAMBDA_HPP 35 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dmem_type.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_MEM_TYPE_HPP) 8 | #define BOOST_TTI_DETAIL_MEM_TYPE_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE_OP(trait,name) \ 18 | BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(trait,_detail_mpl), name, false) \ 19 | template \ 20 | struct BOOST_PP_CAT(trait,_detail_op) : \ 21 | BOOST_PP_CAT(trait,_detail_mpl) \ 22 | { \ 23 | }; \ 24 | /**/ 25 | 26 | #define BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE(trait,name) \ 27 | BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE_OP(trait,name) \ 28 | template \ 29 | struct BOOST_PP_CAT(trait,_detail) \ 30 | { \ 31 | typedef typename \ 32 | boost::mpl::eval_if \ 33 | < \ 34 | boost::is_class, \ 35 | BOOST_PP_CAT(trait,_detail_op), \ 36 | boost::mpl::false_ \ 37 | >::type type; \ 38 | \ 39 | BOOST_STATIC_CONSTANT(bool,value=type::value); \ 40 | }; \ 41 | /**/ 42 | 43 | #define BOOST_TTI_DETAIL_TRAIT_MEMBER_TYPE(trait,name) \ 44 | template \ 45 | struct BOOST_PP_CAT(trait,_detail_member_type) \ 46 | { \ 47 | typedef typename BOOST_TTI_DETAIL_TP_T::name type; \ 48 | }; \ 49 | /**/ 50 | 51 | #endif // BOOST_TTI_DETAIL_MEM_TYPE_HPP 52 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dmetafunc.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_METAFUNC_HPP) 8 | #define BOOST_TTI_DETAIL_METAFUNC_HPP 9 | 10 | #include 11 | #include 12 | 13 | namespace boost 14 | { 15 | namespace tti 16 | { 17 | namespace detail 18 | { 19 | BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF(is_metafunction_class_apply, apply, false) 20 | template 21 | struct is_metafunction_class : 22 | BOOST_TTI_NAMESPACE::detail::is_metafunction_class_apply 23 | { 24 | }; 25 | } 26 | } 27 | } 28 | 29 | #endif // BOOST_TTI_DETAIL_METAFUNC_HPP 30 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dnotype.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_NOTYPE_HPP) 8 | #define BOOST_TTI_DETAIL_NOTYPE_HPP 9 | 10 | namespace boost 11 | { 12 | namespace tti 13 | { 14 | namespace detail 15 | { 16 | struct notype 17 | { 18 | }; 19 | } 20 | } 21 | } 22 | 23 | #endif // BOOST_TTI_DETAIL_NOTYPE_HPP 24 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dnullptr.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_NULLPTR_HPP) 8 | #define BOOST_TTI_DETAIL_NULLPTR_HPP 9 | 10 | #include 11 | 12 | #if defined(BOOST_NO_CXX11_NULLPTR) 13 | 14 | #define BOOST_TTI_DETAIL_NULLPTR 0 15 | 16 | #else // !BOOST_NO_CXX11_NULLPTR 17 | 18 | #define BOOST_TTI_DETAIL_NULLPTR nullptr 19 | 20 | #endif // BOOST_NO_CXX11_NULLPTR 21 | 22 | #endif // BOOST_TTI_DETAIL_NULLPTR_HPP 23 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dplaceholder.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_PLACEHOLDER_HPP) 8 | #define BOOST_TTI_DETAIL_PLACEHOLDER_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace boost 15 | { 16 | namespace tti 17 | { 18 | namespace detail 19 | { 20 | template 21 | struct is_placeholder_expression : 22 | boost::mpl::not_ 23 | < 24 | boost::is_same 25 | < 26 | typename boost::mpl::lambda::type, 27 | BOOST_TTI_DETAIL_TP_T 28 | > 29 | > 30 | { 31 | }; 32 | } 33 | } 34 | } 35 | 36 | #endif // BOOST_TTI_DETAIL_PLACEHOLDER_HPP 37 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dptmf.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_PTMF_HPP) 8 | #define BOOST_TTI_DETAIL_PTMF_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace boost 15 | { 16 | namespace tti 17 | { 18 | namespace detail 19 | { 20 | template 21 | < 22 | class BOOST_TTI_DETAIL_TP_T, 23 | class BOOST_TTI_DETAIL_TP_R, 24 | class BOOST_TTI_DETAIL_TP_FS, 25 | class BOOST_TTI_DETAIL_TP_TAG 26 | > 27 | struct ptmf_seq 28 | { 29 | typedef typename 30 | boost::function_types::member_function_pointer 31 | < 32 | typename 33 | boost::mpl::push_front 34 | < 35 | typename 36 | boost::mpl::push_front::type, 37 | BOOST_TTI_DETAIL_TP_R 38 | >::type, 39 | BOOST_TTI_DETAIL_TP_TAG 40 | >::type type; 41 | }; 42 | } 43 | } 44 | } 45 | 46 | #endif // BOOST_TTI_DETAIL_PTMF_HPP 47 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dtclass.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_TCLASS_HPP) 8 | #define BOOST_TTI_DETAIL_TCLASS_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace boost 15 | { 16 | namespace tti 17 | { 18 | namespace detail 19 | { 20 | template 21 | struct tclass : 22 | boost::mpl::eval_if 23 | < 24 | boost::is_class, 25 | BOOST_TTI_DETAIL_TP_T, 26 | boost::mpl::identity 27 | > 28 | { 29 | }; 30 | } 31 | } 32 | } 33 | 34 | #endif // BOOST_TTI_DETAIL_TCLASS_HPP 35 | -------------------------------------------------------------------------------- /include/boost/tti/detail/dtfunction.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012,2013 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DETAIL_TFUNCTION_HPP) 8 | #define BOOST_TTI_DETAIL_TFUNCTION_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace boost 15 | { 16 | namespace tti 17 | { 18 | namespace detail 19 | { 20 | template 21 | < 22 | class BOOST_TTI_DETAIL_TP_R, 23 | class BOOST_TTI_DETAIL_TP_FS, 24 | class BOOST_TTI_DETAIL_TP_TAG 25 | > 26 | struct tfunction_seq 27 | { 28 | typedef typename boost::mpl::push_front::type ftseq; 29 | typedef typename boost::function_types::function_type::type type; 30 | }; 31 | } 32 | } 33 | } 34 | 35 | #endif // BOOST_TTI_DETAIL_TFUNCTION_HPP 36 | -------------------------------------------------------------------------------- /include/boost/tti/gen/has_data_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_DATA_GEN_HPP) 8 | #define BOOST_TTI_DATA_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_HAS_DATA. 22 | /** 23 | name = the name of the member data. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_HAS_DATA_GEN(name) \ 28 | BOOST_PP_CAT(has_data_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_DATA_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/has_function_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_FUNCTION_GEN_HPP) 8 | #define BOOST_TTI_FUNCTION_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_HAS_FUNCTION. 22 | /** 23 | name = the name of the static member function. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_HAS_FUNCTION_GEN(name) \ 28 | BOOST_PP_CAT(has_function_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_FUNCTION_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/has_member_data_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_MEMBER_DATA_GEN_HPP) 8 | #define BOOST_TTI_MEMBER_DATA_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_HAS_MEMBER_DATA. 22 | /** 23 | name = the name of the member data. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_HAS_MEMBER_DATA_GEN(name) \ 28 | BOOST_PP_CAT(has_member_data_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_MEMBER_DATA_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/has_member_function_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_MEMBER_FUNCTION_GEN_HPP) 8 | #define BOOST_TTI_MEMBER_FUNCTION_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_HAS_MEMBER_FUNCTION. 22 | /** 23 | name = the name of the member function. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(name) \ 28 | BOOST_PP_CAT(has_member_function_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_MEMBER_FUNCTION_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/has_static_member_data_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_STATIC_MEMBER_DATA_GEN_HPP) 8 | #define BOOST_TTI_STATIC_MEMBER_DATA_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_HAS_STATIC_MEMBER_DATA. 22 | /** 23 | name = the name of the static member data. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(name) \ 28 | BOOST_PP_CAT(has_static_member_data_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_STATIC_MEMBER_DATA_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/has_static_member_function_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_STATIC_MEMBER_FUNCTION_GEN_HPP) 8 | #define BOOST_TTI_STATIC_MEMBER_FUNCTION_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION. 22 | /** 23 | name = the name of the static member function. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN(name) \ 28 | BOOST_PP_CAT(has_static_member_function_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_STATIC_MEMBER_FUNCTION_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/has_template_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_TEMPLATE_GEN_HPP) 8 | #define BOOST_TTI_TEMPLATE_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_HAS_TEMPLATE. 22 | /** 23 | name = the name of the class template. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_HAS_TEMPLATE_GEN(name) \ 28 | BOOST_PP_CAT(has_template_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_TEMPLATE_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/has_type_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_TYPE_GEN_HPP) 8 | #define BOOST_TTI_TYPE_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_HAS_TYPE. 22 | /** 23 | name = the name of the type. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_HAS_TYPE_GEN(name) \ 28 | BOOST_PP_CAT(has_type_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_TYPE_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/member_type_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_MEMBER_TYPE_GEN_HPP) 8 | #define BOOST_TTI_MEMBER_TYPE_GEN_HPP 9 | 10 | #include 11 | 12 | /* 13 | 14 | The succeeding comments in this file are in doxygen format. 15 | 16 | */ 17 | 18 | /** \file 19 | */ 20 | 21 | /// Generates the macro metafunction name for BOOST_TTI_MEMBER_TYPE. 22 | /** 23 | name = the name of the inner type. 24 | 25 | returns = the generated macro metafunction name. 26 | */ 27 | #define BOOST_TTI_MEMBER_TYPE_GEN(name) \ 28 | BOOST_PP_CAT(member_type_,name) \ 29 | /**/ 30 | 31 | #endif // BOOST_TTI_MEMBER_TYPE_GEN_HPP 32 | -------------------------------------------------------------------------------- /include/boost/tti/gen/namespace_gen.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_NAMESPACE_GEN_HPP) 8 | #define BOOST_TTI_NAMESPACE_GEN_HPP 9 | 10 | /* 11 | 12 | The succeeding comments in this file are in doxygen format. 13 | 14 | */ 15 | 16 | /** \file 17 | */ 18 | 19 | /// Generates the name of the Boost TTI namespace 20 | /** 21 | returns = the generated name of the Boost TTI namespace. 22 | */ 23 | #define BOOST_TTI_NAMESPACE boost::tti 24 | 25 | #endif // BOOST_TTI_NAMESPACE_GEN_HPP 26 | -------------------------------------------------------------------------------- /include/boost/tti/tti.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Edward Diener 2011,2012 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | 7 | #if !defined(BOOST_TTI_INTROSPECTION_HPP) 8 | #define BOOST_TTI_INTROSPECTION_HPP 9 | 10 | #include "has_data.hpp" 11 | #include "has_function.hpp" 12 | #include "has_member_data.hpp" 13 | #include "has_member_function.hpp" 14 | #include "has_static_member_data.hpp" 15 | #include "has_static_member_function.hpp" 16 | #include "has_template.hpp" 17 | #include "has_type.hpp" 18 | #include "member_type.hpp" 19 | 20 | #endif // BOOST_TTI_INTROSPECTION_HPP 21 | -------------------------------------------------------------------------------- /include/boost/type_erasure/binding_of.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_BINDING_OF_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_BINDING_OF_HPP_INCLUDED 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace boost { 19 | namespace type_erasure { 20 | 21 | /** 22 | * \return The type bindings of an @ref any. 23 | * 24 | * \throws Nothing. 25 | */ 26 | template 27 | const binding& binding_of(const any& arg) 28 | { 29 | return ::boost::type_erasure::detail::access::table(arg); 30 | } 31 | 32 | } 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/boost/type_erasure/concept_interface.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_CONCEPT_INTERFACE_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_CONCEPT_INTERFACE_HPP_INCLUDED 13 | 14 | namespace boost { 15 | namespace type_erasure { 16 | 17 | /** 18 | * The @ref concept_interface class can be specialized to 19 | * add behavior to an @ref any. An @ref any inherits from 20 | * all the relevant specializations of @ref concept_interface. 21 | * 22 | * @ref concept_interface can be specialized for either 23 | * primitive or composite concepts. If a concept @c C1 24 | * contains another concept @c C2, then the library guarantees 25 | * that the specialization of @ref concept_interface for 26 | * @c C2 is a base class of the specialization for @c C1. 27 | * This means that @c C1 can safely override members of @c C2. 28 | * 29 | * @ref concept_interface may only be specialized for user-defined 30 | * concepts. The library owns the specializations of its own 31 | * built in concepts. 32 | * 33 | * \tparam Concept The concept that we're specializing 34 | * @ref concept_interface for. One of its 35 | * placeholders should be @c ID. 36 | * \tparam Base The base of this class. Specializations of @ref 37 | * concept_interface must inherit publicly from this type. 38 | * \tparam ID The placeholder representing this type. 39 | * \tparam Enable A dummy parameter that can be used for SFINAE. 40 | * 41 | * The metafunctions @ref derived, @ref rebind_any, and @ref as_param 42 | * (which can be applied to @c Base) are useful for determining the 43 | * argument and return types of functions defined in @ref concept_interface. 44 | * 45 | * For dispatching the function use \call. 46 | */ 47 | template 48 | struct concept_interface : Base {}; 49 | 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/boost/type_erasure/concept_of.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_CONCEPT_OF_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_CONCEPT_OF_HPP_INCLUDED 13 | 14 | namespace boost { 15 | namespace type_erasure { 16 | 17 | template 18 | class any; 19 | 20 | template 21 | class param; 22 | 23 | /** 24 | * A metafunction returning the concept corresponding 25 | * to an @ref any. It will also work for all bases 26 | * of @ref any, so it can be applied to the @c Base 27 | * parameter of @ref concept_interface. 28 | */ 29 | template 30 | struct concept_of 31 | { 32 | #ifdef BOOST_TYPE_ERASURE_DOXYGEN 33 | typedef detail::unspecified type; 34 | #else 35 | typedef typename ::boost::type_erasure::concept_of< 36 | typename T::_boost_type_erasure_derived_type 37 | >::type type; 38 | #endif 39 | }; 40 | 41 | /** INTERNAL ONLY */ 42 | template 43 | struct concept_of< ::boost::type_erasure::any > 44 | { 45 | typedef Concept type; 46 | }; 47 | 48 | /** INTERNAL ONLY */ 49 | template 50 | struct concept_of< ::boost::type_erasure::param > 51 | { 52 | typedef Concept type; 53 | }; 54 | 55 | } 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /include/boost/type_erasure/config.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_CONFIG_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_CONFIG_HPP_INCLUDED 13 | 14 | #ifndef BOOST_TYPE_ERASURE_MAX_FUNCTIONS 15 | /** The maximum number of functions that an @ref boost::type_erasure::any "any" can have. */ 16 | #define BOOST_TYPE_ERASURE_MAX_FUNCTIONS 50 17 | #endif 18 | #ifndef BOOST_TYPE_ERASURE_MAX_ARITY 19 | /** The maximum number of arguments that functions in the library support. */ 20 | #define BOOST_TYPE_ERASURE_MAX_ARITY 5 21 | #endif 22 | #ifndef BOOST_TYPE_ERASURE_MAX_TUPLE_SIZE 23 | /** The maximum number of elements in a @ref boost::type_erasure::tuple "tuple". */ 24 | #define BOOST_TYPE_ERASURE_MAX_TUPLE_SIZE 5 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/boost/type_erasure/deduced.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_DEDUCED_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_DEDUCED_HPP_INCLUDED 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | namespace boost { 22 | namespace type_erasure { 23 | 24 | /** 25 | * A placeholder for an associated type. The type corresponding 26 | * to this placeholder is deduced by substituting placeholders 27 | * in the arguments of the metafunction and then evaluating it. 28 | * 29 | * When using @ref deduced in a template context, if it is possible for 30 | * Metafunction to contain no placeholders at all, use the nested type, 31 | * to automatically evaluate it early as needed. 32 | */ 33 | template 34 | struct deduced : ::boost::type_erasure::placeholder 35 | { 36 | typedef typename ::boost::mpl::eval_if< 37 | ::boost::mpl::empty< 38 | typename ::boost::type_erasure::detail::get_placeholders< 39 | Metafunction, 40 | ::boost::mpl::set0<> 41 | >::type 42 | >, 43 | Metafunction, 44 | ::boost::mpl::identity< 45 | ::boost::type_erasure::deduced 46 | > 47 | >::type type; 48 | }; 49 | 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/boost/type_erasure/derived.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_DERIVED_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_DERIVED_HPP_INCLUDED 13 | 14 | namespace boost { 15 | namespace type_erasure { 16 | 17 | /** 18 | * A metafunction which returns the full @ref any type, 19 | * when given any of its base classes. This is primarily 20 | * intended to be used when implementing @ref concept_interface. 21 | * 22 | * \see rebind_any, as_param 23 | */ 24 | template 25 | struct derived 26 | { 27 | #ifdef BOOST_TYPE_ERASURE_DOXYGEN 28 | typedef detail::unspecified type; 29 | #else 30 | typedef typename T::_boost_type_erasure_derived_type type; 31 | #endif 32 | }; 33 | 34 | } 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/boost/type_erasure/detail/any_base.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_DETAIL_ANY_BASE_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_DETAIL_ANY_BASE_HPP_INCLUDED 13 | 14 | namespace boost { 15 | namespace type_erasure { 16 | 17 | template 18 | struct any_base 19 | { 20 | typedef void _boost_type_erasure_is_any; 21 | typedef Derived _boost_type_erasure_derived_type; 22 | void* _boost_type_erasure_deduce_constructor(...) { return 0; } 23 | void* _boost_type_erasure_deduce_assign(...) { return 0; } 24 | }; 25 | 26 | } 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /include/boost/type_erasure/detail/get_signature.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2012 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_DETAIL_GET_SIGNATURE_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_DETAIL_GET_SIGNATURE_HPP_INCLUDED 13 | 14 | #include 15 | #include 16 | 17 | namespace boost { 18 | namespace type_erasure { 19 | namespace detail { 20 | 21 | template 22 | struct get_signature { 23 | BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, &Concept::apply) 24 | typedef typename boost::remove_pointer< 25 | typename nested::type 26 | >::type type; 27 | }; 28 | 29 | } 30 | } 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/boost/type_erasure/detail/macro.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2012 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_MACRO_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_MACRO_HPP_INCLUDED 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | /** INTERNAL ONLY */ 24 | #define BOOST_TYPE_ERASURE_OPEN_NAMESPACE_F(z, data, x) \ 25 | namespace x { 26 | 27 | /** INTERNAL ONLY */ 28 | #define BOOST_TYPE_ERASURE_OPEN_NAMEPACE_I(seq)\ 29 | BOOST_PP_SEQ_FOR_EACH(BOOST_TYPE_ERASURE_OPEN_NAMESPACE_F, ~, BOOST_PP_SEQ_POP_BACK(seq)) 30 | 31 | /** INTERNAL ONLY */ 32 | #define BOOST_TYPE_ERASURE_OPEN_NAMESPACE(seq)\ 33 | BOOST_PP_IF(BOOST_PP_NOT_EQUAL(BOOST_PP_SEQ_SIZE(seq), 1), BOOST_TYPE_ERASURE_OPEN_NAMEPACE_I, BOOST_PP_TUPLE_EAT(1))(seq) 34 | 35 | /** INTERNAL ONLY */ 36 | #define BOOST_TYPE_ERASURE_CLOSE_NAMESPACE(seq) \ 37 | BOOST_PP_REPEAT(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), } BOOST_PP_TUPLE_EAT(3), ~) 38 | 39 | /** INTERNAL ONLY */ 40 | #define BOOST_TYPE_ERASURE_QUALIFIED_NAME_F(z, data, x)\ 41 | ::x 42 | 43 | /** INTERNAL ONLY */ 44 | #define BOOST_TYPE_ERASURE_QUALIFIED_NAME(seq) \ 45 | BOOST_PP_SEQ_FOR_EACH(BOOST_TYPE_ERASURE_QUALIFIED_NAME_F, ~, seq) 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/boost/type_erasure/detail/normalize_deduced.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #if !defined(BOOST_PP_IS_ITERATING) 12 | 13 | #ifndef BOOST_TYPE_ERASURE_DETAIL_NORMALIZE_DEDUCED_HPP_INCLUDED 14 | #define BOOST_TYPE_ERASURE_DETAIL_NORMALIZE_DEDUCED_HPP_INCLUDED 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | namespace boost { 21 | namespace type_erasure { 22 | namespace detail { 23 | 24 | template 25 | struct normalize_deduced; 26 | template 27 | struct normalize_placeholder; 28 | 29 | #define BOOST_PP_FILENAME_1 30 | #define BOOST_PP_ITERATION_LIMITS (1, BOOST_TYPE_ERASURE_MAX_ARITY) 31 | #include BOOST_PP_ITERATE() 32 | 33 | } 34 | } 35 | } 36 | 37 | #endif 38 | 39 | #else 40 | 41 | #define N BOOST_PP_ITERATION() 42 | 43 | #define BOOST_TYPE_ERASURE_NORMALIZE_PLACEHOLDER(z, n, data) \ 44 | typename ::boost::type_erasure::detail::normalize_placeholder< \ 45 | M, \ 46 | BOOST_PP_CAT(U, n) \ 47 | >::type 48 | 49 | template class T, BOOST_PP_ENUM_PARAMS(N, class U)> 50 | struct normalize_deduced > 51 | { 52 | typedef typename ::boost::type_erasure::deduced< 53 | T 54 | >::type type; 55 | }; 56 | 57 | #undef BOOST_TYPE_ERASURE_NORMALIZE_PLACEHOLDER 58 | 59 | #undef N 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/boost/type_erasure/detail/null.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2012 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #if !defined(BOOST_PP_IS_ITERATING) 12 | 13 | #ifndef BOOST_TYPE_ERASURE_DETAIL_NULL_HPP_INCLUDED 14 | #define BOOST_TYPE_ERASURE_DETAIL_NULL_HPP_INCLUDED 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | namespace boost { 25 | namespace type_erasure { 26 | namespace detail { 27 | 28 | template 29 | struct null_throw; 30 | 31 | template 32 | struct get_null_vtable_entry { 33 | typedef ::boost::type_erasure::detail::null_throw< 34 | typename ::boost::remove_pointer::type> type; 35 | }; 36 | 37 | #define BOOST_PP_FILENAME_1 38 | #define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPE_ERASURE_MAX_ARITY) 39 | #include BOOST_PP_ITERATE() 40 | 41 | } 42 | } 43 | } 44 | 45 | #endif 46 | 47 | #else 48 | 49 | #define N BOOST_PP_ITERATION() 50 | 51 | template 52 | struct null_throw { 53 | static R value(BOOST_PP_ENUM_PARAMS(N, T)) { 54 | BOOST_THROW_EXCEPTION(::boost::type_erasure::bad_function_call()); 55 | } 56 | }; 57 | 58 | #undef N 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /include/boost/type_erasure/exception.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011-2012 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_EXCEPTION_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_EXCEPTION_HPP_INCLUDED 13 | 14 | #include 15 | #include 16 | 17 | namespace boost { 18 | namespace type_erasure { 19 | 20 | /** 21 | * Exception thrown when the arguments to a primitive concept 22 | * are incorrect. 23 | * 24 | * \see \call, \require_match 25 | */ 26 | class bad_function_call : public ::std::invalid_argument 27 | { 28 | public: 29 | bad_function_call() : ::std::invalid_argument("bad_function_call") {} 30 | }; 31 | 32 | /** 33 | * Exception thrown when an \any_cast to a reference or value fails. 34 | */ 35 | class bad_any_cast : public std::bad_cast {}; 36 | 37 | } 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/boost/type_erasure/is_empty.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2012 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_IS_EMPTY_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_IS_EMPTY_HPP_INCLUDED 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace type_erasure { 18 | 19 | /** Returns true for an empty @ref any. */ 20 | template 21 | bool is_empty(const T& arg) { 22 | return ::boost::type_erasure::detail::access::data(arg).data == 0; 23 | } 24 | 25 | } 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/boost/type_erasure/is_placeholder.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_DETAIL_IS_PLACEHOLDER_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_DETAIL_IS_PLACEHOLDER_HPP_INCLUDED 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace boost { 19 | 20 | /** INTERNAL ONLY */ 21 | struct use_default; 22 | 23 | namespace type_erasure { 24 | 25 | /** A metafunction that indicates whether a type is a @ref placeholder. */ 26 | template 27 | struct is_placeholder : ::boost::is_base_and_derived {}; 28 | 29 | /** INTERNAL ONLY */ 30 | template<> 31 | struct is_placeholder< ::boost::use_default> : ::boost::mpl::false_ {}; 32 | 33 | } 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/boost/type_erasure/placeholder_of.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_PLACEHOLDER_OF_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_PLACEHOLDER_OF_HPP_INCLUDED 13 | 14 | namespace boost { 15 | namespace type_erasure { 16 | 17 | template 18 | class any; 19 | 20 | template 21 | class param; 22 | 23 | /** 24 | * A metafunction returning the (const/reference qualified) placeholder 25 | * corresponding to an @ref any. It will also work for all bases 26 | * of @ref any, so it can be applied to the @c Base 27 | * parameter of @ref concept_interface. 28 | */ 29 | template 30 | struct placeholder_of 31 | { 32 | #ifdef BOOST_TYPE_ERASURE_DOXYGEN 33 | typedef detail::unspecified type; 34 | #else 35 | typedef typename ::boost::type_erasure::placeholder_of< 36 | typename T::_boost_type_erasure_derived_type 37 | >::type type; 38 | #endif 39 | }; 40 | 41 | /** INTERNAL ONLY */ 42 | template 43 | struct placeholder_of< ::boost::type_erasure::any > 44 | { 45 | typedef T type; 46 | }; 47 | 48 | /** INTERNAL ONLY */ 49 | template 50 | struct placeholder_of< ::boost::type_erasure::param > 51 | { 52 | typedef T type; 53 | }; 54 | 55 | } 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /include/boost/type_erasure/rebind_any.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_REBIND_ANY_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_REBIND_ANY_HPP_INCLUDED 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | namespace boost { 21 | namespace type_erasure { 22 | 23 | template 24 | class any; 25 | 26 | /** 27 | * A metafunction that changes the @ref placeholder of 28 | * an @ref any. If @c T is not a placeholder, 29 | * returns @c T unchanged. This class is intended 30 | * to be used in @ref concept_interface to deduce 31 | * the argument types from the arguments of the concept. 32 | * 33 | * @pre Any must be a specialization of @ref any or a base 34 | * class of such a specialization. 35 | * 36 | * \code 37 | * rebind_any, _a>::type -> any 38 | * rebind_any, _b&>::type -> any 39 | * rebind_any, int>::type -> int 40 | * \endcode 41 | * 42 | * @see derived, as_param 43 | */ 44 | template 45 | struct rebind_any 46 | { 47 | #ifdef BOOST_TYPE_ERASURE_DOXYGEN 48 | typedef detail::unspecified type; 49 | #else 50 | typedef typename ::boost::mpl::if_< 51 | ::boost::type_erasure::is_placeholder< 52 | typename ::boost::remove_cv< 53 | typename ::boost::remove_reference::type 54 | >::type 55 | >, 56 | ::boost::type_erasure::any< 57 | typename ::boost::type_erasure::concept_of::type, 58 | T 59 | >, 60 | T 61 | >::type type; 62 | #endif 63 | }; 64 | 65 | } 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /include/boost/type_erasure/same_type.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_SAME_TYPE_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_SAME_TYPE_HPP_INCLUDED 13 | 14 | namespace boost { 15 | namespace type_erasure { 16 | 17 | /** 18 | * A built in concept that indicates that two 19 | * types are the same. Either T or U or both 20 | * can be placeholders. 21 | * 22 | * \warning Any number of instances of @ref deduced 23 | * can be connected with @ref same_type, but there 24 | * should be at most one regular placeholder in 25 | * the group. same_type<_a, _b> is not allowed. 26 | * The reason for this is that the library needs 27 | * to normalize all the placeholders, and in this 28 | * context there is no way to decide whether to 29 | * use @ref _a or @ref _b. 30 | */ 31 | template 32 | struct same_type {}; 33 | 34 | } 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/boost/type_erasure/static_binding.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_STATIC_BINDING_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_STATIC_BINDING_HPP_INCLUDED 13 | 14 | namespace boost { 15 | namespace type_erasure { 16 | 17 | /** 18 | * Represents a mapping from placeholders to the actual types 19 | * that they bind to. 20 | * 21 | * \pre @c Map must be an MPL map whose keys are placeholders. 22 | */ 23 | template 24 | struct static_binding {}; 25 | 26 | /** 27 | * A convenience function to prevent constructor calls 28 | * from being parsed as function declarations. 29 | */ 30 | template 31 | static_binding make_binding() { return static_binding(); } 32 | 33 | } 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/boost/type_erasure/typeid_of.hpp: -------------------------------------------------------------------------------- 1 | // Boost.TypeErasure library 2 | // 3 | // Copyright 2011 Steven Watanabe 4 | // 5 | // Distributed under the Boost Software License Version 1.0. (See 6 | // accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // $Id$ 10 | 11 | #ifndef BOOST_TYPE_ERASURE_TYPEID_OF_HPP_INCLUDED 12 | #define BOOST_TYPE_ERASURE_TYPEID_OF_HPP_INCLUDED 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | namespace boost { 21 | namespace type_erasure { 22 | 23 | /** 24 | * The first form returns the type currently stored in an @ref any. 25 | * 26 | * The second form returns the type corresponding to a 27 | * placeholder in @c binding. 28 | * 29 | * \pre @c Concept includes @ref typeid_ "typeid_". 30 | * \pre @c T is a non-reference, CV-unqualified @ref placeholder. 31 | */ 32 | template 33 | const std::type_info& typeid_of(const any& arg) 34 | { 35 | return ::boost::type_erasure::detail::access::table(arg).template find< 36 | ::boost::type_erasure::typeid_< 37 | typename ::boost::remove_cv< 38 | typename ::boost::remove_reference::type 39 | >::type 40 | > 41 | >()(); 42 | } 43 | 44 | #ifndef BOOST_TYPE_ERASURE_DOXYGEN 45 | template 46 | const std::type_info& typeid_of(const param& arg) 47 | { 48 | return ::boost::type_erasure::detail::access::table(arg).template find< 49 | ::boost::type_erasure::typeid_< 50 | typename ::boost::remove_cv< 51 | typename ::boost::remove_reference::type 52 | >::type 53 | > 54 | >()(); 55 | } 56 | #endif 57 | 58 | /** 59 | * \overload 60 | */ 61 | template 62 | const std::type_info& typeid_of(const binding& binding_arg) 63 | { 64 | return binding_arg.template find< ::boost::type_erasure::typeid_ >()(); 65 | } 66 | 67 | } 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /include/yamail/all.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_ALL_H_ 2 | #define _YAMAIL_ALL_H_ 3 | // Includes all headers for precompiled header generation and usage. 4 | 5 | #define YAMAIL_INCLUDE_ALL_HEADERS 1 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #endif // _YAMAIL_ALL_H_ 19 | -------------------------------------------------------------------------------- /include/yamail/compat.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_H_ 2 | #define _YAMAIL_COMPAT_H_ 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #endif // _YAMAIL_COMPAT_H_ 20 | -------------------------------------------------------------------------------- /include/yamail/compat/basics.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_BASICS_H_ 2 | #define _YAMAIL_COMPAT_BASICS_H_ 3 | #include 4 | #include 5 | #include 6 | /* 7 | * function.h 8 | * 9 | * [std|boost]::function compatibility wrapper header 10 | */ 11 | 12 | #if defined(HAVE_STD_ADDRESSOF) && HAVE_STD_ADDRESSOF 13 | # include 14 | #else 15 | #include 16 | #endif // __HAVE_STD_ADDRESSOF 17 | 18 | #if defined(HAVE_STD_RATIO) && HAVE_STD_RATIO 19 | # include 20 | #else 21 | #include 22 | #endif // __HAVE_STD_ADDRESSOF 23 | 24 | #if defined(GENERATING_DOCUMENTATION) 25 | namespace yamail { namespace compat { 26 | #else 27 | YAMAIL_FQNS_COMPAT_BEGIN 28 | #endif // GENERATING_DOCUMENTATION 29 | 30 | #if defined(HAVE_STD_ADDRESSOF) && HAVE_STD_ADDRESSOF 31 | using std::addressof; 32 | #else 33 | using boost::addressof; 34 | #endif // __HAVE_STD_FUNCTION 35 | 36 | #if defined(HAVE_STD_RATIO) && HAVE_STD_RATIO 37 | using std::ratio; 38 | #else 39 | using boost::ratio; 40 | #endif // __HAVE_STD_FUNCTION 41 | 42 | #if defined(GENERATING_DOCUMENTATION) 43 | }} 44 | #else 45 | YAMAIL_FQNS_COMPAT_END 46 | #endif // GENERATING_DOCUMENTATION 47 | 48 | #endif /* _YAMAIL_COMPAT_BASICS_H_ */ 49 | -------------------------------------------------------------------------------- /include/yamail/compat/bind.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_BIND_H_ 2 | #define _YAMAIL_COMPAT_BIND_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | /* 8 | * bind.h 9 | * 10 | * [std|boost]::bind compatibility wrapper header 11 | */ 12 | 13 | #if defined(HAVE_STD_BIND) && HAVE_STD_BIND 14 | # include 15 | #else 16 | # include 17 | #endif // __HAVE_STD_BIND 18 | 19 | #if defined(GENERATING_DOCUMENTATION) 20 | namespace yamail { namespace compat { 21 | #else 22 | YAMAIL_FQNS_COMPAT_BEGIN 23 | #endif // GENERATING_DOCUMENTATION 24 | 25 | #if defined(HAVE_STD_BIND) && HAVE_STD_BIND 26 | using std::bind; 27 | #else 28 | using boost::bind; 29 | #endif // __HAVE_STD_BIND 30 | 31 | #if defined(GENERATING_DOCUMENTATION) 32 | }} 33 | #else 34 | YAMAIL_FQNS_COMPAT_END 35 | #endif // GENERATING_DOCUMENTATION 36 | 37 | #endif /* _YAMAIL_COMPAT_BIND_H_ */ 38 | -------------------------------------------------------------------------------- /include/yamail/compat/chrono.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_CHRONO_H_ 2 | #define _YAMAIL_COMPAT_CHRONO_H_ 3 | #include 4 | #include 5 | #include 6 | #include // for compat::ratio 7 | 8 | #if defined(HAVE_STD_CHRONO) && HAVE_STD_CHRONO 9 | # include 10 | # include 11 | #else 12 | #include 13 | #include 14 | #if 0 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #endif 24 | #endif // HAVE_STD_CHRONO 25 | 26 | #if defined(GENERATING_DOCUMENTATION) 27 | namespace yamail { namespace compat { 28 | #else 29 | YAMAIL_FQNS_COMPAT_BEGIN 30 | #endif // GENERATING_DOCUMENTATION 31 | 32 | #if defined(HAVE_STD_CHRONO) && HAVE_STD_CHRONO 33 | namespace chrono = std::chrono; 34 | #else 35 | namespace chrono = boost::chrono; 36 | #endif 37 | 38 | #if defined(GENERATING_DOCUMENTATION) 39 | }} 40 | #else 41 | YAMAIL_FQNS_COMPAT_END 42 | #endif // GENERATING_DOCUMENTATION 43 | 44 | #endif // _YAMAIL_COMPAT_CHRONO_H_ 45 | -------------------------------------------------------------------------------- /include/yamail/compat/exception.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_EXCEPTION_H_ 2 | #define _YAMAIL_COMPAT_EXCEPTION_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if defined(HAVE_STD_EXCEPTION) && HAVE_STD_EXCEPTION 8 | # include 9 | #else 10 | # include 11 | # include 12 | #endif // HAVE_STD_EXCEPTION 13 | 14 | #if defined(GENERATING_DOCUMENTATION) 15 | namespace yamail { namespace compat { 16 | #else 17 | YAMAIL_FQNS_COMPAT_BEGIN 18 | #endif // GENERATING_DOCUMENTATION 19 | 20 | #if defined(HAVE_STD_EXCEPTION) && HAVE_STD_EXCEPTION 21 | using std::exception_ptr; 22 | using std::rethrow_exception; 23 | using std::current_exception; 24 | using std::make_exception_ptr; 25 | 26 | template void throw_exception (E const& e) { throw e; } 27 | #else 28 | using boost::exception_ptr; 29 | using boost::rethrow_exception; 30 | using boost::current_exception; 31 | using boost::throw_exception; 32 | 33 | template 34 | inline exception_ptr 35 | make_exception_ptr (E const& e) _noexcept 36 | { 37 | #if 1 38 | return boost::copy_exception (e); 39 | #else 40 | try { throw e; } 41 | catch (...) { return current_exception (); } 42 | #endif 43 | } 44 | #endif 45 | 46 | #if defined(GENERATING_DOCUMENTATION) 47 | }} 48 | #else 49 | YAMAIL_FQNS_COMPAT_END 50 | #endif // GENERATING_DOCUMENTATION 51 | 52 | #endif // _YAMAIL_COMPAT_EXCEPTION_H_ 53 | -------------------------------------------------------------------------------- /include/yamail/compat/function.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_FUNCTION_H_ 2 | #define _YAMAIL_COMPAT_FUNCTION_H_ 3 | #include 4 | #include 5 | #include 6 | /* 7 | * function.h 8 | * 9 | * [std|boost]::function compatibility wrapper header 10 | */ 11 | 12 | #if defined(HAVE_STD_FUNCTION) && HAVE_STD_FUNCTION 13 | # include 14 | #else 15 | # include 16 | #endif // __HAVE_STD_FUNCTION 17 | 18 | #if defined(GENERATING_DOCUMENTATION) 19 | namespace yamail { namespace compat { 20 | #else 21 | YAMAIL_FQNS_COMPAT_BEGIN 22 | #endif // GENERATING_DOCUMENTATION 23 | 24 | #if defined(HAVE_STD_FUNCTION) && HAVE_STD_FUNCTION 25 | using std::function; 26 | #else 27 | using boost::function; 28 | #endif // __HAVE_STD_FUNCTION 29 | 30 | #if defined(GENERATING_DOCUMENTATION) 31 | }} 32 | #else 33 | YAMAIL_FQNS_COMPAT_END 34 | #endif // GENERATING_DOCUMENTATION 35 | 36 | #endif /* _YAMAIL_COMPAT_FUNCTION_H_ */ 37 | -------------------------------------------------------------------------------- /include/yamail/compat/make_unique.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_MAKE_UNIQUE_H_ 2 | #define _YAMAIL_COMPAT_MAKE_UNIQUE_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if YAMAIL_CPP >= 11 // std::unique_ptr defined in c++11+ 8 | 9 | #if defined(HAVE_STD_MAKE_UNIQUE) && HAVE_STD_MAKE_UNIQUE 10 | # include 11 | #else 12 | #include 13 | #include 14 | #include 15 | #include 16 | #endif // HAVE_STD_MAKE_UNIQUE 17 | 18 | #if defined(GENERATING_DOCUMENTATION) 19 | namespace yamail { namespace compat { 20 | #else 21 | YAMAIL_FQNS_COMPAT_BEGIN 22 | #endif // GENERATING_DOCUMENTATION 23 | 24 | #if defined(HAVE_STD_MAKE_UNIQUE) && HAVE_STD_MAKE_UNIQUE 25 | using std::make_unique; 26 | #else 27 | template struct _Unique_if { 28 | typedef std::unique_ptr _Single_object; 29 | }; 30 | 31 | template struct _Unique_if { 32 | typedef std::unique_ptr _Unknown_bound; 33 | }; 34 | 35 | template struct _Unique_if { 36 | typedef void _Known_bound; 37 | }; 38 | 39 | template 40 | typename _Unique_if::_Single_object 41 | make_unique(Args&&... args) { 42 | return std::unique_ptr(new T(std::forward(args)...)); 43 | } 44 | 45 | template 46 | typename _Unique_if::_Unknown_bound 47 | make_unique(std::size_t n) { 48 | typedef typename std::remove_extent::type U; 49 | return std::unique_ptr(new U[n]()); 50 | } 51 | 52 | template 53 | typename _Unique_if::_Known_bound 54 | make_unique(Args&&...) = delete; 55 | #endif 56 | 57 | #if defined(GENERATING_DOCUMENTATION) 58 | namespace yamail { namespace compat { 59 | #else 60 | YAMAIL_FQNS_COMPAT_END 61 | #endif // GENERATING_DOCUMENTATION 62 | 63 | #endif // YAMAIL_CPP >= 11 // std::unique_ptr defined in c++11+ 64 | 65 | #endif // _YAMAIL_COMPAT_MAKE_UNIQUE_H_ 66 | -------------------------------------------------------------------------------- /include/yamail/compat/move.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_MOVE_H_ 2 | #define _YAMAIL_COMPAT_MOVE_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if defined(HAVE_STD_MOVE) && HAVE_STD_MOVE 8 | # include 9 | #else 10 | # include 11 | #endif // HAVE_STD_MOVE 12 | 13 | #if defined(GENERATING_DOCUMENTATION) 14 | namespace yamail { namespace compat { 15 | #else 16 | YAMAIL_FQNS_COMPAT_BEGIN 17 | #endif // GENERATING_DOCUMENTATION 18 | 19 | #if defined(HAVE_STD_MOVE) && HAVE_STD_MOVE 20 | using std::move; 21 | #else 22 | using boost::move; 23 | #endif // HAVE_STD_MOVE 24 | 25 | #if defined(GENERATING_DOCUMENTATION) 26 | }} 27 | #else 28 | YAMAIL_FQNS_COMPAT_END 29 | #endif // GENERATING_DOCUMENTATION 30 | 31 | #endif // _YAMAIL_COMPAT_MOVE_H_ 32 | -------------------------------------------------------------------------------- /include/yamail/compat/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_NAMESPACE_H_ 2 | #define _YAMAIL_COMPAT_NAMESPACE_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #define YAMAIL_NS_COMPAT compat 8 | #define YAMAIL_FQNS_COMPAT YAMAIL_FQNS::YAMAIL_NS_COMPAT 9 | 10 | #define YAMAIL_NS_COMPAT_BEGIN namespace YAMAIL_NS_COMPAT { 11 | #define YAMAIL_NS_COMPAT_END } 12 | 13 | #define YAMAIL_FQNS_COMPAT_BEGIN YAMAIL_NS_BEGIN YAMAIL_NS_COMPAT_BEGIN 14 | #define YAMAIL_FQNS_COMPAT_END YAMAIL_NS_COMPAT_END YAMAIL_NS_END 15 | 16 | #endif // _YAMAIL_COMPAT_NAMESPACE_H_ 17 | -------------------------------------------------------------------------------- /include/yamail/compat/optional.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_OPTIONAL_H_ 2 | #define _YAMAIL_COMPAT_OPTIONAL_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if defined(HAVE_STD_OPTIONAL) && HAVE_STD_OPTIONAL 8 | # include 9 | #else 10 | # include 11 | #endif // HAVE_STD_OPTIONAL 12 | 13 | #if defined(GENERATING_DOCUMENTATION) 14 | namespace yamail { namespace compat { 15 | #else 16 | YAMAIL_FQNS_COMPAT_BEGIN 17 | #endif // GENERATING_DOCUMENTATION 18 | 19 | #if defined(HAVE_STD_OPTIONAL) && HAVE_STD_OPTIONAL 20 | using std::experimental::optional; 21 | #else 22 | using boost::optional; 23 | #endif 24 | 25 | #if defined(GENERATING_DOCUMENTATION) 26 | }} 27 | #else 28 | YAMAIL_FQNS_COMPAT_END 29 | #endif // GENERATING_DOCUMENTATION 30 | 31 | #endif // _YAMAIL_COMPAT_OPTIONAL_H_ 32 | -------------------------------------------------------------------------------- /include/yamail/compat/shared_ptr.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_SHARED_PTR_H_ 2 | #define _YAMAIL_COMPAT_SHARED_PTR_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if defined(HAVE_STD_SHARED_PTR) && HAVE_STD_SHARED_PTR 8 | # include 9 | #else 10 | # include 11 | # include 12 | # include 13 | #endif // HAVE_STD_SHARED_PTR_H_ 14 | 15 | #if defined(GENERATING_DOCUMENTATION) 16 | namespace yamail { namespace compat { 17 | #else 18 | YAMAIL_FQNS_COMPAT_BEGIN 19 | #endif // GENERATING_DOCUMENTATION 20 | 21 | #if defined(HAVE_STD_SHARED_PTR) && HAVE_STD_SHARED_PTR 22 | using std::shared_ptr; 23 | using std::weak_ptr; 24 | using std::make_shared; 25 | using std::allocate_shared; 26 | using std::enable_shared_from_this; 27 | using std::static_pointer_cast; 28 | using std::const_pointer_cast; 29 | using std::dynamic_pointer_cast; 30 | #else 31 | using boost::shared_ptr; 32 | using boost::weak_ptr; 33 | using boost::make_shared; 34 | using boost::allocate_shared; 35 | using boost::enable_shared_from_this; 36 | using boost::static_pointer_cast; 37 | using boost::const_pointer_cast; 38 | using boost::dynamic_pointer_cast; 39 | #endif 40 | 41 | #if defined(GENERATING_DOCUMENTATION) 42 | }} 43 | #else 44 | YAMAIL_FQNS_COMPAT_END 45 | #endif // GENERATING_DOCUMENTATION 46 | 47 | #endif // _YAMAIL_COMPAT_SHARED_PTR_H_ 48 | -------------------------------------------------------------------------------- /include/yamail/compat/static_assert.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_STATIC_ASSERT_H_ 2 | #define _YAMAIL_COMPAT_STATIC_ASSERT_H_ 3 | #include 4 | #include 5 | 6 | #if !defined(HAVE_STATIC_ASSERT) || !HAVE_STATIC_ASSERT 7 | # include 8 | 9 | # define static_assert BOOST_STATIC_ASSERT 10 | #endif 11 | 12 | #endif // _YAMAIL_COMPAT_STATIC_ASSERT_H_ 13 | -------------------------------------------------------------------------------- /include/yamail/compat/system.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_SYSTEM_H_ 2 | #define _YAMAIL_COMPAT_SYSTEM_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if defined(HAVE_STD_SYSTEM) && HAVE_STD_SYSTEM 8 | # include 9 | #else 10 | # include 11 | # include 12 | #endif // HAVE_STD_SYSTEM 13 | 14 | #if defined(GENERATING_DOCUMENTATION) 15 | namespace yamail { namespace compat { 16 | #else 17 | YAMAIL_FQNS_COMPAT_BEGIN 18 | #endif // GENERATING_DOCUMENTATION 19 | 20 | #if defined(HAVE_STD_SYSTEM) && HAVE_STD_SYSTEM 21 | using std::system_error; 22 | using std::error_code; 23 | using std::error_condition; 24 | using std::error_category; 25 | using std::make_error_code; 26 | using std::make_error_condition; 27 | using std::generic_category; 28 | using std::system_category; 29 | using std::errc; 30 | 31 | using std::is_error_code_enum; 32 | using std::is_error_condition_enum; 33 | #else 34 | using boost::system::system_error; 35 | using boost::system::error_code; 36 | using boost::system::error_condition; 37 | using boost::system::error_category; 38 | using boost::system::errc::make_error_code; 39 | using boost::system::errc::make_error_condition; 40 | using boost::system::generic_category; 41 | using boost::system::system_category; 42 | namespace errc = ::boost::system::errc; 43 | 44 | using ::boost::system::is_error_code_enum; 45 | using ::boost::system::is_error_condition_enum; 46 | #endif 47 | 48 | #if defined(GENERATING_DOCUMENTATION) 49 | }} 50 | #else 51 | YAMAIL_FQNS_COMPAT_END 52 | #endif // GENERATING_DOCUMENTATION 53 | 54 | #endif // _YAMAIL_COMPAT_SYSTEM_H_ 55 | -------------------------------------------------------------------------------- /include/yamail/compat/type_traits.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_TYPE_TRAITS_H_ 2 | #define _YAMAIL_COMPAT_TYPE_TRAITS_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if defined(HAVE_STD_TYPE_TRAITS) && HAVE_STD_TYPE_TRAITS 8 | # include 9 | #else 10 | # include 11 | # include 12 | #endif // HAVE_STD_TYPE_TRAITS 13 | 14 | #if defined(GENERATING_DOCUMENTATION) 15 | namespace yamail { namespace compat { 16 | #else 17 | YAMAIL_FQNS_COMPAT_BEGIN 18 | #endif // GENERATING_DOCUMENTATION 19 | 20 | #if defined(HAVE_STD_TYPE_TRAITS) && HAVE_STD_TYPE_TRAITS 21 | using std::result_of; 22 | namespace type_traits = std; 23 | #else 24 | using boost::result_of; 25 | namespace type_traits = boost; 26 | #endif 27 | 28 | #if defined(GENERATING_DOCUMENTATION) 29 | }} 30 | #else 31 | YAMAIL_FQNS_COMPAT_END 32 | #endif // GENERATING_DOCUMENTATION 33 | 34 | #endif // _YAMAIL_COMPAT_TYPE_TRAITS_H_ 35 | -------------------------------------------------------------------------------- /include/yamail/compat/unordered.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_UNORDERED_H_ 2 | #define _YAMAIL_COMPAT_UNORDERED_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if defined(HAVE_STD_UNORDERED) && HAVE_STD_UNORDERED 8 | # include 9 | # include 10 | #else 11 | # include 12 | # include 13 | #endif // HAVE_STD_UNORDERED 14 | 15 | #if defined(GENERATING_DOCUMENTATION) 16 | namespace yamail { namespace compat { 17 | #else 18 | YAMAIL_FQNS_COMPAT_BEGIN 19 | #endif // GENERATING_DOCUMENTATION 20 | 21 | #if defined(HAVE_STD_UNORDERED) && HAVE_STD_UNORDERED 22 | using std::unordered_map; 23 | using std::unordered_multimap; 24 | using std::unordered_set; 25 | using std::unordered_multiset; 26 | #else 27 | using boost::unordered_map; 28 | using boost::unordered_multimap; 29 | using boost::unordered_set; 30 | using boost::unordered_multiset; 31 | #endif 32 | 33 | #if defined(GENERATING_DOCUMENTATION) 34 | }} 35 | #else 36 | YAMAIL_FQNS_COMPAT_END 37 | #endif // GENERATING_DOCUMENTATION 38 | 39 | #endif // _YAMAIL_COMPAT_UNORDERED_H_ 40 | -------------------------------------------------------------------------------- /include/yamail/compat/variant.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_COMPAT_VARIANT_H_ 2 | #define _YAMAIL_COMPAT_VARIANT_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | // movable version of variant 8 | 9 | #if YAMAIL_CPP >= 11 10 | # include 11 | #else 12 | # include 13 | #endif 14 | 15 | #if defined(GENERATING_DOCUMENTATION) 16 | namespace yamail { namespace compat { 17 | #else 18 | YAMAIL_FQNS_COMPAT_BEGIN 19 | #endif // GENERATING_DOCUMENTATION 20 | 21 | #if YAMAIL_CPP >= 11 22 | using YAMAIL_FQNS_UTILITY::variant; 23 | using YAMAIL_FQNS_UTILITY::get; 24 | using YAMAIL_FQNS_UTILITY::cget; 25 | using YAMAIL_FQNS_UTILITY::type_index; 26 | #else 27 | using ::boost::variant; 28 | using ::boost::get; 29 | using ::boost::cget; 30 | using ::boost::type_index; 31 | #endif 32 | 33 | #if defined(GENERATING_DOCUMENTATION) 34 | }} 35 | #else 36 | YAMAIL_FQNS_COMPAT_END 37 | #endif // GENERATING_DOCUMENTATION 38 | 39 | #endif // _YAMAIL_COMPAT_VARIANT_H_ 40 | -------------------------------------------------------------------------------- /include/yamail/concurrency.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_H_ 2 | #define _YAMAIL_CONCURRENCY_H_ 3 | #include 4 | 5 | #include 6 | 7 | #endif // _YAMAIL_CONCURRENCY_H_ 8 | -------------------------------------------------------------------------------- /include/yamail/concurrency/async.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_ASYNC_H_ 2 | #define _YAMAIL_CONCURRENCY_ASYNC_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | YAMAIL_FQNS_CONCURRENCY_BEGIN 11 | 12 | enum launch { 13 | none = 0, 14 | async = 1, 15 | deferred = 2, 16 | any = async | deferred 17 | }; 18 | 19 | enum future_status { 20 | ready, 21 | timeout, 22 | deferred 23 | }; 24 | 25 | template 26 | future::type> 27 | async (Fn&& fn, Args&& ...args) 28 | { 29 | } 30 | 31 | template 32 | future::type> 33 | async (launch policy, Fn&& fn, Args&& ...args) 34 | { 35 | } 36 | 37 | YAMAIL_FQNS_CONCURRENCY_END 38 | 39 | #endif // _YAMAIL_CONCURRENCY_ASYNC_H_ 40 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_H_ 8 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/all.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/attributes.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_ATTRIBUTES_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_ATTRIBUTES_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 9 | 10 | using boost::coroutines::attributes; 11 | 12 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 13 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_ATTRIBUTES_H_ 14 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/clock_type.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_CLOCK_TYPE_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_CLOCK_TYPE_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 8 | 9 | typedef compat::chrono::steady_clock clock_type; 10 | 11 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 12 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_CLOCK_TYPE_H_ 13 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/coroutine_manager.inl: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_COROUTINE_MANAGER_INL_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_COROUTINE_MANAGER_INL_ 3 | #include 4 | #include 5 | 6 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 7 | 8 | inline 9 | coroutine_manager::coroutine_manager () BOOST_NOEXCEPT 10 | : def_algo_ (new round_robin ()) 11 | , sched_algo_ (def_algo_.get ()) 12 | , wqueue_ () 13 | , wait_interval_ (compat::chrono::milliseconds (10)) 14 | , active_coroutine_ (0) 15 | { 16 | } 17 | 18 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 19 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_COROUTINE_MANAGER_INL_ 20 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/detail/css.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_CSS_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_CSS_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 11 | namespace detail { 12 | 13 | class css_cleanup_function 14 | { 15 | public: 16 | typedef boost::intrusive_ptr ptr_t; 17 | 18 | css_cleanup_function () : use_count_ (0) {} 19 | virtual ~css_cleanup_function () {} 20 | 21 | virtual void operator() (void* data) = 0; 22 | 23 | friend inline void 24 | intrusive_ptr_add_ref (css_cleanup_function* p) BOOST_NOEXCEPT 25 | { 26 | ++p->use_count_; 27 | } 28 | 29 | friend inline void 30 | intrusive_ptr_release (css_cleanup_function* p) 31 | { 32 | if (0 == --p->use_count_) 33 | delete p; 34 | } 35 | 36 | private: 37 | compat::atomic use_count_; 38 | }; 39 | 40 | } // namespace detail 41 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 42 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_CSS_H_ 43 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/detail/fifo.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_FIFO_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_FIFO_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 11 | namespace detail { 12 | 13 | class fifo: boost::noncopyable 14 | { 15 | public: 16 | fifo () BOOST_NOEXCEPT 17 | : head_ (0) 18 | , tail_ (0) 19 | {} 20 | 21 | bool empty () const BOOST_NOEXCEPT 22 | { 23 | return 0 == head_; 24 | } 25 | 26 | void push (worker_coroutine* item) BOOST_NOEXCEPT 27 | { 28 | BOOST_ASSERT (0 != item); 29 | BOOST_ASSERT (0 == item->next ()); 30 | 31 | if (empty ()) 32 | head_ = tail_ = item; 33 | else 34 | { 35 | tail_->next (item); 36 | tail_ = item; 37 | } 38 | } 39 | 40 | worker_coroutine* pop () BOOST_NOEXCEPT 41 | { 42 | BOOST_ASSERT (! empty ()); 43 | 44 | worker_coroutine* item = head_; 45 | head_ = head_->next (); 46 | if (0 == head_) tail_ = 0; 47 | item->next_reset (); 48 | return item; 49 | } 50 | 51 | void swap (fifo& other) 52 | { 53 | std::swap (head_, other.head_); 54 | std::swap (tail_, other.tail_); 55 | } 56 | 57 | private: 58 | worker_coroutine* head_; 59 | worker_coroutine* tail_; 60 | }; 61 | 62 | } // namespace detail 63 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 64 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_FIFO_H_ 65 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/detail/flags.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_FLAGS_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_FLAGS_H_ 3 | #include 4 | #include 5 | 6 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 7 | namespace detail { 8 | 9 | enum flag_t 10 | { 11 | flag_interruption_blocked = 1 << 0, 12 | flag_interruption_requested = 1 << 1, 13 | flag_thread_affinity = 1 << 2, 14 | flag_detached = 1 << 3 15 | }; 16 | 17 | } // namespace detail 18 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 19 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_DETAIL_FLAGS_H_ 20 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/error_code.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_ERROR_CODE_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_ERROR_CODE_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 10 | 11 | using boost::system::error_code; 12 | using boost::system::system_error; 13 | 14 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 15 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_ERROR_CODE_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_CONCURRENCY_COROUTINE coroutine /* ZeroCopy Buffers */ 7 | #define YAMAIL_FQNS_CONCURRENCY_COROUTINE \ 8 | YAMAIL_FQNS_CONCURRENCY::YAMAIL_NS_CONCURRENCY_COROUTINE 9 | 10 | #define YAMAIL_NS_CONCURRENCY_COROUTINE_BEGIN \ 11 | namespace YAMAIL_NS_CONCURRENCY_COROUTINE { 12 | #define YAMAIL_NS_CONCURRENCY_COROUTINE_END } 13 | 14 | #define YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN \ 15 | YAMAIL_NS_BEGIN YAMAIL_NS_CONCURRENCY_BEGIN \ 16 | YAMAIL_NS_CONCURRENCY_COROUTINE_BEGIN 17 | 18 | #define YAMAIL_FQNS_CONCURRENCY_COROUTINE_END \ 19 | YAMAIL_NS_CONCURRENCY_COROUTINE_END YAMAIL_NS_CONCURRENCY_END YAMAIL_NS_END 20 | 21 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_H_ 22 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/round_robin.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_ROUND_ROBIN_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_ROUND_ROBIN_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | 12 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 13 | 14 | class round_robin: public sched_algorithm 15 | { 16 | typedef detail::fifo rqueue_t; 17 | rqueue_t rqueue_; 18 | 19 | public: 20 | virtual void awakened (detail::worker_coroutine* c) 21 | { 22 | rqueue_.push (c); 23 | } 24 | 25 | virtual detail::worker_coroutine* pick_next () 26 | { 27 | detail::worker_coroutine* victim = 0; 28 | if (! rqueue_.empty ()) 29 | victim = rqueue_.pop (); 30 | 31 | return victim; 32 | } 33 | 34 | virtual void priority (detail::worker_coroutine* c, int prio) BOOST_NOEXCEPT 35 | { 36 | BOOST_ASSERT (c); 37 | 38 | // set only priority fo coroutine 39 | // round-robin does not respect priorities. 40 | c->priority (prio); 41 | } 42 | }; 43 | 44 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 45 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_ROUND_ROBIN_H_ 46 | -------------------------------------------------------------------------------- /include/yamail/concurrency/coroutine/yield.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_COROUTINE_YIELD_H_ 2 | #define _YAMAIL_CONCURRENCY_COROUTINE_YIELD_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_BEGIN 9 | 10 | class yield_t 11 | { 12 | yield_t (error_code& ec) : ec_ (&ec) {} 13 | 14 | public: 15 | BOOST_CONSTEXPR yield_t () 16 | : ec_ (0) 17 | {} 18 | 19 | yield_t operator[] (error_code& ec) const 20 | { 21 | return yield_t (ec); 22 | } 23 | 24 | // private: // XXX 25 | 26 | error_code* ec_; 27 | }; 28 | 29 | BOOST_CONSTEXPR_OR_CONST yield_t yield; 30 | 31 | YAMAIL_FQNS_CONCURRENCY_COROUTINE_END 32 | 33 | #include 34 | 35 | #endif // _YAMAIL_CONCURRENCY_COROUTINE_YIELD_H_ 36 | -------------------------------------------------------------------------------- /include/yamail/concurrency/future.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_FUTURE_H_ 2 | #define _YAMAIL_CONCURRENCY_FUTURE_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #endif // _YAMAIL_CONCURRENCY_FUTURE_H_ 9 | -------------------------------------------------------------------------------- /include/yamail/concurrency/future/future_error.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_FUTURE_FUTURE_ERROR_H_ 2 | #define _YAMAIL_CONCURRENCY_FUTURE_FUTURE_ERROR_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | YAMAIL_FQNS_CONCURRENCY_BEGIN 11 | namespace future { 12 | 13 | class future_error: public std::logic_error 14 | { 15 | compat::error_code ec_; 16 | 17 | public: 18 | future_error (compat::error_code ec) 19 | : logic_error (ec.message ()) 20 | , ec_ (ec) 21 | { 22 | } 23 | 24 | compat::error_code const& code () const 25 | { 26 | return ec_; 27 | } 28 | } 29 | 30 | class future_unintialized: public future_error 31 | { 32 | public: 33 | future_unintialized () 34 | : future_error (compat::make_error_code (future_errc::no_state)) 35 | {} 36 | }; 37 | 38 | class broken_promise: public future_error 39 | { 40 | public: 41 | broken_promise () 42 | : future_error (compat::make_error_code (future_errc::broken_promise)) 43 | {} 44 | }; 45 | 46 | class future_already_retrieved: public future_error 47 | { 48 | public: 49 | future_already_retrieved () 50 | : future_error ( 51 | compat::make_error_code (future_errc::future_already_retrieved)) 52 | {} 53 | }; 54 | 55 | class promise_already_satisfied: public future_error 56 | { 57 | public: 58 | promise_already_satisfied () 59 | : future_error ( 60 | compat::make_error_code (future_errc::promise_already_satisfied)) 61 | {} 62 | }; 63 | 64 | class task_already_started: public future_error 65 | { 66 | public: 67 | task_already_started () 68 | : future_error ( 69 | compat::make_error_code (future_errc::promise_already_satisfied)) 70 | {} 71 | }; 72 | 73 | class task_moved: public future_error 74 | { 75 | public: 76 | task_moved () 77 | : future_error ( 78 | compat::make_error_code (future_errc::no_state)) 79 | {} 80 | }; 81 | 82 | class promise_moved: public future_error 83 | { 84 | public: 85 | promise_moved () 86 | : future_error ( 87 | compat::make_error_code (future_errc::no_state)) 88 | {} 89 | }; 90 | 91 | } // namespace future 92 | YAMAIL_FQNS_CONCURRENCY_END 93 | 94 | #endif // _YAMAIL_CONCURRENCY_FUTURE_FUTURE_ERROR_H_ 95 | 96 | -------------------------------------------------------------------------------- /include/yamail/concurrency/future/future_exceptions.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_FUTURE_FUTURE_EXCEPTIONS_HPP_ 2 | #define _YAMAIL_CONCURRENCY_FUTURE_FUTURE_EXCEPTIONS_HPP_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | YAMAIL_FQNS_CONCURRENCY_BEGIN 9 | namespace future { 10 | 11 | struct broken_promise : public std::exception { 12 | virtual const char *what() const throw () { 13 | return "Broken Promise Exception"; 14 | } 15 | }; 16 | 17 | struct future_already_set : public std::exception { 18 | virtual const char *what() const throw () { 19 | return "Future Already Set Exception"; 20 | } 21 | }; 22 | 23 | struct future_cancel : public std::exception { 24 | virtual const char *what() const throw () { 25 | return "Future Canceled Exception"; 26 | } 27 | }; 28 | 29 | } // namespace future 30 | YAMAIL_FQNS_CONCURRENCY_END 31 | 32 | #endif //_YPLATFORM_FUTURE_FUTURE_EXCEPTIONS_HPP_ 33 | -------------------------------------------------------------------------------- /include/yamail/concurrency/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_NAMESPACE_H_ 2 | #define _YAMAIL_CONCURRENCY_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_CONCURRENCY concurrency 7 | #define YAMAIL_FQNS_CONCURRENCY YAMAIL_FQNS::YAMAIL_NS_CONCURRENCY 8 | 9 | #define YAMAIL_NS_CONCURRENCY_BEGIN namespace YAMAIL_NS_CONCURRENCY { 10 | #define YAMAIL_NS_CONCURRENCY_END } 11 | 12 | #define YAMAIL_FQNS_CONCURRENCY_BEGIN \ 13 | YAMAIL_NS_BEGIN YAMAIL_NS_CONCURRENCY_BEGIN 14 | #define YAMAIL_FQNS_CONCURRENCY_END YAMAIL_NS_CONCURRENCY_END YAMAIL_NS_END 15 | 16 | #endif // _YAMAIL_CONCURRENCY_NAMESPACE_H_ 17 | -------------------------------------------------------------------------------- /include/yamail/concurrency/spinlock.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONCURRENCY_SPINLOCK_H_ 2 | #define _YAMAIL_CONCURRENCY_SPINLOCK_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | YAMAIL_FQNS_CONCURRENCY_BEGIN 9 | 10 | class spinlock { 11 | private: 12 | typedef enum {Locked, Unlocked} LockState; 13 | compat::atomic state_; 14 | 15 | public: 16 | spinlock() : state_(Unlocked) {} 17 | 18 | void lock() 19 | { 20 | while (state_.exchange(Locked, compat::memory_order_acquire) == Locked) { 21 | /* busy-wait */ 22 | } 23 | } 24 | void unlock() 25 | { 26 | state_.store(Unlocked, compat::memory_order_release); 27 | } 28 | }; 29 | 30 | YAMAIL_FQNS_CONCURRENCY_END 31 | 32 | #endif // _YAMAIL_CONCURRENCY_SPINLOCK_H_ 33 | -------------------------------------------------------------------------------- /include/yamail/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CONFIG_H_ 2 | #define _YAMAIL_CONFIG_H_ 3 | 4 | #if !defined(BOOST_SPIRIT_USE_PHOENIX_V3) 5 | # define BOOST_SPIRIT_USE_PHOENIX_V3 6 | #endif 7 | 8 | // C++03 / C++11 compability layer 9 | #include 10 | 11 | #if HAVE_VISIBILITY 12 | # define API_PUBLIC __attribute__ ((visibility("default"))) 13 | # define API_PRIVATE __attribute__ ((visibility("hidden"))) 14 | #else 15 | # define API_PUBLIC 16 | # define API_PRIVATE 17 | #endif 18 | 19 | #endif // _YAMAIL_CONFIG_H_ 20 | -------------------------------------------------------------------------------- /include/yamail/cplusplus.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_CPLUSPLUS_H_ 2 | #define _YAMAIL_CPLUSPLUS_H_ 3 | #include 4 | 5 | #if __cplusplus >= 201300L // C++1y 6 | # define YAMAIL_CPP 14 7 | # define YAMAIL_CPP14 __cplusplus 8 | #elif __cplusplus >= 201103L 9 | # define YAMAIL_CPP 11 10 | # define YAMAIL_CPP11 __cplusplus 11 | #else 12 | # define YAMAIL_CPP 3 13 | # define YAMAIL_CPP03 __cplusplus 14 | #endif 15 | 16 | // C++11 or later 17 | #if YAMAIL_CPP >= 11 18 | 19 | # define _noexcept noexcept 20 | # define _constexpr constexpr 21 | # define _inline_ns inline 22 | # define _explicit_cvt_func explicit 23 | 24 | # if !defined(YAMAIL_USE_RVALUES) 25 | # define YAMAIL_USE_RVALUES 1 26 | # endif 27 | 28 | #else // earlier than C++11 29 | 30 | # define _noexcept throw() 31 | # define _constexpr 32 | # define _inline_ns 33 | # define _explicit_cvt_func 34 | 35 | # if !defined(YAMAIL_USE_RVALUES) 36 | # define YAMAIL_USE_RVALUES 0 37 | # endif 38 | 39 | 40 | #endif // earlier than C++11 41 | 42 | // fix spirit (boost 1.55) 43 | #if YAMAIL_CPP >= 11 44 | #define BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK 1 45 | #endif 46 | 47 | #endif // _YAMAIL_CPLUSPLUS_H_ 48 | -------------------------------------------------------------------------------- /include/yamail/data.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_H_ 2 | #define _YAMAIL_DATA_H_ 3 | #include 4 | 5 | //#include not complete yet 6 | 7 | #if YAMAIL_CPP >= 11 8 | # include 9 | #endif 10 | 11 | #endif // _YAMAIL_DATA_H_ 12 | -------------------------------------------------------------------------------- /include/yamail/data/config/ast.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_AST_H_ 2 | #define _YAMAIL_DATA_CONFIG_AST_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | YAMAIL_FQNS_DATA_CP_BEGIN 14 | 15 | struct ast_node; 16 | typedef std::vector ast; 17 | 18 | typedef std::vector value_array_t; 19 | // typedef std::vector > value_compound_t; 20 | typedef boost::recursive_wrapper > value_compound_t; 21 | typedef std::string value_single_t; 22 | 23 | struct value_void_t {}; 24 | 25 | #if 1 26 | typedef boost::variant< 27 | value_void_t // 28 | , value_compound_t // { ... } 29 | , value_array_t // [ v1, v2, v3, ... ] 30 | , value_single_t // single value 31 | , boost::shared_ptr // included data 32 | , ast* // imported data 33 | , void* // binary data 34 | > ast_value; 35 | #else 36 | typedef boost::make_recursive_variant< 37 | std::vector< boost::recursive_variant_ > 38 | , value_array_t 39 | , value_single_t 40 | >::type ast_value; 41 | #endif 42 | 43 | 44 | enum etype_t { 45 | Other, 46 | Array, 47 | Compound, 48 | Module, //< ??? 49 | 50 | Import, //< \ should be just import with filename(opt) and varname(opt). 51 | Include, //< / 52 | 53 | Binary, //< Binary literal. 54 | BinFile //< Binary data from file. 55 | }; 56 | 57 | struct ast_node 58 | { 59 | etype_t id; 60 | std::string key; 61 | boost::optional name; 62 | 63 | ast_value value; 64 | 65 | std::size_t line; 66 | std::size_t pos; 67 | 68 | std::string file; 69 | 70 | ast_node () 71 | : id (Other) 72 | , line (-1) 73 | , pos (-1) 74 | {} 75 | }; 76 | 77 | enum field_index { 78 | AST_ID, 79 | AST_KEY, 80 | AST_NAME, 81 | AST_VALUE, 82 | AST_LINE, 83 | AST_POS 84 | }; 85 | 86 | YAMAIL_FQNS_DATA_CP_END 87 | #endif // _YAMAIL_DATA_CONFIG_AST_H_ 88 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/ast_cache_fwd.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_DETAIL_AST_CACHE_FWD_H_ 2 | #define _YAMAIL_DATA_CONFIG_DETAIL_AST_CACHE_FWD_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | // #include 10 | // #include 11 | 12 | YAMAIL_FQNS_DATA_CP_BEGIN 13 | namespace detail { 14 | 15 | template < 16 | typename ErrorHandler // = error_handler 17 | // , typename IncludeHandler // = include_handler 18 | , typename FS = boost_fs_handler 19 | > 20 | class ast_cache; 21 | 22 | } // namespace detail 23 | YAMAIL_FQNS_DATA_CP_END 24 | #endif // _YAMAIL_DATA_CONFIG_DETAIL_AST_CACHE_FWD_H_ 25 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/file_cache.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_DETAIL_FILE_CACHE_H_ 2 | #define _YAMAIL_DATA_CONFIG_DETAIL_FILE_CACHE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | YAMAIL_FQNS_DATA_CP_BEGIN 20 | 21 | namespace detail { 22 | 23 | namespace fs = boost::filesystem; 24 | 25 | template 26 | class file_cache 27 | { 28 | typedef boost::shared_ptr ast_ptr; 29 | typedef boost::unordered_map map_type; 30 | 31 | public: 32 | 33 | template 34 | ast_ptr 35 | get (std::string const& file, 36 | paths_type const& include_dirs = paths_type (), 37 | ErrorHandler ehandler = ErrorHandler (), 38 | IncludeHandler ihandler = IncludeHandler ()) 39 | { 40 | fs::path normalized = normalize_path (file); 41 | map_type::iterator found = map_.find (normalized); 42 | if (found != map_.end ()) return found->second; 43 | 44 | ast_ptr nodes = boost::make_shared (); 45 | detail::parse_file (*nodes, normalized.native (), include_dirs, *this, 46 | ehandler, ihandler); 47 | return map_[normalized] = nodes; 48 | } 49 | 50 | private: 51 | map_type map_; 52 | }; 53 | 54 | } // namespace detail 55 | YAMAIL_FQNS_DATA_CP_END 56 | #endif // _YAMAIL_DATA_CONFIG_DETAIL_FILE_CACHE_H_ 57 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/file_cache_fwd.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_DETAIL_FILE_CACHE_FWD_H_ 2 | #define _YAMAIL_DATA_CONFIG_DETAIL_FILE_CACHE_FWD_H_ 3 | 4 | #include 5 | #include 6 | 7 | // #include 8 | // #include 9 | 10 | YAMAIL_FQNS_DATA_CP_BEGIN 11 | namespace detail { 12 | 13 | template < 14 | typename ErrorHandler // = error_handler 15 | , typename IncludeHandler // = include_handler 16 | > 17 | class file_cache; 18 | 19 | } // namespace detail 20 | YAMAIL_FQNS_DATA_CP_END 21 | #endif // _YAMAIL_DATA_CONFIG_DETAIL_FILE_CACHE_FWD_H_ 22 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/fs_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_DETAIL_FS_HANDLER_H_ 2 | #define _YAMAIL_DATA_CONFIG_DETAIL_FS_HANDLER_H_ 3 | 4 | #include 5 | #include 6 | 7 | YAMAIL_FQNS_DATA_CP_BEGIN 8 | namespace detail { 9 | 10 | struct return_iterator_range {}; 11 | struct return_istream {}; 12 | 13 | } // namespace detail 14 | YAMAIL_FQNS_DATA_CP_END 15 | #endif // _YAMAIL_DATA_CONFIG_DETAIL_FS_HANDLER_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/importer.h: -------------------------------------------------------------------------------- 1 | #ifndef _YA_DATA_CONFIG_DETAIL_IMPORTER_H_ 2 | #define _YA_DATA_CONFIG_DETAIL_IMPORTER_H_ 3 | 4 | #include 5 | 6 | namespace ya { 7 | namespace data { 8 | namespace config { 9 | 10 | namespace detail { 11 | 12 | template <> 13 | bool 14 | check_import (ast_node& a) 15 | { 16 | bool processed_any = false; 17 | if (a.type == Import && a.value.get () != 0) { 18 | // find named entry 19 | ast_node* found = find_node (a.name); 20 | 21 | if (found) { 22 | a.value = found; 23 | processed_any = true; 24 | } 25 | } 26 | 27 | return processed_any; 28 | } 29 | 30 | template <> 31 | bool importer (ast& nodes) 32 | { 33 | BOOST_FOREACH (ast_node& node, nodes) 34 | { 35 | check_import (node); 36 | } 37 | } 38 | 39 | } // namespace detail 40 | }}} // namespace ya::data::config 41 | #endif // _YA_DATA_CONFIG_DETAIL_IMPORTER_H_ 42 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/include_cache.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_DETAIL_INCLUDE_CACHE_H_ 2 | #define _YAMAIL_DATA_CONFIG_DETAIL_INCLUDE_CACHE_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | YAMAIL_FQNS_DATA_CP_BEGIN 12 | 13 | namespace detail { 14 | 15 | template < 16 | typename Parser 17 | , typename FsHandler = boost_fs_handler<> 18 | , typename AllocT = std::allocator 19 | > 20 | class include_cache : public include_opener 21 | { 22 | public: 23 | typedef typename include_cache::ast_ptr ast_ptr; 24 | typedef typename include_cache::path_type path_type; 25 | 26 | protected: 27 | typedef include_opener base_t; 28 | typedef compat::unordered_map map_type; 29 | 30 | public: 31 | using base_t::base_t; 32 | 33 | ast_ptr operator() (path_type const& path) 34 | { 35 | path_type normalized = this->normalize (path); 36 | 37 | typename map_type::iterator found = map_.find (normalized); 38 | if (found != map_.end ()) 39 | { 40 | return found->second; 41 | } 42 | 43 | return map_[normalized] = this->get_normalized (normalized); 44 | } 45 | 46 | private: 47 | map_type map_; 48 | }; 49 | 50 | } // namespace detail 51 | YAMAIL_FQNS_DATA_CP_END 52 | #endif // _YAMAIL_DATA_CONFIG_DETAIL_INCLUDE_CACHE_H_ 53 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/include_dummy.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_DETAIL_INCLUDE_DUMMY_H_ 2 | #define _YAMAIL_DATA_CONFIG_DETAIL_INCLUDE_DUMMY_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | YAMAIL_FQNS_DATA_CP_BEGIN 24 | namespace detail { 25 | 26 | using utility::rw_in; 27 | 28 | // Do nothing, fake include opener. 29 | template < 30 | typename AllocT = std::allocator 31 | > 32 | class include_dummy 33 | { 34 | public: 35 | typedef AllocT allocator_type; 36 | typedef compat::shared_ptr ast_ptr; 37 | 38 | include_dummy (allocator_type const& alloc = allocator_type ()) 39 | : alloc_ (alloc) 40 | { 41 | } 42 | 43 | inline allocator_type& get_allocator () 44 | { 45 | return alloc_; 46 | } 47 | 48 | ast_ptr operator() (path_type const& path) 49 | { 50 | return compat::allocate_shared (alloc_); 51 | } 52 | 53 | private: 54 | allocator_type alloc_; 55 | }; 56 | 57 | template < 58 | : typename AllocT = std::allocator 59 | > inline include_dummy 60 | make_include_dummy (AllocT&& alloc = AllocT ()) 61 | { 62 | return include_dummy (std::forward (alloc)); 63 | } 64 | 65 | } // namespace detail 66 | YAMAIL_FQNS_DATA_CP_END 67 | #endif // _YAMAIL_DATA_CONFIG_DETAIL_INCLUDE_DUMMY_H_ 68 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/line_iterator_fixed.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_DETAIL_line_iterator_fixed_H_ 2 | #define _YAMAIL_DATA_CONFIG_DETAIL_line_iterator_fixed_H_ 3 | 4 | #include 5 | #include 6 | 7 | YAMAIL_FQNS_DATA_CP_BEGIN 8 | namespace detail { 9 | 10 | // Fixed version of line_pos_iterator get_line_start 11 | template 12 | inline Iterator 13 | get_line_start_FIXED (Iterator lower_bound, Iterator current) 14 | { 15 | bool e = false; 16 | Iterator latest = lower_bound; 17 | if (lower_bound != current) 18 | { 19 | for (Iterator i = lower_bound; ; ++i) 20 | { 21 | switch (*i) { 22 | case '\r': case '\n': latest = i; e = true; break; 23 | default: if (e) { latest = i; e = false; } 24 | } 25 | 26 | if (i == current) break; 27 | } 28 | } 29 | return latest; 30 | } 31 | 32 | template 33 | inline std::size_t 34 | get_column_FIXED (Iterator lower_bound, 35 | Iterator current, 36 | std::size_t tabs = 4) 37 | { 38 | std::size_t column = 1; 39 | Iterator first = get_line_start_FIXED(lower_bound, current); 40 | 41 | for (Iterator i = first; i != current; ++i) { 42 | switch (*i) { 43 | case '\t': 44 | column += tabs - (column - 1) % tabs; 45 | break; 46 | default: 47 | ++column; 48 | } 49 | } 50 | 51 | return column; 52 | } 53 | 54 | template 55 | inline boost::iterator_range 56 | get_current_line_FIXED ( 57 | Iterator lower_bound, Iterator current, Iterator upper_bound) 58 | { 59 | // get line start 60 | Iterator line_start = get_line_start_FIXED (lower_bound, current); 61 | 62 | // get line end 63 | Iterator line_end = line_start; 64 | while (line_end != upper_bound && *line_end != '\r' && *line_end != '\n') 65 | ++line_end; 66 | 67 | return boost::make_iterator_range (line_start, line_end); 68 | 69 | } 70 | 71 | } // namespace detail 72 | YAMAIL_FQNS_DATA_CP_END 73 | 74 | #endif // _YAMAIL_DATA_CONFIG_DETAIL_line_iterator_fixed_H_ 75 | -------------------------------------------------------------------------------- /include/yamail/data/config/detail/normalize_path.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_DETAIL_NORMALIZE_PATH_H_ 2 | #define _YAMAIL_DATA_CONFIG_DETAIL_NORMALIZE_PATH_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | YAMAIL_FQNS_DATA_CP_BEGIN 10 | namespace detail { 11 | 12 | namespace fs = boost::filesystem; 13 | 14 | // returns normalized absolute path. 15 | 16 | inline 17 | fs::path 18 | normalize_path (fs::path const& path) 19 | { 20 | fs::path absPath = absolute (path); 21 | fs::path::iterator it = absPath.begin (); 22 | fs::path result = *it++; 23 | 24 | // Get canonical version of the existing part 25 | for (; exists (result) && it != absPath.end (); ++it) 26 | result /= *it; 27 | 28 | result = canonical (result.parent_path ()); 29 | 30 | // For the rest remove ".." and "." in a path with no symlinks 31 | for (--it; it != absPath.end (); ++it) 32 | { 33 | // Just move back on ".." 34 | if (*it == "..") 35 | result = result.parent_path (); 36 | 37 | // Ignore "." 38 | else if (*it != ".") 39 | result /= *it; 40 | } 41 | 42 | return result; 43 | } 44 | 45 | } // namespace detail 46 | YAMAIL_FQNS_DATA_CP_END 47 | #endif // _YAMAIL_DATA_CONFIG_DETAIL_NORMALIZE_PATH_H_ 48 | -------------------------------------------------------------------------------- /include/yamail/data/config/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_PARSER_NAMESPACE_H_ 2 | #define _YAMAIL_DATA_CONFIG_PARSER_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_DATA_CP cp /* ConfigParser */ 7 | #define YAMAIL_FQNS_DATA_CP YAMAIL_FQNS_DATA::YAMAIL_NS_DATA_CP 8 | 9 | #define YAMAIL_NS_DATA_CP_BEGIN namespace YAMAIL_NS_DATA_CP { 10 | #define YAMAIL_NS_DATA_CP_END } 11 | 12 | #define YAMAIL_FQNS_DATA_CP_BEGIN \ 13 | YAMAIL_NS_BEGIN YAMAIL_NS_DATA_BEGIN YAMAIL_NS_DATA_CP_BEGIN 14 | 15 | #define YAMAIL_FQNS_DATA_CP_END \ 16 | YAMAIL_NS_DATA_CP_END YAMAIL_NS_DATA_END YAMAIL_NS_END 17 | 18 | // Alias 19 | YAMAIL_NS_BEGIN 20 | YAMAIL_NS_DATA_BEGIN 21 | YAMAIL_NS_DATA_CP_BEGIN YAMAIL_NS_DATA_CP_END 22 | 23 | namespace config = YAMAIL_NS_DATA_CP; 24 | YAMAIL_NS_DATA_END 25 | YAMAIL_NS_END 26 | 27 | 28 | #endif // _YAMAIL_DATA_CONFIG_PARSER_NAMESPACE_H_ 29 | -------------------------------------------------------------------------------- /include/yamail/data/config/parse_file.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_PARSE_FILE_H_ 2 | #define _YAMAIL_DATA_CONFIG_PARSE_FILE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include 14 | 15 | YAMAIL_FQNS_DATA_CP_BEGIN 16 | 17 | template ::type>::value>::type> 20 | inline bool 21 | parse (ast& nodes, Source const& path, ErrorHandler& eh, 22 | paths_type const& include_dirs = paths_type ()) 23 | { 24 | typedef typename std::decay::type error_handler_type; 25 | parse_with_error_handler ( 26 | nodes, path, std::forward (eh), 27 | include_dirs, cvt) 28 | } 29 | 30 | template ::type>::value>::type> 33 | inline bool 34 | parse_with_error_handler (ast& nodes, Source const& path, 35 | YAMAIL_NS_UTILITY::in eh, 36 | paths_type const& include_dirs = paths_type ()) 37 | { 38 | } 39 | 40 | template 41 | inline bool 42 | parse_file (ast& nodes, std::string const& path, ErrorHandler& error_handler, 43 | paths_type const& include_dirs = paths_type ()) 44 | { 45 | // Use ast cache instead. Or at least use single file opener 46 | boost::iostreams::mapped_file_source input (path); 47 | return parse (nodes, path, input.data (), input.data () + input.size (), 48 | error_handler, include_dirs); 49 | } 50 | 51 | inline bool 52 | parse_file (ast& nodes, std::string const& path, 53 | paths_type const& include_dirs = paths_type ()) 54 | { 55 | default_error_handler eh; 56 | return parse_file (nodes, path, eh, include_dirs); 57 | } 58 | 59 | YAMAIL_FQNS_DATA_CP_END 60 | 61 | #endif // _YAMAIL_DATA_CONFIG_PARSE_FILE_H_ 62 | -------------------------------------------------------------------------------- /include/yamail/data/config/parse_stream.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_PARSE_STREAM_H_ 2 | #define _YAMAIL_DATA_CONFIG_PARSE_STREAM_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | YAMAIL_FQNS_DATA_CP_BEGIN 10 | 11 | template 12 | inline bool 13 | parse (ast& nodes, Stream& stream, 14 | paths_type const& include_dirs = paths_type ()) 15 | { 16 | default_error_handler eh; 17 | return parse (nodes, stream, eh, include_dirs); 18 | } 19 | 20 | template 21 | inline bool 22 | parse (ast& nodes, Stream& stream, UserErrorHandler& custom_handler, 23 | paths_type const& include_dirs = paths_type ()) 24 | { 25 | typedef std::istreambuf_iterator base_iterator_type; 26 | 27 | base_iterator_type first = base_iterator_type (stream); 28 | base_iterator_type last; 29 | 30 | return parse (nodes, first, last, custom_handler, include_dirs); 31 | } 32 | 33 | YAMAIL_FQNS_DATA_CP_END 34 | 35 | #endif // _YAMAIL_DATA_CONFIG_PARSE_STREAM_H_ 36 | -------------------------------------------------------------------------------- /include/yamail/data/config/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_PARSER_H_ 2 | #define _YAMAIL_DATA_CONFIG_PARSER_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include 10 | 11 | namespace ya { 12 | namespace data { 13 | namespace config { 14 | 15 | typedef std::vector paths_type; 16 | 17 | template 18 | 19 | parse (Iterator begin, Iterator end, include_dirs lib_paths = paths_type ()); 20 | 21 | template 22 | parse (Stream& stream, paths_type include_dirs = paths_type ()); 23 | 24 | parse (std::string& path, paths_type include_dirs = paths_type ()); 25 | 26 | 27 | }}} // namespace ya::data::config 28 | #endif // _YAMAIL_DATA_CONFIG_PARSER_H_ 29 | -------------------------------------------------------------------------------- /include/yamail/data/config/paths_type.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_CONFIG_PATHS_TYPE_H_ 2 | #define _YAMAIL_DATA_CONFIG_PATHS_TYPE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | YAMAIL_FQNS_DATA_CP_BEGIN 11 | 12 | typedef std::vector paths_type; 13 | 14 | YAMAIL_FQNS_DATA_CP_END 15 | #endif // _YAMAIL_DATA_CONFIG_PATHS_TYPE_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/data/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_NAMESPACE_H_ 2 | #define _YAMAIL_DATA_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_DATA data 7 | #define YAMAIL_FQNS_DATA YAMAIL_FQNS::YAMAIL_NS_DATA 8 | 9 | #define YAMAIL_NS_DATA_BEGIN namespace YAMAIL_NS_DATA { 10 | #define YAMAIL_NS_DATA_END } 11 | 12 | #define YAMAIL_FQNS_DATA_BEGIN YAMAIL_NS_BEGIN YAMAIL_NS_DATA_BEGIN 13 | #define YAMAIL_FQNS_DATA_END YAMAIL_NS_DATA_END YAMAIL_NS_END 14 | 15 | #endif // _YAMAIL_DATA_NAMESPACE_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/data/zerocopy/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_DATA_ZEROCOPY_NAMESPACE_H_ 2 | #define _YAMAIL_DATA_ZEROCOPY_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_DATA_ZC zerocopy /* ZeroCopy Buffers */ 7 | #define YAMAIL_FQNS_DATA_ZC YAMAIL_FQNS_DATA::YAMAIL_NS_DATA_ZC 8 | 9 | #define YAMAIL_NS_DATA_ZC_BEGIN namespace YAMAIL_NS_DATA_ZC { 10 | #define YAMAIL_NS_DATA_ZC_END } 11 | 12 | #define YAMAIL_FQNS_DATA_ZC_BEGIN \ 13 | YAMAIL_NS_BEGIN YAMAIL_NS_DATA_BEGIN YAMAIL_NS_DATA_ZC_BEGIN 14 | 15 | #define YAMAIL_FQNS_DATA_ZC_END \ 16 | YAMAIL_NS_DATA_ZC_END YAMAIL_NS_DATA_END YAMAIL_NS_END 17 | 18 | // Alias zc = zerocopy 19 | YAMAIL_NS_BEGIN 20 | YAMAIL_NS_DATA_BEGIN 21 | YAMAIL_NS_DATA_ZC_BEGIN YAMAIL_NS_DATA_ZC_END 22 | 23 | namespace zc = YAMAIL_NS_DATA_ZC; 24 | YAMAIL_NS_DATA_END 25 | YAMAIL_NS_END 26 | 27 | 28 | #endif // _YAMAIL_DATA_ZEROCOPY_NAMESPACE_H_ 29 | -------------------------------------------------------------------------------- /include/yamail/error.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_ERROR_H_ 2 | #define _YAMAIL_ERROR_H_ 3 | #include 4 | #include 5 | #endif // _YAMAIL_ERROR_H_ 6 | -------------------------------------------------------------------------------- /include/yamail/iterator.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_ITERATOR_H_ 2 | #define _YAMAIL_ITERATOR_H_ 3 | #include 4 | 5 | // not complete yet 6 | // #include 7 | 8 | #endif // _YAMAIL_ITERATOR_H_ 9 | -------------------------------------------------------------------------------- /include/yamail/iterator/codecvt_iterator.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_ITERATOR_CODECVT_ITERATOR_H_ 2 | #define _YAMAIL_ITERATOR_CODECVT_ITERATOR_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | YAMAIL_FQNS_ITERATOR_BEGIN 10 | 11 | //////////////////////////////////////////////////////////////////////////////// 12 | // translate one iterator to another with codecvt. 13 | 14 | template < 15 | typename Base 16 | , typename CodeCvt 17 | > 18 | class codecvt_iterator 19 | : public boost::iterator_adaptor< 20 | codecvt_iterator 21 | , Base 22 | , typename CodeCvt::extern_type 23 | , boost::single_pass_traversal_tag 24 | , typename CodeCvt::extern_type 25 | > 26 | { 27 | friend class boost::iterator_core_access; 28 | 29 | typedef typename CodeCvt::intern_type int_char_type; 30 | typedef typename CodeCvt::extern_type ext_char_type; 31 | typedef typename CodeCvt::state_type state_type; 32 | typedef typename CodeCvt::result result_type; 33 | 34 | typedef boost::iterator_adaptor< 35 | codecvt_iterator 36 | , Base 37 | , ext_char_type 38 | , boost::single_pass_traversal_tag 39 | , ext_char_type 40 | > super_t; 41 | 42 | typedef codecvt_iterator this_t; 43 | 44 | std::vector int_buf_; 45 | std::vector ext_buf_; 46 | 47 | inline ExtCharT dereference () const 48 | { 49 | return const_cast (this)->dereference_impl (); 50 | } 51 | 52 | } 53 | 54 | YAMAIL_FQNS_ITERATOR_END 55 | 56 | #endif // _YAMAIL_ITERATOR_CODECVT_ITERATOR_H_ 57 | -------------------------------------------------------------------------------- /include/yamail/iterator/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_ITERATOR_NAMESPACE_H_ 2 | #define _YAMAIL_ITERATOR_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_ITERATOR iterator 7 | #define YAMAIL_FQNS_ITERATOR YAMAIL_FQNS::YAMAIL_NS_ITERATOR 8 | 9 | #define YAMAIL_NS_ITERATOR_BEGIN namespace YAMAIL_NS_ITERATOR { 10 | #define YAMAIL_NS_ITERATOR_END } 11 | 12 | #define YAMAIL_FQNS_ITERATOR_BEGIN YAMAIL_NS_BEGIN YAMAIL_NS_ITERATOR_BEGIN 13 | #define YAMAIL_FQNS_ITERATOR_END YAMAIL_NS_ITERATOR_END YAMAIL_NS_END 14 | 15 | #endif // _YAMAIL_ITERATOR_NAMESPACE_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/log.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_LOG_H_ 2 | #define _YAMAIL_LOG_H_ 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #endif // _YAMAIL_LOG_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/log/log.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_LOG_LOG_H_ 2 | #define _YAMAIL_LOG_LOG_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | YAMAIL_FQNS_LOG_BEGIN 13 | 14 | void log_init (const boost::property_tree::ptree& cfg); 15 | void log_load_cfg(const boost::property_tree::ptree& cfg); 16 | 17 | enum severity_level 18 | { 19 | emerg, alert, fatal, error, warning, notice, info, debug, end_of_sev_level 20 | }; 21 | 22 | typedef boost::log::sources::severity_channel_logger_mt logger_t; 23 | 24 | #if BOOST_VERSION < 104600 25 | BOOST_LOG_DECLARE_GLOBAL_LOGGER(global_logger, logger_t) 26 | #else 27 | BOOST_LOG_GLOBAL_LOGGER(global_logger, logger_t) 28 | #endif 29 | 30 | #define YAMAIL_GLOBAL_LOG() YAMAIL_FQNS_LOG::global_logger::get() 31 | 32 | #define YAMAIL_LOG_SEV(logger,severity) BOOST_LOG_SEV(logger, YAMAIL_FQNS_LOG::severity) 33 | #define YAMAIL_GLOG_SEV(severity) \ 34 | BOOST_LOG_SEV(YAMAIL_GLOBAL_LOG(), YAMAIL_FQNS_LOG::severity) 35 | 36 | 37 | YAMAIL_FQNS_LOG_END 38 | 39 | #endif // _YAMAIL_LOG_LOG_H_ 40 | -------------------------------------------------------------------------------- /include/yamail/log/log_rotate.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_LOG_LOG_ROTATE_H_ 2 | #define _YAMAIL_LOG_LOG_ROTATE_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | YAMAIL_NS_BEGIN 9 | YAMAIL_NS_LOG_BEGIN 10 | 11 | class sink_support_rotate { 12 | public: 13 | virtual ~sink_support_rotate () {} 14 | virtual void rotate() = 0; 15 | }; 16 | typedef sink_support_rotate* sink_support_rotate_ptr; 17 | 18 | class log_rotate_manager 19 | { 20 | public: 21 | static log_rotate_manager& instance(); 22 | 23 | void register_sink(sink_support_rotate_ptr sink); 24 | void unregister_sink(sink_support_rotate_ptr sink); 25 | void do_rotate(); 26 | 27 | private: 28 | typedef std::list sinks_list; 29 | sinks_list sinks_; 30 | }; 31 | 32 | YAMAIL_NS_LOG_END 33 | YAMAIL_NS_END 34 | 35 | #endif // _YAMAIL_LOG_LOG_ROTATE_H_ 36 | -------------------------------------------------------------------------------- /include/yamail/log/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_LOG_NAMESPACE_H_ 2 | #define _YAMAIL_LOG_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_LOG log 7 | #define YAMAIL_FQNS_LOG YAMAIL_FQNS::YAMAIL_NS_LOG 8 | 9 | #define YAMAIL_NS_LOG_BEGIN namespace YAMAIL_NS_LOG { 10 | #define YAMAIL_NS_LOG_END } 11 | 12 | #define YAMAIL_FQNS_LOG_BEGIN YAMAIL_NS_BEGIN YAMAIL_NS_LOG_BEGIN 13 | #define YAMAIL_FQNS_LOG_END YAMAIL_NS_LOG_END YAMAIL_NS_END 14 | 15 | #endif // _YAMAIL_LOG_NAMESPACE_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/log/typed_backend_attr.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_LOG_TYPED_BACKEND_ATTR_H_ 2 | #define _YAMAIL_LOG_TYPED_BACKEND_ATTR_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | // #include 10 | 11 | #if 0 12 | #if defined(GENERATING_DOCUMENTATION) 13 | namespace yamail { namespace log { 14 | #else 15 | YAMAIL_FQNS_LOG_BEGIN 16 | #endif // GENERATING_DOCUMENTATION 17 | namespace typed { 18 | 19 | namespace logging = boost::log; 20 | namespace src = boost::log::sources; 21 | namespace expr = boost::log::expressions; 22 | namespace sinks = boost::log::sinks; 23 | namespace keywords = boost::log::keywords; 24 | namespace attributes = boost::log::attributes; 25 | 26 | typedef attributes::attribute_value_impl map_attribute_value; 27 | 28 | 29 | 30 | } // namespace typed 31 | #if defined(GENERATING_DOCUMENTATION) 32 | }} // namespace yamail::log 33 | #else 34 | YAMAIL_FQNS_LOG_END 35 | #endif // GENERATING_DOCUMENTATION 36 | #endif 37 | #endif // _YAMAIL_LOG_TYPED_BACKEND_ATTR_H_ 38 | -------------------------------------------------------------------------------- /include/yamail/memory.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_MEMORY_H_ 2 | #define _YAMAIL_MEMORY_H_ 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #endif // _YAMAIL_MEMORY_H_ 11 | -------------------------------------------------------------------------------- /include/yamail/memory/composite_limiter_factory.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPOSITE_LIMITER_FACTORY_HPP_ 2 | #define COMPOSITE_LIMITER_FACTORY_HPP_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | YAMAIL_FQNS_MEMORY_BEGIN 10 | 11 | // Produce proper impl instance for composite_limiter 12 | // Produce proper limiter for concrete composite_limiter 13 | class composite_limiter_factory 14 | { 15 | public: 16 | enum type {FUZZY, STRICT, UNLIMITED}; 17 | 18 | void init(composite_limiter_factory::type t); 19 | 20 | composite_limiter make_composite_limiter(const std::string& name = std::string()); 21 | limiter make_limiter(size_t limit, const std::string& name = std::string()); 22 | 23 | private: 24 | type type_; 25 | }; 26 | 27 | YAMAIL_FQNS_MEMORY_END 28 | 29 | #endif /* COMPOSITE_LIMITER_FACTORY_HPP_ */ 30 | -------------------------------------------------------------------------------- /include/yamail/memory/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_MEMORY_NAMESPACE_H_ 2 | #define _YAMAIL_MEMORY_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_MEMORY memory 7 | #define YAMAIL_FQNS_MEMORY YAMAIL_FQNS::YAMAIL_NS_MEMORY 8 | 9 | #define YAMAIL_NS_MEMORY_BEGIN namespace YAMAIL_NS_MEMORY { 10 | #define YAMAIL_NS_MEMORY_END } 11 | 12 | #define YAMAIL_FQNS_MEMORY_BEGIN YAMAIL_NS_BEGIN YAMAIL_NS_MEMORY_BEGIN 13 | #define YAMAIL_FQNS_MEMORY_END YAMAIL_NS_MEMORY_END YAMAIL_NS_END 14 | 15 | #endif // _YAMAIL_MEMORY_NAMESPACE_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_NAMESPACE_H_ 2 | #define _YAMAIL_NAMESPACE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #define YAMAIL_NS yamail_100000 8 | #define YAMAIL_FQNS ::YAMAIL_NS 9 | 10 | #define YAMAIL_NS_BEGIN namespace YAMAIL_NS { 11 | #define YAMAIL_NS_END } 12 | 13 | #define YAMAIL_FQNS_BEGIN YAMAIL_NS_BEGIN 14 | #define YAMAIL_FQNS_END YAMAIL_NS_END 15 | 16 | #define YAMAIL_NS_ALIAS yamail 17 | #define YAMAIL_NS_ALIAS_SHORT y 18 | #define YAMAIL_FQNS_ALIAS ::YAMAIL_NS_ALIAS 19 | 20 | YAMAIL_NS_BEGIN 21 | YAMAIL_NS_END 22 | 23 | // namespace YAMAIL_NS_ALIAS = YAMAIL_FQNS; 24 | // namespace YAMAIL_NS_ALIAS_SHORT = YAMAIL_FQNS; 25 | 26 | #ifdef GENERATING_DOCUMENTATION 27 | namespace y { using namespace yamail; } 28 | #else 29 | namespace YAMAIL_NS_ALIAS { using namespace YAMAIL_FQNS; } 30 | namespace YAMAIL_NS_ALIAS_SHORT { using namespace YAMAIL_FQNS; } 31 | #endif 32 | 33 | #endif // _YAMAIL_NAMESPACE_H_ 34 | -------------------------------------------------------------------------------- /include/yamail/traits.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_TRAITS_H_ 2 | #define _YAMAIL_TRAITS_H_ 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #endif // _YAMAIL_TRAITS_H_ 11 | -------------------------------------------------------------------------------- /include/yamail/traits/disable_if_same_or_derived.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_TRAITS_DISABLE_IF_SAME_OR_DERIVED_H_ 2 | #define _YAMAIL_TRAITS_DISABLE_IF_SAME_OR_DERIVED_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | #if 0 8 | #include 9 | #else 10 | #include 11 | #include 12 | #include 13 | #include 14 | #endif 15 | 16 | YAMAIL_NS_BEGIN 17 | YAMAIL_NS_TRAITS_BEGIN 18 | 19 | #if 0 20 | 21 | template 22 | struct disable_if_same_or_derived : std::enable_if< 23 | ! std::is_base_of< 24 | From 25 | , typename std::remove_reference::type 26 | >::value 27 | , Ret 28 | > 29 | { 30 | }; 31 | 32 | template 33 | struct anable_if_same_or_derived : std::enable_if< 34 | std::is_base_of< 35 | From 36 | , typename std::remove_reference::type 37 | >::value 38 | , Ret 39 | > 40 | { 41 | }; 42 | 43 | #else 44 | 45 | template 46 | struct enable_if_same_or_derived : boost::enable_if< 47 | boost::is_base_of< 48 | From 49 | , typename boost::remove_reference::type 50 | > 51 | , Ret 52 | > 53 | { 54 | }; 55 | 56 | template 57 | struct disable_if_same_or_derived : boost::disable_if< 58 | boost::is_base_of< 59 | From 60 | , typename boost::remove_reference::type 61 | > 62 | , Ret 63 | > 64 | { 65 | }; 66 | 67 | #endif 68 | 69 | YAMAIL_NS_TRAITS_END 70 | YAMAIL_NS_END 71 | 72 | #endif // _YAMAIL_TRAITS_DISABLE_IF_SAME_OR_DERIVED_H_ 73 | -------------------------------------------------------------------------------- /include/yamail/traits/enable_if_convertible.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_TRAITS_ENABLE_IF_CONVERTIBLE_H_ 2 | #define _YAMAIL_TRAITS_ENABLE_IF_CONVERTIBLE_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #if 0 9 | #include 10 | #else 11 | #include 12 | #include 13 | #include 14 | #include 15 | #endif 16 | 17 | YAMAIL_NS_BEGIN 18 | YAMAIL_NS_TRAITS_BEGIN 19 | 20 | #if 0 21 | template 22 | struct enable_if_convertible : std::enable_if< 23 | std::is_same::value || std::is_convertible::value 24 | , Ret 25 | > 26 | { 27 | }; 28 | template 29 | struct disable_if_convertible : std::disable_if< 30 | std::is_same::value || std::is_convertible::value 31 | , Ret 32 | > 33 | { 34 | }; 35 | #else 36 | template 37 | struct enable_if_convertible : boost::enable_if< 38 | boost::mpl::or_< 39 | boost::is_same 40 | , boost::is_convertible 41 | > 42 | , Ret 43 | > 44 | { 45 | }; 46 | template 47 | struct disable_if_convertible : boost::disable_if< 48 | boost::mpl::or_< 49 | boost::is_same 50 | , boost::is_convertible 51 | > 52 | , Ret 53 | > 54 | { 55 | }; 56 | #endif 57 | 58 | YAMAIL_NS_TRAITS_END 59 | YAMAIL_NS_END 60 | 61 | #endif // _YAMAIL_TRAITS_ENABLE_IF_CONVERTIBLE_H_ 62 | -------------------------------------------------------------------------------- /include/yamail/traits/enable_if_value_or_ref.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_TRAITS_ENABLE_IF_VALUE_OR_REF_H_ 2 | #define _YAMAIL_TRAITS_ENABLE_IF_VALUE_OR_REF_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #if 0 9 | #include 10 | #else 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #endif 17 | 18 | YAMAIL_NS_BEGIN 19 | YAMAIL_NS_TRAITS_BEGIN 20 | 21 | #if 0 22 | template 23 | struct enable_if_value_or_ref : std::enable_if< 24 | std::is_same< 25 | typename std::remove_const< 26 | typename std::remove_reference::type 27 | >::type 28 | , To 29 | >::value 30 | , Ret 31 | > 32 | { 33 | }; 34 | 35 | #else 36 | 37 | template 38 | struct enable_if_value_or_ref : boost::enable_if< 39 | boost::is_same< 40 | typename boost::remove_const< 41 | typename boost::remove_reference::type 42 | >::type 43 | , To 44 | > 45 | , Ret 46 | > 47 | { 48 | }; 49 | 50 | #endif 51 | 52 | YAMAIL_NS_TRAITS_END 53 | YAMAIL_NS_END 54 | 55 | #endif // _YAMAIL_TRAITS_ENABLE_IF_VALUE_OR_REF_H_ 56 | -------------------------------------------------------------------------------- /include/yamail/traits/enable_type.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_TRAITS_ENABLE_TYPE_H_ 2 | #define _YAMAIL_TRAITS_ENABLE_TYPE_H_ 3 | #include 4 | #include 5 | 6 | YAMAIL_FQNS_TRAITS_BEGIN 7 | 8 | namespace detail { 9 | 10 | struct enable_type{}; 11 | 12 | } 13 | 14 | YAMAIL_FQNS_TRAITS_END 15 | 16 | #endif // _YAMAIL_TRAITS_ENABLE_TYPE_H_ 17 | -------------------------------------------------------------------------------- /include/yamail/traits/is_complete.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_TRAITS_IS_COMPLETE_H_ 2 | #define _YAMAIL_TRAITS_IS_COMPLETE_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #if YAMAIL_CPP >= 11 9 | # include 10 | #else // boost emulation 11 | # include 12 | # include 13 | #endif 14 | 15 | YAMAIL_FQNS_TRAITS_BEGIN 16 | 17 | namespace detail { 18 | 19 | #if YAMAIL_CPP >= 11 20 | template 21 | struct is_complete_helper { 22 | template 23 | static auto test (U*) -> std::integral_constant; 24 | static auto test (...) -> std::false_type; 25 | 26 | using type = decltype (test ((T*) 0)); 27 | }; 28 | #else 29 | template 30 | struct is_complete_helper { 31 | template 32 | static boost::integral_constant test (U*); 33 | static boost::false_type test (...); 34 | 35 | typedef BOOST_TYPEOF (test ((T*) 0)) type; 36 | }; 37 | #endif 38 | 39 | } // namespace detail 40 | 41 | template 42 | struct is_complete : detail::is_complete_helper::type {}; 43 | 44 | 45 | 46 | YAMAIL_FQNS_TRAITS_END 47 | 48 | #endif // _YAMAIL_TRAITS_IS_COMPLETE_H_ 49 | -------------------------------------------------------------------------------- /include/yamail/traits/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_TRAITS_NAMESPACE_H_ 2 | #define _YAMAIL_TRAITS_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_TRAITS traits 7 | #define YAMAIL_FQNS_TRAITS YAMAIL_FQNS::YAMAIL_NS_TRAITS 8 | 9 | #define YAMAIL_NS_TRAITS_BEGIN namespace YAMAIL_NS_TRAITS { 10 | #define YAMAIL_NS_TRAITS_END } 11 | 12 | #define YAMAIL_FQNS_TRAITS_BEGIN YAMAIL_NS_BEGIN YAMAIL_NS_TRAITS_BEGIN 13 | #define YAMAIL_FQNS_TRAITS_END YAMAIL_NS_TRAITS_END YAMAIL_NS_END 14 | 15 | #endif // _YAMAIL_TRAITS_NAMESPACE_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/utility.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_UTILITY_H_ 2 | #define _YAMAIL_UTILITY_H_ 3 | #include 4 | 5 | #if YAMAIL_CPP >= 11 6 | # include 7 | # include 8 | # include 9 | # include 10 | # include 11 | #endif 12 | 13 | #include 14 | 15 | #endif // _YAMAIL_UTILITY_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/utility/copy_test.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_UTILITY_COPY_TEST_H_ 2 | #define _YAMAIL_UTILITY_COPY_TEST_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #if defined(GENERATING_DOCUMENTATION) 9 | }} 10 | #else 11 | YAMAIL_FQNS_UTILITY_BEGIN 12 | #endif // GENERATING_DOCUMENTATION 13 | 14 | class copy_test 15 | { 16 | static int id () 17 | { 18 | static int id_; 19 | return ++id_; 20 | } 21 | 22 | int id_; 23 | 24 | public: 25 | copy_test () : id_ (id ()) { print ("CTOR_DEFAULT"); } 26 | copy_test (int i) : id_ (id ()) { print ("CTOR_INT"); } 27 | template copy_test (U) : id_ (id ()) { print ("CTOR_U"); } 28 | copy_test (copy_test const& x) : id_ (id ()) { print ("CTOR_COPY", x); } 29 | 30 | copy_test& operator= (copy_test const& x) 31 | { 32 | print ("ASSIGN_COPY", x); 33 | return *this; 34 | } 35 | 36 | #if YAMAIL_USE_RVALUES 37 | copy_test (copy_test&& x) : id_ (id ()) { print ("CTOR_MOVE", x); } 38 | copy_test& operator= (copy_test&& x) 39 | { 40 | print ("ASSIGN_MOVE", x); 41 | return *this; 42 | } 43 | #endif 44 | 45 | ~copy_test () 46 | { 47 | print ("DTOR"); 48 | } 49 | 50 | int ping () const 51 | { 52 | print ("PING"); 53 | return id_; 54 | } 55 | 56 | private: 57 | void print_helper (std::string const& s) const 58 | { 59 | std::cout << "ID:" << id_ << ": " 60 | << (void*) this; 61 | 62 | if (! s.empty ()) 63 | std::cout << ": " << s; 64 | } 65 | 66 | void print (std::string const& s) const 67 | { 68 | print_helper (s); 69 | std::cout << "\n"; 70 | } 71 | 72 | void print (std::string const& s, copy_test const& x) const 73 | { 74 | print_helper (s); 75 | std::cout << " <=== "; 76 | x.print_helper (""); 77 | std::cout << "\n"; 78 | } 79 | }; 80 | 81 | 82 | #if defined(GENERATING_DOCUMENTATION) 83 | }} 84 | #else 85 | YAMAIL_FQNS_UTILITY_END 86 | #endif // GENERATING_DOCUMENTATION 87 | 88 | #endif // _YAMAIL_UTILITY_COPY_TEST_H_ 89 | -------------------------------------------------------------------------------- /include/yamail/utility/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_UTILITY_NAMESPACE_H_ 2 | #define _YAMAIL_UTILITY_NAMESPACE_H_ 3 | #include 4 | #include 5 | 6 | #define YAMAIL_NS_UTILITY utility 7 | #define YAMAIL_FQNS_UTILITY YAMAIL_FQNS::YAMAIL_NS_UTILITY 8 | 9 | #define YAMAIL_NS_UTILITY_BEGIN namespace YAMAIL_NS_UTILITY { 10 | #define YAMAIL_NS_UTILITY_END } 11 | 12 | #define YAMAIL_FQNS_UTILITY_BEGIN YAMAIL_NS_BEGIN YAMAIL_NS_UTILITY_BEGIN 13 | #define YAMAIL_FQNS_UTILITY_END YAMAIL_NS_UTILITY_END YAMAIL_NS_END 14 | 15 | #endif // _YAMAIL_UTILITY_NAMESPACE_H_ 16 | -------------------------------------------------------------------------------- /include/yamail/utility/rref.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_UTILITY_RREF_H_ 2 | #define _YAMAIL_UTILITY_RREF_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #if YAMAIL_CPP < 11 11 | 12 | # error This file requires compiler and library support for the \ 13 | ISO C++ 2011 standard. This support is currently experimental, and must be \ 14 | enabled with the -std=c++11 or -std=gnu++11 compiler options. 15 | 16 | #else 17 | 18 | #if defined(GENERATING_DOCUMENTATION) 19 | }} 20 | #else 21 | YAMAIL_FQNS_UTILITY_BEGIN 22 | #endif // GENERATING_DOCUMENTATION 23 | 24 | /// std::rref emulation for c++11. 25 | /// Used to emulate move lambda capture. 26 | 27 | // Usage: 28 | // std::unique_ptr p{new int(0)}; 29 | // auto rref = make_rref( std::move(p) ); 30 | // auto lambda = 31 | // [rref]() mutable -> std::unique_ptr { return rref.move(); }; 32 | 33 | template 34 | struct rref_impl 35 | { 36 | rref_impl () = delete; 37 | rref_impl (T&& x) : x { std::move (x) } {} 38 | rref_impl (rref_impl& other) 39 | : x (std::move (other.x)) 40 | , is_copied (true) 41 | { 42 | assert (other.is_copied == false); 43 | } 44 | 45 | rref_impl (rref_impl&& other) 46 | : x (std::move (other.x)) 47 | , is_copied (std::move (other.is_copied)) 48 | { 49 | } 50 | 51 | rref_impl& operator= (rref_impl other) = delete; 52 | 53 | T&& move () { return std::move (x); } 54 | 55 | private: 56 | T x; 57 | bool is_copied = false; 58 | }; 59 | 60 | template rref_impl make_rref (T&& x) 61 | { 62 | return rref_impl { std::move (x) }; 63 | } 64 | 65 | 66 | #if defined(GENERATING_DOCUMENTATION) 67 | }} 68 | #else 69 | YAMAIL_FQNS_UTILITY_END 70 | #endif // GENERATING_DOCUMENTATION 71 | 72 | #endif // c++11 73 | 74 | #endif // _YAMAIL_UTILITY_RREF_H_ 75 | -------------------------------------------------------------------------------- /include/yamail/utility/storage.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_UTILITY_STORAGE_H_ 2 | #define _YAMAIL_UTILITY_STORAGE_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #if defined(GENERATING_DOCUMENTATION) 10 | namespace yamail { namespace utility { 11 | #else 12 | YAMAIL_FQNS_UTILITY_BEGIN 13 | #endif // GENERATING_DOCUMENTATION 14 | 15 | /// Creates aligned storage for temporary values. 16 | template 17 | struct storage 18 | { 19 | bool created; 20 | 21 | typename boost::aligned_storage< 22 | sizeof (T) 23 | , boost::alignment_of::value 24 | >::type data; 25 | 26 | _constexpr storage () _noexcept : created (false) {} 27 | ~storage () 28 | { 29 | if (created) 30 | reinterpret_cast (&data)->~T (); 31 | } 32 | }; // struct storage 33 | 34 | #if defined(GENERATING_DOCUMENTATION) 35 | }} // namespace yamail::utility 36 | #else 37 | YAMAIL_FQNS_UTILITY_END 38 | #endif // GENERATING_DOCUMENTATION 39 | 40 | 41 | #endif // _YAMAIL_UTILITY_STORAGE_H_ 42 | -------------------------------------------------------------------------------- /include/yamail/utility/update_iterator.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_UTILITY_UPDATE_ITERATOR_H_ 2 | #define _YAMAIL_UTILITY_UPDATE_ITERATOR_H_ 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | #if defined(GENERATING_DOCUMENTATION) 11 | namespace yamail { namespace utility { 12 | #else 13 | YAMAIL_FQNS_UTILITY_BEGIN 14 | #endif // GENERATING_DOCUMENTATION 15 | 16 | template 17 | class update_iterator 18 | : public std::iterator 19 | { 20 | protected: 21 | Container* container; 22 | 23 | public: 24 | typedef Container container_type; 25 | 26 | explicit update_iterator (Container& x) 27 | : container (YAMAIL_FQNS_COMPAT::addressof (x)) {} 28 | 29 | update_iterator& 30 | operator= (const typename Container::value_type& value) 31 | { 32 | std::pair ret = 33 | container->insert(value); 34 | 35 | if (! ret.second) ret.first->second = value; 36 | return *this; 37 | } 38 | 39 | #if 0 // YAMAIL_CPP >= 11 40 | update_iterator& operator= (typename Container::value_type&& value) 41 | { iter=container->insert(iter,std::move(value)); ++iter; return *this; } 42 | #endif 43 | 44 | update_iterator& operator* () 45 | { return *this; } 46 | 47 | update_iterator& operator++ () 48 | { return *this; } 49 | 50 | update_iterator operator++ (int) 51 | { return *this; } 52 | }; 53 | 54 | template 55 | update_iterator 56 | updater (Container& x) 57 | { 58 | return update_iterator (x); 59 | } 60 | 61 | #if defined(GENERATING_DOCUMENTATION) 62 | }} // namespace yamail::utility 63 | #else 64 | YAMAIL_FQNS_UTILITY_END 65 | #endif // GENERATING_DOCUMENTATION 66 | 67 | 68 | #endif // _YAMAIL_UTILITY_UPDATE_ITERATOR_H_ 69 | -------------------------------------------------------------------------------- /include/yamail/version.h: -------------------------------------------------------------------------------- 1 | #ifndef _YAMAIL_VERSION_H_ 2 | #define _YAMAIL_VERSION_H_ 3 | #include 4 | 5 | #define YAMAIL_VERSION 100000 6 | 7 | #define YAMAIL_VERSION_MAJOR (YAMAIL_VERSION / 100000) 8 | #define YAMAIL_VERSION_MINOR (YAMAIL_VERSION / 100 & 1000) 9 | #define YAMAIL_VERSION_PATCH (YAMAIL_VERSION % 100) 10 | 11 | // Date based version 12 | #define YAMAIL_REVISION_DATE 20140115000 13 | 14 | // SCCS based REVISION 15 | #define YAMAIL_REVISION_SCCS 1000 16 | 17 | #define YAMAIL_VERSION_STRING "1_00" 18 | 19 | #endif // _YAMAIL_VERSION_H_ 20 | -------------------------------------------------------------------------------- /src/log/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(SOURCES 3 | log.cc 4 | log_rotate.cc 5 | rotate_text_file_backend.cc 6 | uniq_task_log_attr.cc 7 | ) 8 | -------------------------------------------------------------------------------- /src/log/datetime_formatter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | YAMAIL_FQNS_LOG_BEGIN 9 | 10 | class timestamp_formatter_factory: 11 | public boost::log::basic_formatter_factory 12 | { 13 | public: 14 | formatter_type create_formatter(boost::log::attribute_name const& name, 15 | args_map const& args) 16 | { 17 | namespace expr = boost::log::expressions; 18 | typedef boost::posix_time::ptime ptime_type; 19 | args_map::const_iterator it = args.find("format"); 20 | if (it != args.end()) 21 | return expr::stream << expr::format_date_time( 22 | expr::attr(name), it->second); 23 | else 24 | return expr::stream << expr::attr(name); 25 | } 26 | }; 27 | 28 | YAMAIL_FQNS_LOG_END 29 | -------------------------------------------------------------------------------- /src/log/log.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if BOOST_VERSION < 104600 4 | # include "log-144.h" 5 | #elif BOOST_VERSION < 105400 6 | # include "log-146.h" 7 | #else 8 | # include "log-154.h" 9 | #endif 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/log/log_rotate.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | YAMAIL_NS_BEGIN 4 | YAMAIL_NS_LOG_BEGIN 5 | 6 | log_rotate_manager log_rotater; 7 | 8 | log_rotate_manager& log_rotate_manager::instance() 9 | { 10 | return log_rotater; 11 | } 12 | 13 | void log_rotate_manager::register_sink(sink_support_rotate_ptr sink) 14 | { 15 | sinks_.push_back(sink); 16 | } 17 | 18 | void log_rotate_manager::unregister_sink(sink_support_rotate_ptr sink) 19 | { 20 | sinks_.remove(sink); 21 | } 22 | 23 | void log_rotate_manager::do_rotate() 24 | { 25 | for (sinks_list::iterator i = sinks_.begin(), i_end = sinks_.end(); 26 | i != i_end; ++i) 27 | { 28 | (*i)->rotate(); 29 | } 30 | } 31 | 32 | YAMAIL_NS_LOG_END 33 | YAMAIL_NS_END 34 | -------------------------------------------------------------------------------- /src/memory/composite_limiter_factory.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | YAMAIL_FQNS_MEMORY_BEGIN 4 | 5 | void composite_limiter_factory::init(composite_limiter_factory::type t) 6 | { 7 | type_ = t; 8 | } 9 | 10 | composite_limiter composite_limiter_factory::make_composite_limiter(const std::string& name) 11 | { 12 | switch(type_) 13 | { 14 | case FUZZY: 15 | return make_composite_fuzzy_limiter(name); 16 | case STRICT: 17 | return make_composite_strict_limiter(name); 18 | default: 19 | break; 20 | } 21 | return make_composite_unlimited_limiter(name); 22 | } 23 | 24 | 25 | limiter composite_limiter_factory::make_limiter(size_t limit, const std::string& name) 26 | { 27 | switch(type_) 28 | { 29 | case FUZZY: 30 | return make_fuzzy_limiter(limit, name); 31 | case STRICT: 32 | return make_basic_limiter(limit, name); // it's not a mistake 33 | default: 34 | break; 35 | } 36 | return make_unlimited_limiter(limit, name); // hide warning 37 | } 38 | 39 | YAMAIL_FQNS_MEMORY_END 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /tests/concurrency/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(future) 2 | -------------------------------------------------------------------------------- /tests/concurrency/future/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_SOURCE_DIR}/include .) 2 | 3 | set(DEPENDENCIES 4 | ${TARGET_LIBRARY} 5 | ${LIBS} 6 | ${GTEST_LIBRARY} 7 | ${GTEST_MAIN_LIBRARY} 8 | ) 9 | 10 | file(GLOB_RECURSE SOURCES "*.cc") 11 | 12 | add_executable("future-test" ${SOURCES}) 13 | target_link_libraries("future-test" ${DEPENDENCIES}) 14 | add_test("future-test" "future-test") 15 | -------------------------------------------------------------------------------- /tests/data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #add_subdirectory(config) 2 | add_subdirectory(zerocopy) 3 | -------------------------------------------------------------------------------- /tests/data/config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_testing() 2 | #find_package(Check REQUIRED) 3 | include_directories(${CMAKE_SOURCE_DIR}/include .) 4 | # include_directories(${CHECK_INCLUDE_DIRS}) 5 | # set(LIBS ${LIBS} ${CHECK_LIBRARIES} isti_clib) 6 | 7 | add_executable(include_opener include_opener.cc) 8 | target_link_libraries(include_opener ${LIBS}) 9 | add_test(include_opener ${CMAKE_CURRENT_BINARY_DIR}/include_opener) 10 | -------------------------------------------------------------------------------- /tests/data/config/include_opener-2.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | struct Parser 6 | { 7 | template 8 | bool operator() (AST&& ast, PATH&& path, ITER&& i1, ITER&& i2, FS&& fs) 9 | { 10 | std::cout << "opening: " << path << "\n"; 11 | // std::cout << boost::make_iterator_range (i1, i2) << "\n";; 12 | return true; 13 | } 14 | }; 15 | 16 | using namespace y::data::config::detail; 17 | 18 | #include 19 | 20 | int main () 21 | { 22 | Parser p; 23 | boost_fs_handler<> fs; 24 | include_cache io (p, fs); 25 | 26 | boost::timer::auto_cpu_timer t; 27 | for (unsigned int i=0; i<100000; ++i) 28 | io ("include_opener.cc"); 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tests/data/config/t: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/tests/data/config/t -------------------------------------------------------------------------------- /tests/data/config/t.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace y::utility; 7 | using namespace std; 8 | 9 | struct A { 10 | A () {} 11 | // string s; 12 | }; 13 | 14 | void foo2 (rw_in a) {} 15 | void foo (rw_in const& a) 16 | { 17 | // a->i = 66; 18 | } 19 | 20 | #include 21 | int main () 22 | { 23 | // copy_test const a; 24 | 25 | { 26 | boost::timer::auto_cpu_timer t; 27 | for (unsigned long i=0; i<1000000000; ++i) foo (A ()); 28 | } 29 | 30 | { 31 | boost::timer::auto_cpu_timer t; 32 | for (unsigned long i=0; i<1000000000; ++i) foo2 (A ()); 33 | } 34 | // cout << "a.i = " << a.i << "\n"; 35 | } 36 | -------------------------------------------------------------------------------- /tests/data/select_map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/yamail/4993ba0e383afa8a233719b7d345b267010acba4/tests/data/select_map -------------------------------------------------------------------------------- /tests/data/select_map.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main () 6 | { 7 | namespace data = YAMAIL_FQNS_DATA; 8 | namespace compat = YAMAIL_FQNS_COMPAT; 9 | 10 | 11 | using std::is_same; 12 | using data::select_map; 13 | namespace kwd = data::keywords; 14 | using compat::unordered_map; 15 | 16 | // select_map m; 17 | 18 | static_assert ( 19 | (is_same, 20 | unordered_map> >::value), 21 | "bad select_map"); 22 | 23 | enum Enum { A, B, C }; 24 | 25 | static_assert ( 26 | (is_same >, 27 | unordered_map> >::value), 28 | "bad select_map >"); 29 | 30 | static_assert ( 31 | (is_same, 32 | std::map >::value), 33 | "bad select_map"); 34 | 35 | static_assert ( 36 | (is_same, 37 | std::map >::value), 38 | "bad select_map"); 39 | 40 | 41 | struct Struct 42 | { 43 | void* v; 44 | 45 | bool operator< (Struct const&) const 46 | { 47 | return 0; 48 | } 49 | } s; 50 | 51 | select_map n2; 52 | n2[s] = 'd'; 53 | 54 | static_assert ( 55 | (is_same, 56 | std::map >::value), 57 | "bad select_map"); 58 | } 59 | -------------------------------------------------------------------------------- /tests/data/zerocopy/.gitignore: -------------------------------------------------------------------------------- 1 | /zerocopy-test 2 | -------------------------------------------------------------------------------- /tests/data/zerocopy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file( GLOB ZEROCOPY_TEST_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc" ) 2 | 3 | add_executable(zerocopy-test EXCLUDE_FROM_ALL ../../main.cc ${ZEROCOPY_TEST_SOURCES} ) 4 | 5 | add_dependencies(zerocopy-test googletest googlemock) 6 | 7 | target_link_libraries( zerocopy-test ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} ) -------------------------------------------------------------------------------- /tests/data/zerocopy/allocator_mock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * allocator_mock.h 3 | * 4 | * Allocator mock class and necessary stuff for mocking 5 | */ 6 | 7 | #ifndef ALLOCATOR_MOCK_H_170320141557 8 | #define ALLOCATOR_MOCK_H_170320141557 9 | 10 | #include 11 | #include 12 | 13 | namespace testing { 14 | 15 | template 16 | struct AllocatorMock { 17 | typedef std::size_t size_type; 18 | typedef T * pointer; 19 | MOCK_METHOD1_T(allocate, pointer(size_type size)); 20 | MOCK_METHOD2_T(deallocate, void(pointer buf, size_type size)); 21 | }; 22 | 23 | template 24 | struct AllocatorMockWrapper { 25 | Mock & mock; 26 | typedef typename Mock::size_type size_type; 27 | typedef typename Mock::pointer pointer; 28 | 29 | AllocatorMockWrapper(Mock & mock) : mock(mock) { 30 | } 31 | 32 | pointer allocate(size_type size) { 33 | return mock.allocate(size); 34 | } 35 | void deallocate(pointer buf, size_type size) { 36 | mock.deallocate(buf, size); 37 | } 38 | 39 | template 40 | struct rebind { 41 | typedef AllocatorMockWrapper< AllocatorMock > other; 42 | }; 43 | }; 44 | 45 | } // namespace testing 46 | 47 | #endif /* ALLOCATOR_MOCK_H_170320141557 */ 48 | -------------------------------------------------------------------------------- /tests/dummy-test.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TEST(TraditionalDummyTest, foo) { 4 | SUCCEED(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/main.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) { 4 | testing::InitGoogleTest(&argc, argv); 5 | return RUN_ALL_TESTS(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/memory/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | enable_testing() 2 | include_directories(${CMAKE_SOURCE_DIR}/include .) 3 | 4 | 5 | set(DEPENDENCIES 6 | ${TARGET_LIBRARY} 7 | ${LIBS} 8 | ${GTEST_LIBRARY} 9 | ${GTEST_MAIN_LIBRARY} 10 | ) 11 | 12 | file(GLOB_RECURSE SOURCES "*.cc") 13 | 14 | add_executable("memory-test" ${SOURCES}) 15 | target_link_libraries("memory-test" ${DEPENDENCIES}) 16 | add_test("memory-test" "memory-test") 17 | 18 | --------------------------------------------------------------------------------