├── README.markdown ├── fri ├── Boost.Process.pdf ├── liaw_wrapup.pdf ├── utree_talk.odp └── utree_talk.pdf ├── mon ├── Boost.Build.pdf ├── boostcon2011_geneva.pdf ├── cpp0x_overview.pdf ├── leesa_boostcon.pdf ├── liaw_overview.pdf ├── phoenix_v3.pdf ├── phoenix_v3.ppt ├── proto.pdf └── thinking_asynchronously.pdf ├── thu ├── Awesomest.pdf ├── Boost.Generic.pdf ├── BoostCon2011Funding.pdf ├── fast_numberical.pdf ├── mpl.graph.pdf ├── orm_with_odb_and_boost.pdf ├── pimpl.pdf ├── simd.pdf ├── voronoi_diagram_of_line_segments.pdf └── voronoi_diagram_of_line_segments.ppt ├── tue ├── boostcon_infrastructure.markdown ├── boostcon_tm_spec.pdf ├── boostcon_tm_spec.pptx ├── bsppp.pdf ├── cell_mpi.pdf ├── cell_mpi_printable.pdf ├── haskell │ ├── Bartosz1.pdf │ ├── Bartosz1.pptx │ ├── Bartosz2.pdf │ ├── Bartosz2.pptx │ ├── Bartosz3.pdf │ └── Bartosz3.pptx ├── parsing_cxx_with_gcc_plugins.pdf ├── proposed_b_tree_library.pdf └── spirit_qi_in_the_real_world.pdf └── wed ├── IPv6.pdf ├── asio_extensions ├── deadline_timer.cpp ├── deadline_timer_service.cpp └── directory_monitor.cpp ├── boehm-boostcon11.pdf ├── boehm-boostcon11.pptx ├── creating_boost_asio_extensions.pdf ├── liaw-qvm.pdf ├── lockfree_2011_slides.pdf └── unicode.pdf /README.markdown: -------------------------------------------------------------------------------- 1 | # BoostCon 2011 Presentations 2 | 3 | Monday Presentations 4 | 5 | * [Jeff Garland: Library in a week](https://github.com/boostcon/2011_presentations/raw/master/mon/liaw_overview.pdf) 6 | * [Michael Wong: C++0x Progress and Status](https://github.com/boostcon/2011_presentations/raw/master/mon/cpp0x_overview.pdf) 7 | * [Ruediger Berlich: Distributed parametric optimization with the Geneva library](https://github.com/boostcon/2011_presentations/raw/master/mon/boostcon2011_geneva.pdf) 8 | * [Christopher Kohlhoff: Thinking Asynchronously](https://github.com/boostcon/2011_presentations/raw/master/mon/thinking_asynchronously.pdf) 9 | * [Thomas Heller, Hartmut Kaiser: Phoenix V3](https://github.com/boostcon/2011_presentations/raw/master/mon/phoenix_v3.pdf) | [ppt version](https://github.com/boostcon/2011_presentations/raw/master/mon/phoenix_v3.ppt) 10 | * [Aniruddha Gokhale, Sumant Tambe: Toward Native XML Processing Using Multi-paradigm Design in C++](https://github.com/boostcon/2011_presentations/raw/master/mon/leesa_boostcon.pdf) 11 | * [Joel Falcou: Getting Jiggy with Proto](https://github.com/boostcon/2011_presentations/raw/master/mon/proto.pdf) | [GitHub](https://github.com/MetaScale/boost-con-2011/tree/master/proto) 12 | * [Boris Schaeling: A Complete Overview on Boost.Jam and Boost.build](https://github.com/boostcon/2011_presentations/raw/master/mon/Boost.Build.pdf) 13 | 14 | Tuesday Presentations 15 | 16 | * [Justin Gottschlich: Intel’s C++ Software Transactional Memory Compiler and the Draft Specification of Transactional Language Constructs for C++](https://github.com/boostcon/2011_presentations/raw/master/tue/boostcon_tm_spec.pdf) | [pptx verion](https://github.com/boostcon/2011_presentations/raw/master/tue/boostcon_tm_spec.pptx) 17 | * [Joel Falcou, Khaled Hamidouche: Automatic Hybrid MPI+OpenMP Code Generation](https://github.com/boostcon/2011_presentations/raw/master/tue/bsppp.pdf) 18 | * [Robert Stewart: Spirit.Qi in the Real World](https://github.com/boostcon/2011_presentations/raw/master/tue/spirit_qi_in_the_real_world.pdf) 19 | * [Joel Falcou, Lionel Lacassagne, Sebastian Schaetz: Mastering the Cell Broadband Engine architecture through a Boost based parallel communication library](https://github.com/boostcon/2011_presentations/raw/master/tue/cell_mpi.pdf) | [printable](https://github.com/boostcon/2011_presentations/raw/master/tue/cell_mpi_printable.pdf) 20 | * Bartosz Milewski: Haskell – The Pseudocode Language for C++ Template Metaprogramming 21 | - [Part 1](https://github.com/boostcon/2011_presentations/raw/master/tue/haskell/Bartosz1.pdf) | [pptx](https://github.com/boostcon/2011_presentations/raw/master/tue/haskell/Bartosz1.pptx) 22 | - [Part 2](https://github.com/boostcon/2011_presentations/raw/master/tue/haskell/Bartosz2.pdf) | [pptx](https://github.com/boostcon/2011_presentations/raw/master/tue/haskell/Bartosz2.pptx) 23 | - [Part 3](https://github.com/boostcon/2011_presentations/raw/master/tue/haskell/Bartosz3.pdf) | [pptx](https://github.com/boostcon/2011_presentations/raw/master/tue/haskell/Bartosz3.pptx) 24 | * [Beman Dawes: The Proposed Boost B-tree Library](https://github.com/boostcon/2011_presentations/raw/master/tue/proposed_b_tree_library.pdf) 25 | * [Boris Kolpackov: Parsing C++ with GCC plugins](https://github.com/boostcon/2011_presentations/raw/master/tue/parsing_cxx_with_gcc_plugins.pdf) 26 | * [Dave Abrahams: Boost Infrastructure Notes](https://github.com/boostcon/2011_presentations/blob/master/tue/boostcon_infrastructure.markdown) 27 | 28 | Wednesday Presentations 29 | 30 | * Boost Library in a Week: Lockfree, Autobuffer, [Fabio Fracassi: QVM](https://github.com/boostcon/2011_presentations/raw/master/wed/liaw-qvm.pdf) 31 | * [Hans Boehm: Threads and Shared Variables in C++0x – Keynote](https://github.com/boostcon/2011_presentations/raw/master/wed/boehm-boostcon11.pdf) | [pptx](https://github.com/boostcon/2011_presentations/raw/master/wed/boehm-boostcon11.pptx) 32 | * [Tony Van Eerd: Lockfree Programming Part 2: Data Structures](https://github.com/boostcon/2011_presentations/raw/master/wed/lockfree_2011_slides.pdf) 33 | * Steven Watanabe: Boost.Units 34 | * [Christopher Kohlhoff: Are You Ready for IPv6?](https://github.com/boostcon/2011_presentations/raw/master/wed/IPv6.pdf) 35 | * Cliff Green: Design Journeys with Skoot, a Peer Oriented Generic Networking Library 36 | * [Mathias Gaunard: Generic Conversion and Segmentation for Ranges: a Solution for Unicode](https://github.com/boostcon/2011_presentations/raw/master/wed/unicode.pdf) 37 | * [Boris Schaeling: Creating Boost.Asio extensions](https://github.com/boostcon/2011_presentations/raw/master/wed/creating_boost_asio_extensions.pdf) | [source code](https://github.com/boostcon/2011_presentations/tree/master/wed/asio_extentions) 38 | 39 | Thursday Presentations 40 | 41 | * Boost Library in a Week [Sebastian Redl: pimpl overview](https://github.com/boostcon/2011_presentations/raw/master/thu/pimpl.pdf) 42 | * [Bojan Nikolic: Fast numerical computation in C++: Expression Templates and Beyond to Lazy Code Generation](https://github.com/boostcon/2011_presentations/raw/master/thu/fast_numerical.pdf) 43 | * [Ruediger Berlich: Funding Boost development through national and international research programs and funds](https://github.com/boostcon/2011_presentations/raw/master/thu/BoostCon2011Funding.pdf) 44 | * [Joel Falcou, Mathias Gaunard: Practical SIMD acceleration with Boost.SIMD](https://github.com/boostcon/2011_presentations/raw/master/thu/simd.pdf) 45 | * [Boris Kolpackov: Object-relational mapping with ODB and Boost](https://github.com/boostcon/2011_presentations/raw/master/thu/orm_with_odb_and_boost.pdf) 46 | * [Christopher Kohlhoff: Why C++0x is the Awesomest Language for Network Programming](https://github.com/boostcon/2011_presentations/raw/master/thu/Awesomest.pdf) 47 | * [Matt Calabrese: Boost.Generic: Concepts without Concepts](https://github.com/boostcon/2011_presentations/raw/master/thu/Boost.Generic.pdf) 48 | * [Lucanus Simonson, Andrii Sydorchuk: Sweep-Line Algorithm for Voronoi Diagrams of Points, Line Segments and Medial Axis of Polygons in the Plane](https://github.com/boostcon/2011_presentations/raw/master/thu/voronoi_diagram_of_line_segments.pdf) | [ppt](https://github.com/boostcon/2011_presentations/raw/master/thu/voronoi_diagram_of_line_segments.ppt) 49 | * [Gordon Woodhull: Introducing MPL.Graph](https://github.com/boostcon/2011_presentations/raw/master/thu/mpl.graph.pdf) 50 | 51 | Friday Presentations 52 | 53 | * [Jeff Garland: Boost Library in a Week](https://github.com/boostcon/2011_presentations/raw/master/fri/liaw_wrapup.pdf) 54 | * [Bryce Lelbach: AST Construction with the Universal Tree](https://github.com/boostcon/2011_presentations/raw/master/fri/utree_talk.pdf) | [odp](https://github.com/boostcon/2011_presentations/raw/master/fri/utree_talk.odp) 55 | * [Boris Schaeling: Boost.Process: Process management in C++](https://github.com/boostcon/2011_presentations/raw/master/fri/Boost.Process.pdf) 56 | -------------------------------------------------------------------------------- /fri/Boost.Process.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/fri/Boost.Process.pdf -------------------------------------------------------------------------------- /fri/liaw_wrapup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/fri/liaw_wrapup.pdf -------------------------------------------------------------------------------- /fri/utree_talk.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/fri/utree_talk.odp -------------------------------------------------------------------------------- /fri/utree_talk.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/fri/utree_talk.pdf -------------------------------------------------------------------------------- /mon/Boost.Build.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/Boost.Build.pdf -------------------------------------------------------------------------------- /mon/boostcon2011_geneva.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/boostcon2011_geneva.pdf -------------------------------------------------------------------------------- /mon/cpp0x_overview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/cpp0x_overview.pdf -------------------------------------------------------------------------------- /mon/leesa_boostcon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/leesa_boostcon.pdf -------------------------------------------------------------------------------- /mon/liaw_overview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/liaw_overview.pdf -------------------------------------------------------------------------------- /mon/phoenix_v3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/phoenix_v3.pdf -------------------------------------------------------------------------------- /mon/phoenix_v3.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/phoenix_v3.ppt -------------------------------------------------------------------------------- /mon/proto.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/proto.pdf -------------------------------------------------------------------------------- /mon/thinking_asynchronously.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/mon/thinking_asynchronously.pdf -------------------------------------------------------------------------------- /thu/Awesomest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/Awesomest.pdf -------------------------------------------------------------------------------- /thu/Boost.Generic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/Boost.Generic.pdf -------------------------------------------------------------------------------- /thu/BoostCon2011Funding.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/BoostCon2011Funding.pdf -------------------------------------------------------------------------------- /thu/fast_numberical.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/fast_numberical.pdf -------------------------------------------------------------------------------- /thu/mpl.graph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/mpl.graph.pdf -------------------------------------------------------------------------------- /thu/orm_with_odb_and_boost.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/orm_with_odb_and_boost.pdf -------------------------------------------------------------------------------- /thu/pimpl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/pimpl.pdf -------------------------------------------------------------------------------- /thu/simd.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/simd.pdf -------------------------------------------------------------------------------- /thu/voronoi_diagram_of_line_segments.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/voronoi_diagram_of_line_segments.pdf -------------------------------------------------------------------------------- /thu/voronoi_diagram_of_line_segments.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/thu/voronoi_diagram_of_line_segments.ppt -------------------------------------------------------------------------------- /tue/boostcon_infrastructure.markdown: -------------------------------------------------------------------------------- 1 | * CMakify existing tests 2 | * https://github.com/boost-lib/boost-modularize/issues 3 | * https://github.com/boost-lib/accumulators/blob/master/test/CMakeLists.txt 4 | 5 | * Verify existing (build) CMakeLists.txt files 6 | * https://github.com/boost-lib/boost-modularize/issues 7 | * https://github.com/boost-lib 8 | 9 | * Design test to make sure our translation to CMake is accurate 10 | * See above 11 | 12 | * How to test buildbot configuration before deployment 13 | * https://github.com/boostpro/fossbot 14 | * https://github.com/boostpro/bbot 15 | 16 | * Testing design 17 | * How do library developers indicate what they want tested? 18 | * What gets tested automatically? 19 | * Boost Integration 20 | * Individual Library level 21 | 22 | * Review CMake code and make suggestions 23 | * https://github.com/boost-lib/boost 24 | * https://github.com/boost-lib/cmake 25 | * http://cmake.org 26 | 27 | 28 | * Review BuildBot code and make suggestions 29 | * https://github.com/boostpro/fossbot 30 | * https://github.com/boostpro/bbot 31 | * http://bbot.boostpro.com 32 | 33 | * Design buildslave ez-setup procedure 34 | * *nix 35 | * Windows 36 | 37 | * Design web interface for Bots 38 | * http://bbot.boostpro.com 39 | 40 | * Porting sat-solver 41 | * https://github.com/mloskot/sat-solver 42 | 43 | -------------------------------------------------------------------------------- /tue/boostcon_tm_spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/boostcon_tm_spec.pdf -------------------------------------------------------------------------------- /tue/boostcon_tm_spec.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/boostcon_tm_spec.pptx -------------------------------------------------------------------------------- /tue/bsppp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/bsppp.pdf -------------------------------------------------------------------------------- /tue/cell_mpi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/cell_mpi.pdf -------------------------------------------------------------------------------- /tue/cell_mpi_printable.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/cell_mpi_printable.pdf -------------------------------------------------------------------------------- /tue/haskell/Bartosz1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/haskell/Bartosz1.pdf -------------------------------------------------------------------------------- /tue/haskell/Bartosz1.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/haskell/Bartosz1.pptx -------------------------------------------------------------------------------- /tue/haskell/Bartosz2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/haskell/Bartosz2.pdf -------------------------------------------------------------------------------- /tue/haskell/Bartosz2.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/haskell/Bartosz2.pptx -------------------------------------------------------------------------------- /tue/haskell/Bartosz3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/haskell/Bartosz3.pdf -------------------------------------------------------------------------------- /tue/haskell/Bartosz3.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/haskell/Bartosz3.pptx -------------------------------------------------------------------------------- /tue/parsing_cxx_with_gcc_plugins.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/parsing_cxx_with_gcc_plugins.pdf -------------------------------------------------------------------------------- /tue/proposed_b_tree_library.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/proposed_b_tree_library.pdf -------------------------------------------------------------------------------- /tue/spirit_qi_in_the_real_world.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/tue/spirit_qi_in_the_real_world.pdf -------------------------------------------------------------------------------- /wed/IPv6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/wed/IPv6.pdf -------------------------------------------------------------------------------- /wed/asio_extensions/deadline_timer.cpp: -------------------------------------------------------------------------------- 1 | #define _WIN32_WINNT 0x0501 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | // ----- I/O object 8 | 9 | template > 10 | class deadline_timer 11 | : public boost::asio::basic_io_object 12 | { 13 | public: 14 | explicit deadline_timer(boost::asio::io_service &io_service) 15 | : boost::asio::basic_io_object(io_service) 16 | { 17 | } 18 | 19 | void wait(std::size_t sec) 20 | { 21 | boost::system::error_code ec; 22 | this->service.expires_from_now(this->implementation, boost::posix_time::seconds(sec), ec); 23 | this->service.wait(this->implementation, ec); 24 | } 25 | 26 | template 27 | void async_wait(std::size_t sec, Handler handler) 28 | { 29 | boost::system::error_code ec; 30 | this->service.expires_from_now(this->implementation, boost::posix_time::seconds(sec), ec); 31 | this->service.async_wait(this->implementation, handler); 32 | } 33 | }; 34 | 35 | // ----- main 36 | 37 | void handler(const boost::system::error_code &ec) 38 | { 39 | std::cout << "handler (" << ec << ")" << std::endl; 40 | } 41 | 42 | int main() 43 | { 44 | boost::asio::io_service ioservice; 45 | deadline_timer<> dt(ioservice); 46 | dt.async_wait(3, handler); 47 | ioservice.run(); 48 | std::cin.get(); 49 | } 50 | -------------------------------------------------------------------------------- /wed/asio_extensions/deadline_timer_service.cpp: -------------------------------------------------------------------------------- 1 | #define _WIN32_WINNT 0x0501 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | // ----- Implementation 14 | 15 | class timer_impl 16 | { 17 | public: 18 | timer_impl() 19 | : handle_(CreateEvent(NULL, FALSE, FALSE, NULL)) 20 | { 21 | } 22 | 23 | ~timer_impl() 24 | { 25 | CloseHandle(handle_); 26 | } 27 | 28 | void destroy() 29 | { 30 | SetEvent(handle_); 31 | } 32 | 33 | void wait(std::size_t seconds, boost::system::error_code &ec) 34 | { 35 | DWORD res = WaitForSingleObject(handle_, seconds * 1000); 36 | if (res == WAIT_OBJECT_0) 37 | ec = boost::asio::error::operation_aborted; 38 | else 39 | ec = boost::system::error_code(); 40 | } 41 | 42 | private: 43 | HANDLE handle_; 44 | }; 45 | 46 | // ----- Service 47 | 48 | template 49 | class basic_timer_service 50 | : public boost::asio::io_service::service 51 | { 52 | public: 53 | static boost::asio::io_service::id id; 54 | 55 | explicit basic_timer_service(boost::asio::io_service &io_service) 56 | : boost::asio::io_service::service(io_service), 57 | async_work_(new boost::asio::io_service::work(async_io_service_)), 58 | async_thread_(boost::bind(&boost::asio::io_service::run, &async_io_service_)) 59 | { 60 | } 61 | 62 | typedef boost::shared_ptr implementation_type; 63 | 64 | void construct(implementation_type &impl) 65 | { 66 | impl.reset(new TimerImplementation()); 67 | } 68 | 69 | void destroy(implementation_type &impl) 70 | { 71 | impl->destroy(); 72 | impl.reset(); 73 | } 74 | 75 | void wait(implementation_type &impl, std::size_t seconds) 76 | { 77 | boost::system::error_code ec; 78 | impl->wait(seconds, ec); 79 | boost::asio::detail::throw_error(ec); 80 | } 81 | 82 | template 83 | class wait_operation 84 | { 85 | public: 86 | wait_operation(implementation_type &impl, boost::asio::io_service &io_service, std::size_t seconds, Handler handler) 87 | : impl_(impl), 88 | io_service_(io_service), 89 | work_(io_service), 90 | seconds_(seconds), 91 | handler_(handler) 92 | { 93 | } 94 | 95 | void operator()() const 96 | { 97 | implementation_type impl = impl_.lock(); 98 | if (impl) 99 | { 100 | boost::system::error_code ec; 101 | impl->wait(seconds_, ec); 102 | this->io_service_.post(boost::asio::detail::bind_handler(handler_, ec)); 103 | } 104 | else 105 | { 106 | this->io_service_.post(boost::asio::detail::bind_handler(handler_, boost::asio::error::operation_aborted)); 107 | } 108 | } 109 | 110 | private: 111 | boost::weak_ptr impl_; 112 | boost::asio::io_service &io_service_; 113 | boost::asio::io_service::work work_; 114 | std::size_t seconds_; 115 | Handler handler_; 116 | }; 117 | 118 | template 119 | void async_wait(implementation_type &impl, std::size_t seconds, Handler handler) 120 | { 121 | this->async_io_service_.post(wait_operation(impl, this->get_io_service(), seconds, handler)); 122 | } 123 | 124 | private: 125 | void shutdown_service() 126 | { 127 | async_work_.reset(); 128 | async_io_service_.stop(); 129 | async_thread_.join(); 130 | } 131 | 132 | boost::asio::io_service async_io_service_; 133 | boost::scoped_ptr async_work_; 134 | boost::thread async_thread_; 135 | }; 136 | 137 | template 138 | boost::asio::io_service::id basic_timer_service::id; 139 | 140 | // ----- I/O object 141 | 142 | template 143 | class basic_timer 144 | : public boost::asio::basic_io_object 145 | { 146 | public: 147 | explicit basic_timer(boost::asio::io_service &io_service) 148 | : boost::asio::basic_io_object(io_service) 149 | { 150 | } 151 | 152 | void wait(std::size_t seconds) 153 | { 154 | return this->service.wait(this->implementation, seconds); 155 | } 156 | 157 | template 158 | void async_wait(std::size_t seconds, Handler handler) 159 | { 160 | this->service.async_wait(this->implementation, seconds, handler); 161 | } 162 | }; 163 | 164 | // ----- main 165 | 166 | void wait_handler(const boost::system::error_code &ec) 167 | { 168 | std::cout << "handler (" << ec << ")" << std::endl; 169 | } 170 | 171 | typedef basic_timer > timer; 172 | 173 | int main() 174 | { 175 | boost::asio::io_service io_service; 176 | timer t(io_service); 177 | t.async_wait(5, wait_handler); 178 | io_service.run(); 179 | std::cin.get(); 180 | } 181 | -------------------------------------------------------------------------------- /wed/asio_extensions/directory_monitor.cpp: -------------------------------------------------------------------------------- 1 | #define _WIN32_WINNT 0x0501 2 | #define BOOST_FILESYSTEM_VERSION 3 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | // ----- I/O object 11 | 12 | class directory_monitor 13 | { 14 | public: 15 | directory_monitor(boost::asio::io_service &io_service, const boost::filesystem::path &directory) 16 | : handle_(io_service) 17 | { 18 | boost::system::error_code ec; 19 | 20 | HANDLE handle = CreateFileW(directory.wstring().c_str(), FILE_LIST_DIRECTORY, 21 | FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, 22 | OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, 0); 23 | 24 | if (handle == INVALID_HANDLE_VALUE) 25 | { 26 | ec.assign(::GetLastError(), boost::system::system_category()); 27 | } 28 | else 29 | { 30 | handle_.assign(handle, ec); 31 | if (ec) 32 | CloseHandle(handle); 33 | } 34 | 35 | if (ec) 36 | throw boost::system::system_error(ec); 37 | } 38 | 39 | void close() 40 | { 41 | handle_.close(); 42 | } 43 | 44 | template 45 | void async_wait(Handler handler) 46 | { 47 | wait_op op = 48 | { 49 | handler, 50 | boost::shared_array(new unsigned char[16384]) 51 | }; 52 | 53 | boost::asio::windows::overlapped_ptr overlapped(handle_.get_io_service(), op); 54 | 55 | DWORD length = 0; 56 | if (!ReadDirectoryChangesW(handle_.native(), op.buffer_.get(), 16384, 57 | TRUE, FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_CREATION 58 | | FILE_NOTIFY_CHANGE_FILE_NAME, &length, overlapped.get(), 0)) 59 | { 60 | boost::system::error_code ec(::GetLastError(), boost::system::system_category()); 61 | overlapped.complete(ec, 0); 62 | } 63 | else 64 | { 65 | overlapped.release(); 66 | } 67 | } 68 | 69 | private: 70 | template 71 | struct wait_op 72 | { 73 | Handler handler_; 74 | boost::shared_array buffer_; 75 | 76 | void operator()(boost::system::error_code ec, std::size_t bytes_transferred) 77 | { 78 | int action = 0; 79 | boost::filesystem::path path; 80 | 81 | if (bytes_transferred) 82 | { 83 | // TODO: Check whether there are multiple events. 84 | const FILE_NOTIFY_INFORMATION *fni = 85 | reinterpret_cast(buffer_.get()); 86 | action = fni->Action; 87 | path.assign(fni->FileName, fni->FileName + fni->FileNameLength / 2); 88 | } 89 | else if (!ec) 90 | { 91 | ec = boost::asio::error::operation_aborted; 92 | } 93 | 94 | handler_(ec, action, path); 95 | } 96 | }; 97 | 98 | boost::asio::windows::stream_handle handle_; 99 | }; 100 | 101 | // ----- main 102 | 103 | void wait_handler(const boost::system::error_code &ec, int action, const boost::filesystem::path &path) 104 | { 105 | std::cout << "ec = " << ec.message() << std::endl; 106 | std::cout << "action = " << action << std::endl; 107 | std::cout << "path = " << path << std::endl; 108 | } 109 | 110 | int main() 111 | { 112 | boost::asio::io_service io_service; 113 | directory_monitor monitor(io_service, "."); 114 | monitor.async_wait(wait_handler); 115 | io_service.run(); 116 | std::cin.get(); 117 | } 118 | -------------------------------------------------------------------------------- /wed/boehm-boostcon11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/wed/boehm-boostcon11.pdf -------------------------------------------------------------------------------- /wed/boehm-boostcon11.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/wed/boehm-boostcon11.pptx -------------------------------------------------------------------------------- /wed/creating_boost_asio_extensions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/wed/creating_boost_asio_extensions.pdf -------------------------------------------------------------------------------- /wed/liaw-qvm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/wed/liaw-qvm.pdf -------------------------------------------------------------------------------- /wed/lockfree_2011_slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/wed/lockfree_2011_slides.pdf -------------------------------------------------------------------------------- /wed/unicode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostcon/2011_presentations/748c864ed1198e4ba68389446f130e846c59e9e9/wed/unicode.pdf --------------------------------------------------------------------------------