doc, compiler to registry, simplify policies

This commit is contained in:
Jean-Louis Leroy
2025-09-05 15:28:45 -04:00
parent baff0d3f23
commit 31b48568cb
155 changed files with 76728 additions and 1307 deletions

View File

@@ -36,6 +36,10 @@ env:
LCOV_BRANCH_COVERAGE: 0
CODECOV_NAME: Github Actions
permissions:
id-token: write
pages: write
jobs:
posix:
defaults:
@@ -292,6 +296,8 @@ jobs:
rmdir /s /q boost-ci-cloned
- name: Setup Boost
env:
BOOST_BRANCH: master
run: ci\github\install.bat
- name: Run tests
@@ -453,3 +459,64 @@ jobs:
cmake -G "${{matrix.generator}}" -DBOOST_CI_INSTALL_TEST=ON -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_SHARED_LIBS=${{matrix.build_shared}} -DCMAKE_PREFIX_PATH=$HOME/local ..
cmake --build . --config ${{matrix.build_type}} -j$B2_JOBS
ctest --output-on-failure --build-config ${{matrix.build_type}}
antora:
name: Antora Docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Install packages
uses: alandefreitas/cpp-actions/package-install@v1.8.10
with:
apt-get: git cmake
- name: Clone Boost.OpenMethod
uses: actions/checkout@v4
- name: Clone Boost
uses: alandefreitas/cpp-actions/boost-clone@v1.8.10
id: boost-clone
with:
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
boost-dir: ../boost-source
scan-modules-dir: .
scan-modules-ignore: openmethod
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Build Antora Docs
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory "$(pwd)"
cd ..
BOOST_SRC_DIR="$(pwd)/boost-source"
export BOOST_SRC_DIR
cd Boost.OpenMethod
cd doc
bash ./build_antora.sh
# Antora returns zero even if it fails, so we check if the site directory exists
if [ ! -d "build/site" ]; then
echo "Antora build failed"
exit 1
fi
- name: Create Antora Docs Artifact
uses: actions/upload-artifact@v4
with:
name: antora-docs-${{ matrix.name }}
path: doc/build/site
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
path: doc/build/site
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

1
.gitignore vendored
View File

@@ -4,6 +4,7 @@ build/
builds/
**/#*#
dependencies/*
Dependencies/*
extern/*
tests/benchmarks_parameters.hpp
**/vcpkg_installed

View File

@@ -1,55 +1,64 @@
# Generated by `boostdep --cmake openmethod`
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
#
# Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
# Copyright (c) 2021 DMitry Arkhipov (grisumbras@gmail.com)
# Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/openmethod
#
cmake_minimum_required(VERSION 3.5...3.20)
#-------------------------------------------------
#
# Project
#
#-------------------------------------------------
project(boost_openmethod VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
cmake_minimum_required(VERSION 3.8...3.20)
set(BOOST_OPENMETHOD_VERSION 1)
if (BOOST_SUPERPROJECT_VERSION)
set(BOOST_OPENMETHOD_VERSION ${BOOST_SUPERPROJECT_VERSION})
endif ()
project(boost_openmethod VERSION "${BOOST_OPENMETHOD_VERSION}" LANGUAGES CXX)
set(BOOST_OPENMETHOD_IS_ROOT OFF)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(BOOST_OPENMETHOD_IS_ROOT ON)
endif()
endif ()
set(__ignore__ ${CMAKE_C_COMPILER})
if(BOOST_OPENMETHOD_IS_ROOT)
include(CTest)
endif()
if(NOT BOOST_SUPERPROJECT_VERSION)
option(BOOST_OPENMETHOD_INSTALL "Install boost::openmethod files" ON)
option(BOOST_OPENMETHOD_BUILD_TESTS "Build boost::openmethod tests" ${BUILD_TESTING})
option(BOOST_OPENMETHOD_BUILD_EXAMPLES "Build boost::openmethod examples" ${BOOST_OPENMETHOD_IS_ROOT})
else()
set(BOOST_OPENMETHOD_BUILD_TESTS ${BUILD_TESTING})
endif()
#-------------------------------------------------
#
# Options
#
#-------------------------------------------------
option(BOOST_OPENMETHOD_BUILD_TESTS "Build boost::openmethod tests even if BUILD_TESTING is OFF" OFF)
option(BOOST_OPENMETHOD_BUILD_EXAMPLES "Build boost::openmethod examples" ${BOOST_OPENMETHOD_IS_ROOT})
option(BOOST_OPENMETHOD_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF)
option(BOOST_OPENMETHOD_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
if(BOOST_OPENMETHOD_IS_ROOT)
#
# Building inside Boost tree, but as a separate project e.g. on Travis or
# other CI, or when producing Visual Studio Solution and Projects.
# Check if environment variable BOOST_SRC_DIR is set
if (NOT DEFINED BOOST_SRC_DIR AND DEFINED ENV{BOOST_SRC_DIR})
set(DEFAULT_BOOST_SRC_DIR "$ENV{BOOST_SRC_DIR}")
else ()
set(DEFAULT_BOOST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
endif ()
set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use when running CMake from this directory")
set(BOOST_INCLUDE_LIBRARIES openmethod)
set(BOOST_EXCLUDE_LIBRARIES openmethod)
list(APPEND BOOST_INCLUDE_LIBRARIES test)
if(BOOST_OPENMETHOD_BUILD_EXAMPLES)
# list(APPEND BOOST_INCLUDE_LIBRARIES optional)
endif()
#-------------------------------------------------
#
# Boost modules
#
#-------------------------------------------------
# The boost super-project requires one explicit dependency per-line.
set(CMAKE_FOLDER _deps)
add_subdirectory(../.. _deps/boost EXCLUDE_FROM_ALL)
unset(CMAKE_FOLDER)
endif()
add_library(boost_openmethod INTERFACE)
add_library(Boost::openmethod ALIAS boost_openmethod)
target_compile_features(boost_openmethod INTERFACE cxx_std_17)
target_include_directories(boost_openmethod INTERFACE include)
target_link_libraries(
boost_openmethod
INTERFACE
set(
BOOST_OPENMETHOD_DEPENDENCIES
Boost::assert
Boost::config
Boost::core
@@ -58,11 +67,119 @@ target_link_libraries(
Boost::preprocessor
)
if(BOOST_OPENMETHOD_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
foreach (BOOST_OPENMETHOD_DEPENDENCY ${BOOST_OPENMETHOD_DEPENDENCIES})
if (BOOST_OPENMETHOD_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$")
list(APPEND BOOST_OPENMETHOD_INCLUDE_LIBRARIES ${CMAKE_MATCH_1})
endif ()
endforeach ()
# Conditional dependencies
if (NOT BOOST_OPENMETHOD_MRDOCS_BUILD)
if (BUILD_TESTING OR BOOST_OPENMETHOD_BUILD_TESTS)
set(BOOST_OPENMETHOD_UNIT_TEST_LIBRARIES test)
endif()
if (BOOST_OPENMETHOD_BUILD_EXAMPLES)
#set(BOOST_OPENMETHOD_EXAMPLE_LIBRARIES json regex beast)
endif()
endif()
# Complete dependency list
set(BOOST_INCLUDE_LIBRARIES ${BOOST_OPENMETHOD_INCLUDE_LIBRARIES} ${BOOST_OPENMETHOD_UNIT_TEST_LIBRARIES} ${BOOST_OPENMETHOD_EXAMPLE_LIBRARIES})
set(BOOST_EXCLUDE_LIBRARIES openmethod)
#-------------------------------------------------
#
# Add Boost Subdirectory
#
#-------------------------------------------------
if (BOOST_OPENMETHOD_IS_ROOT)
set(CMAKE_FOLDER Dependencies)
# Find absolute BOOST_SRC_DIR
if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR})
set(BOOST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${BOOST_SRC_DIR}")
endif ()
# Validate BOOST_SRC_DIR
set(BOOST_SRC_DIR_IS_VALID ON)
foreach (F "CMakeLists.txt" "Jamroot" "boost-build.jam" "bootstrap.sh" "libs")
if (NOT EXISTS "${BOOST_SRC_DIR}/${F}")
message(STATUS "${BOOST_SRC_DIR}/${F} does not exist. Fallback to find_package.")
set(BOOST_SRC_DIR_IS_VALID OFF)
break()
endif ()
endforeach ()
# Create Boost interface targets
if (BOOST_SRC_DIR_IS_VALID)
# From BOOST_SRC_DIR
if (BUILD_SHARED_LIBS)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
set(BOOST_EXCLUDE_LIBRARIES ${PROJECT_NAME})
set(PREV_BUILD_TESTING ${BUILD_TESTING})
set(BUILD_TESTING OFF CACHE BOOL "Build the tests." FORCE)
add_subdirectory(${BOOST_SRC_DIR} Dependencies/boost EXCLUDE_FROM_ALL)
set(BUILD_TESTING ${PREV_BUILD_TESTING} CACHE BOOL "Build the tests." FORCE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${BOOST_SRC_DIR}/tools/cmake/include")
else ()
# From Boost Package
find_package(Boost REQUIRED COMPONENTS container)
foreach (BOOST_INCLUDE_LIBRARY ${BOOST_INCLUDE_LIBRARIES})
if (NOT TARGET Boost::${BOOST_INCLUDE_LIBRARY})
add_library(Boost::${BOOST_INCLUDE_LIBRARY} ALIAS Boost::headers)
endif ()
endforeach ()
endif ()
unset(CMAKE_FOLDER)
endif ()
#-------------------------------------------------
#
# Library
#
#-------------------------------------------------
file(GLOB_RECURSE BOOST_OPENMETHOD_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost PREFIX "" FILES ${BOOST_OPENMETHOD_HEADERS})
function(boost_openmethod_setup_properties target)
target_link_libraries(${target} INTERFACE ${BOOST_OPENMETHOD_DEPENDENCIES})
endfunction()
add_library(boost_openmethod INTERFACE ${BOOST_OPENMETHOD_HEADERS})
add_library(Boost::openmethod ALIAS boost_openmethod)
target_include_directories(boost_openmethod INTERFACE "${PROJECT_SOURCE_DIR}/include")
boost_openmethod_setup_properties(boost_openmethod)
target_compile_features(boost_openmethod INTERFACE cxx_std_17)
if (BOOST_OPENMETHOD_MRDOCS_BUILD)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include <boost/openmethod.hpp>\n")
foreach (HEADER ${BOOST_OPENMETHOD_HEADERS})
string(REPLACE "${PROJECT_SOURCE_DIR}/include/" "" HEADER "${HEADER}")
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include <${HEADER}>\n")
endforeach()
add_library(boost_openmethod_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
target_include_directories(boost_openmethod_mrdocs PUBLIC "${PROJECT_SOURCE_DIR}/include")
boost_openmethod_setup_properties(boost_openmethod_mrdocs)
target_link_libraries(boost_openmethod_mrdocs PUBLIC Boost::openmethod)
target_compile_definitions(boost_openmethod_mrdocs PUBLIC BOOST_OPENMETHOD_MRDOCS)
return()
endif()
if(BOOST_OPENMETHOD_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
#-------------------------------------------------
#
# Tests
#
#-------------------------------------------------
if (BUILD_TESTING OR BOOST_OPENMETHOD_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif ()
#-------------------------------------------------
#
# Examples
#
#-------------------------------------------------
if (BOOST_OPENMETHOD_BUILD_EXAMPLES)
enable_testing()
add_subdirectory(doc/modules/ROOT/examples)
endif ()

View File

@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
struct Animal {
const char* name;

View File

@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
struct Animal {
const char* name;

View File

@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
struct Animal {
const char* name;

View File

@@ -2,7 +2,7 @@
#include <vector>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
struct Animal {
const char* name;

View File

@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
struct Animal {
const char* name;

View File

@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
struct Animal {
const char* name;

View File

@@ -4,7 +4,7 @@ python3 dev/flatten.py \
include/boost/openmethod.hpp \
include/boost/openmethod/unique_ptr.hpp \
include/boost/openmethod/shared_ptr.hpp \
include/boost/openmethod/compiler.hpp
include/boost/openmethod/initialize.hpp
python3 dev/flatten.py \
flat/boost/openmethod/registry.hpp \
include/boost/openmethod/registry.hpp \

6
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
temp
out.txt
qbk/reference.qbk
node_modules
build
reference-output

32
doc/antora.yml Normal file
View File

@@ -0,0 +1,32 @@
#
# Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/openmethod
#
name: openmethod
version: ~
title: Boost.OpenMethod
start_page: index.adoc
asciidoc:
attributes:
source-language: asciidoc@
table-caption: false
nav:
- modules/ROOT/nav.adoc
ext:
cpp-reference:
config: doc/mrdocs.yml
cpp-tagfiles:
files:
- file: ./doc/tagfiles/boost-openmethod-doxygen.tag.xml
base_url: 'xref:reference:'
- file: ./doc/tagfiles/boost-openmethod-macros-doxygen.tag.xml
base_url: 'xref:reference:'
using-namespaces:
- boost::openmethod
- boost::openmethod::policies
- boost::openmethod::aliases

View File

@@ -46,7 +46,7 @@ Defined in <boost/openmethod/policies/basic_policy.hpp>. Also available via
### Description
`basic_policy` implements a policy, which consists of a a collection of methods,
classes, dispatch data, and facets, which specify how to obtain a pointer to a
classes, dispatch data, and policys, which specify how to obtain a pointer to a
v-table from an object, how to report errors, whether to perform runtime sanity
checks, etc.
@@ -75,7 +75,7 @@ Creates a new policy from an existing one. _NewPolicy_ does not share static
variables with the original _Policy_. The new policy does not retain any
knowledge of the classes and methods registered in the original.
`fork` forks the facets in the policy as well: any facet instantiated from a
`fork` forks the policys in the policy as well: any policy instantiated from a
class template is assumed to take a policy as its first template argument. The
template is re-instantiated with the new policy as the first arguments, while
the other arguments remain the same.
@@ -87,9 +87,9 @@ template<class... Facets>
using with;
```
Requires:: _Facets_ is a list of classes that derive from `facet`.
Requires:: _Facets_ is a list of classes that derive from `policy`.
Returns:: A new policy containing _Facets_, and the facets from the original
Returns:: A new policy containing _Facets_, and the policys from the original
that do not have the same category as _Facets_.
Examples::
@@ -111,9 +111,9 @@ template<class... Facets>
using without;
```
Requires:: _Facets_ is a list of facet categories.
Requires:: _Facets_ is a list of policy categories.
Returns:: A new policy containing the facets from the original that do not have
Returns:: A new policy containing the policys from the original that do not have
the same category as _Facets_.
Examples::
@@ -130,7 +130,7 @@ Examples::
struct release;
```
A policy that contains facets `std_rtti`, `fast_perfect_hash`, `vptr_vector` and
A policy that contains policys `std_rtti`, `fast_perfect_hash`, `vptr_vector` and
`default_error_handler`.
#### debug
@@ -139,7 +139,7 @@ A policy that contains facets `std_rtti`, `fast_perfect_hash`, `vptr_vector` and
struct debug;
```
The `release` policy with additional facet implementations `runtime_checks`,
The `release` policy with additional policy implementations `runtime_checks`,
`basic_error_output` and basic_trace_output.
NOTE: `debug` extends `release` but it does not a fork it. Both policies use the

28
doc/build_antora.sh Executable file
View File

@@ -0,0 +1,28 @@
#
# Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/openmethod
#
set -xe
if [ $# -eq 0 ]
then
echo "No playbook supplied, using default playbook"
PLAYBOOK="local-playbook.yml"
else
PLAYBOOK=$1
fi
echo "Building documentation with Antora..."
echo "Installing npm dependencies..."
npm ci
echo "Building docs in custom dir..."
PATH="$(pwd)/node_modules/.bin:${PATH}"
export PATH
npx antora --clean --fetch "$PLAYBOOK" --stacktrace --log-level all
echo "Done"

View File

@@ -40,7 +40,7 @@ static auto error(const Error& error) -> void;
```
Calls the function last set via `set_error_handler` or, if it was never called,
and if _Policy_ contains an `output` facet, use it to print a description
and if _Policy_ contains an `output` policy, use it to print a description
of `error`.
#### error

View File

@@ -15,11 +15,11 @@ struct deferred_static_rtti : rtti {};
### Description
`deferred_static_rtti` is a facet that defers collection of static type ids.
`deferred_static_rtti` is a policy that defers collection of static type ids.
Some custom RTTI systems rely on static constructors to assign type ids.
OpenMethod itself relies on static constructors to register classes, methods and
overriders, calling the `static_type` function from the `rtti` facet in the
overriders, calling the `static_type` function from the `rtti` policy in the
process. This can result in collecting the type ids _before_ they have been
initialized. Adding this facet to a policy moves the collection of type ids to
initialized. Adding this policy to a policy moves the collection of type ids to
`initialize`.

View File

@@ -42,10 +42,10 @@ struct type_mismatch_error : openmethod_error {
### Description
`error_handler` is a facet that handles errors.
`error_handler` is a policy that handles errors.
When an error is encountered, either during `initialize` or method dispatch, the
program is terminated via a call to `abort`. If this facet is present in the
program is terminated via a call to `abort`. If this policy is present in the
policy, its `error` function is called with an error object. It can prevent
termination by throwing an exception.

View File

@@ -8,21 +8,21 @@ Defined in <boost/openmethod/policies/basic_policy.hpp>.
```c++
namespace boost::openmethod::policies {
struct output : facet {};
struct output : policy {};
} // boost::openmethod::policies
```
### Description
`output` is a facet that provides a stream for writing error messages.
`output` is a policy that provides a stream for writing error messages.
### Requirements
#### error_stream
```c++
static RestrictedOutputStream error_stream;
static LightweightOutputStream error_stream;
```
A static variable that satisfies the requirements of `RestrictedOutputStream`.
A static variable that satisfies the requirements of `LightweightOutputStream`.

View File

@@ -1,5 +1,5 @@
## facet
## policy
### Synopsis
@@ -8,7 +8,7 @@ Defined in <boost/openmethod/policies/basic_policy.hpp>.
```c++
namespace boost::openmethod::policies {
struct facet {
struct policy {
static auto finalize() -> void;
};
@@ -17,7 +17,7 @@ struct facet {
### Description
`facet` is the base class of all facets. It provides an empty `finalize` static
`policy` is the base class of all policys. It provides an empty `finalize` static
function which can be overriden (via shadowing) by derived classes.
### Members

View File

@@ -454,7 +454,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#tutorials_smart_pointers">Smart Pointers</a></li>
<li><a href="#tutorials_alternatives_to_virtual_ptr">Alternatives to virtual_ptr</a></li>
<li><a href="#tutorials_core_api">Core API</a></li>
<li><a href="#tutorials_policies_and_facets">Policies and Facets</a></li>
<li><a href="#tutorials_policies_and_policys">Policies and Facets</a></li>
<li><a href="#tutorials_error_handling">Error Handling</a></li>
<li><a href="#tutorials_custom_rtti">Custom RTTI</a></li>
<li><a href="#tutorials_deferred_rtti">Deferred RTTI</a></li>
@@ -635,7 +635,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#virtual_ptr_non_members_2">Non-members</a></li>
</ul>
</li>
<li><a href="#virtual_ptr_facet">facet</a>
<li><a href="#virtual_ptr_policy">policy</a>
<ul class="sectlevel3">
<li><a href="#virtual_ptr_synopsis_9">Synopsis</a></li>
<li><a href="#virtual_ptr_description_9">Description</a></li>
@@ -747,7 +747,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#virtual_ptr_members_16">Members</a></li>
</ul>
</li>
<li><a href="#virtual_ptr_restrictedoutputstream">RestrictedOutputStream</a>
<li><a href="#virtual_ptr_restrictedoutputstream">LightweightOutputStream</a>
<ul class="sectlevel3">
<li><a href="#virtual_ptr_description_25">Description</a></li>
</ul>
@@ -1615,9 +1615,9 @@ readability):</p>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="asm">mov rax, qword ptr [rsi]
mov rdx, qword ptr [rip + hash_mult]
mov rdx, qword ptr [rip + mult]
imul rdx, qword ptr [rax - 8]
movzx ecx, byte ptr [rip + hash_shift]
movzx ecx, byte ptr [rip + shift]
shr rdx, cl
mov rax, qword ptr [rip + vptrs]
mov rax, qword ptr [rax + 8*rdx]
@@ -2165,7 +2165,7 @@ added elsewhere - especially in presence of dynamic loading.</p>
</div>
</div>
<div class="sect2">
<h3 id="tutorials_policies_and_facets">Policies and Facets</h3>
<h3 id="tutorials_policies_and_policys">Policies and Facets</h3>
<div class="paragraph">
<p>Methods and classes are scoped in a policy. A method can only reference classes
registered in the same policy. If a class is used as a virtual parameter in
@@ -2178,17 +2178,17 @@ argument, a policy class, which defaults to <code>policies::debug</code> in debu
and <code>policies::release</code> in release builds.</p>
</div>
<div class="paragraph">
<p>A policy has a collection of <em>facets</em>. Each facet belongs to a facet category. A
policy may contain at most one facet of a given category. Facets control how
<p>A policy has a collection of <em>policys</em>. Each policy belongs to a policy category. A
policy may contain at most one policy of a given category. Facets control how
type information is obtained, how vptrs are fetched, how errors are handled and
printed, etc. Some are used in <code>initialize</code> and method dispatch; some are used
by other facets in the same policy as part of their implementation. See the
reference for the list of facets. Policies and facets are placed in the
by other policys in the same policy as part of their implementation. See the
reference for the list of policys. Policies and policys are placed in the
<code>boost::openmethod::policies</code> namespace. Two stock policies are provided by the
library: <code>release</code> and <code>debug</code>.</p>
</div>
<div class="paragraph">
<p>The <code>release</code> policy contains the following facets:</p>
<p>The <code>release</code> policy contains the following policys:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
@@ -2198,8 +2198,8 @@ library: <code>release</code> and <code>debug</code>.</p>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">facet category</th>
<th class="tableblock halign-left valign-top">facet</th>
<th class="tableblock halign-left valign-top">policy category</th>
<th class="tableblock halign-left valign-top">policy</th>
<th class="tableblock halign-left valign-top">role</th>
</tr>
</thead>
@@ -2227,7 +2227,7 @@ library: <code>release</code> and <code>debug</code>.</p>
</tbody>
</table>
<div class="paragraph">
<p>The <code>debug</code> policy contains the same facets as <code>release</code>, plus a few more:</p>
<p>The <code>debug</code> policy contains the same policys as <code>release</code>, plus a few more:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
@@ -2237,8 +2237,8 @@ library: <code>release</code> and <code>debug</code>.</p>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">facet category</th>
<th class="tableblock halign-left valign-top">facet</th>
<th class="tableblock halign-left valign-top">policy category</th>
<th class="tableblock halign-left valign-top">policy</th>
<th class="tableblock halign-left valign-top">role</th>
</tr>
</thead>
@@ -2261,12 +2261,12 @@ library: <code>release</code> and <code>debug</code>.</p>
</tbody>
</table>
<div class="paragraph">
<p>Policies, and some facets, have static variables. When it is the case, they are
<p>Policies, and some policys, have static variables. When it is the case, they are
implemented as CRTP classes.</p>
</div>
<div class="paragraph">
<p>Policies can be created from scratch, using the <code>basic_policy</code> template, or
constructed from existing policies by adding and removing facets. For example,
constructed from existing policies by adding and removing policys. For example,
<code>policies::debug</code> is a tweak of <code>policies::release</code>:</p>
</div>
<div class="listingblock">
@@ -2295,9 +2295,9 @@ has no effect.</p>
<h3 id="tutorials_error_handling">Error Handling</h3>
<div class="paragraph">
<p>When an error is encountered, the program is terminated by a call to <code>abort</code>. If
the policy contains an <code>error_handler</code> facet, it provides an <code>error</code> member
the policy contains an <code>error_handler</code> policy, it provides an <code>error</code> member
function (or overloaded functions) to be called with an object identifying the
error. The <code>release</code> and <code>debug</code> policies implement the error facet with
error. The <code>release</code> and <code>debug</code> policies implement the error policy with
<code>default_error_handler</code>, which wraps the error object in a variant, and calls a
handler via a <code>std::function</code>. By default, it prints a description of the error
to <code>stderr</code> in the <code>debug</code> policy, and does nothing in the <code>release</code> policy. The
@@ -2366,7 +2366,7 @@ spin</code></pre>
</div>
</div>
<div class="paragraph">
<p>We can also replace the <code>error_handler</code> facet with our own. For example:</p>
<p>We can also replace the <code>error_handler</code> policy with our own. For example:</p>
</div>
<div class="listingblock">
<div class="content">
@@ -2441,7 +2441,7 @@ spin</code></pre>
</div>
</div>
<div class="paragraph">
<p>Stock facet <code>throw_error_handler</code> does this for all the exception types:</p>
<p>Stock policy <code>throw_error_handler</code> does this for all the exception types:</p>
</div>
<div class="listingblock">
<div class="content">
@@ -2567,11 +2567,11 @@ them as indexes in the table of vptrs.</p>
</div>
<div class="paragraph">
<p>This time we are going to replace the default policy globally. First we need to
define the custom RTTI facet. We must <em>not</em> include
define the custom RTTI policy. We must <em>not</em> include
<code>&lt;boost/openmethod/core.hpp&gt;</code> or any header that includes it yet.</p>
</div>
<div class="paragraph">
<p>Here is the facet implementation:</p>
<p>Here is the policy implementation:</p>
</div>
<div class="listingblock">
<div class="content">
@@ -2605,7 +2605,7 @@ struct custom_rtti : bom::policies::rtti {
</div>
</div>
<div class="paragraph">
<p>This facet is quite minimal. It does not support virtual inheritance. It would
<p>This policy is quite minimal. It does not support virtual inheritance. It would
not produce good error or trace messages, because types would be represented by
their integer ids.</p>
</div>
@@ -2678,7 +2678,7 @@ registration. It may read the custom type ids <em>before</em> they are have been
initialized.</p>
</div>
<div class="paragraph">
<p>The solution is to add the <code>deferred_static_rtti</code> facet to the policy; it defers
<p>The solution is to add the <code>deferred_static_rtti</code> policy to the policy; it defers
reading the type information until <code>initialize</code> is called.</p>
</div>
<div class="paragraph">
@@ -2740,7 +2740,7 @@ custom_type_info Cat::type_info;
</div>
</div>
<div class="paragraph">
<p>The rtti facet is the same, with one more function:</p>
<p>The rtti policy is the same, with one more function:</p>
</div>
<div class="listingblock">
<div class="content">
@@ -2761,14 +2761,14 @@ custom_type_info Cat::type_info;
</div>
</div>
<div class="paragraph">
<p>Finally, the policy contains an additional facet - <code>deferred_static_rtti</code>:</p>
<p>Finally, the policy contains an additional policy - <code>deferred_static_rtti</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="c++">struct custom_policy
: bom::policies::basic_policy&lt;
custom_policy, custom_rtti,
bom::policies::deferred_static_rtti, // &lt;-- additional facet
bom::policies::deferred_static_rtti, // &lt;-- additional policy
bom::policies::vptr_vector&lt;custom_policy&gt;&gt; {};</code></pre>
</div>
</div>
@@ -2804,7 +2804,7 @@ implementation detail, but it uses its own policy, there is no issue.
</table>
</div>
<div class="paragraph">
<p>The solution is to use a policy that contains the <code>indirect_vptr</code> facet. Instead
<p>The solution is to use a policy that contains the <code>indirect_vptr</code> policy. Instead
of storing the vptr directly, it stores a reference to the vptr.</p>
</div>
<div class="paragraph">
@@ -2828,15 +2828,15 @@ struct Carnivore : Animal {};
struct Cow : Herbivore {};
struct Wolf : Carnivore {};
struct dynamic_policy : boost::openmethod::default_registry::with&lt;
struct dynamic : boost::openmethod::default_registry::with&lt;
boost::openmethod::policies::indirect_vptr&gt; {};
template&lt;class Class&gt;
using dyn_vptr = boost::openmethod::virtual_ptr&lt;Class, dynamic_policy&gt;;
using dyn_vptr = boost::openmethod::virtual_ptr&lt;Class, dynamic&gt;;
BOOST_OPENMETHOD(
encounter, (dyn_vptr&lt;Animal&gt;, dyn_vptr&lt;Animal&gt;), std::string,
dynamic_policy);</code></pre>
dynamic);</code></pre>
</div>
</div>
<div class="admonitionblock note">
@@ -2853,7 +2853,7 @@ The policy must be passed to the method as well as the
</table>
</div>
<div class="paragraph">
<p>The <code>indirect_vptr</code> facet tells <code>virtual_ptr</code> to use a pointer to the vptr. Even
<p>The <code>indirect_vptr</code> policy tells <code>virtual_ptr</code> to use a pointer to the vptr. Even
tough the value of the vptr changes when <code>initialize</code> is called, the vptrs are
stored in the same place (the policy&#8217;s <code>static_vptr&lt;Class&gt;</code> variables).</p>
</div>
@@ -2876,7 +2876,7 @@ stored in the same place (the policy&#8217;s <code>static_vptr&lt;Class&gt;</cod
#include "dl.hpp"
BOOST_OPENMETHOD_CLASSES(
Animal, Herbivore, Cow, Wolf, Carnivore, dynamic_policy);
Animal, Herbivore, Cow, Wolf, Carnivore, dynamic);
BOOST_OPENMETHOD_OVERRIDE(
encounter, (dyn_vptr&lt;Animal&gt;, dyn_vptr&lt;Animal&gt;), std::string) {
@@ -2893,14 +2893,14 @@ another:</p>
<pre class="rouge highlight"><code data-lang="c++">auto main() -&gt; int {
using namespace boost::openmethod;
initialize&lt;dynamic_policy&gt;();
initialize&lt;dynamic&gt;();
std::cout &lt;&lt; "Before loading library\n";
auto gracie = make_unique_virtual&lt;Cow, dynamic_policy&gt;();
auto gracie = make_unique_virtual&lt;Cow, dynamic&gt;();
// Wolf _willy;
// auto willy = virtual_ptr&lt;Wolf, dynamic_policy&gt;(_willy);
auto willy = make_unique_virtual&lt;Wolf, dynamic_policy&gt;();
// auto willy = virtual_ptr&lt;Wolf, dynamic&gt;(_willy);
auto willy = make_unique_virtual&lt;Wolf, dynamic&gt;();
std::cout &lt;&lt; "Gracie encounters Willy -&gt; "
&lt;&lt; encounter(gracie, willy); // ignore
@@ -2927,7 +2927,7 @@ BOOST_OPENMETHOD_OVERRIDE(
struct Tiger : Carnivore {};
BOOST_OPENMETHOD_CLASSES(Tiger, Carnivore, dynamic_policy);
BOOST_OPENMETHOD_CLASSES(Tiger, Carnivore, dynamic);
extern "C" auto make_tiger() -&gt; Tiger* {
return new Tiger;
@@ -2957,7 +2957,7 @@ BOOST_OPENMETHOD_OVERRIDE(
std::cout &lt;&lt; "\nAfter loading library\n";
boost::openmethod::initialize&lt;dynamic_policy&gt;();
boost::openmethod::initialize&lt;dynamic&gt;();
auto make_tiger =
reinterpret_cast&lt;Animal* (*)()&gt;(dlsym(handle, "make_tiger"));
@@ -2986,7 +2986,7 @@ BOOST_OPENMETHOD_OVERRIDE(
std::cout &lt;&lt; "\nAfter unloading library\n";
boost::openmethod::initialize&lt;dynamic_policy&gt;();
boost::openmethod::initialize&lt;dynamic&gt;();
std::cout &lt;&lt; "Gracie encounters Willy -&gt; "
&lt;&lt; encounter(gracie, willy); // ignore
@@ -3147,71 +3147,71 @@ preprocessor symbol <code>NDEBUG</code>.</p>
</div>
<div class="paragraph">
<p>Usually not included directly. Can be used to create custom policies from stock
policies, by forking them and adjusting a few facets.</p>
policies, by forking them and adjusting a few policys.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesbasic_policy_hpp">&lt;boost/openmethod/policies/basic_policy.hpp&gt;</h5>
<div class="paragraph">
<p>Provides the constructs used in the policy framework, essentially
<code>basic_policy</code>, <code>facet</code>, and its abstract subclasses (<code>rtti</code>, <code>extern_vptr</code>,
<code>basic_policy</code>, <code>policy</code>, and its abstract subclasses (<code>rtti</code>, <code>extern_vptr</code>,
etc).</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesstd_rtti_hpp">&lt;boost/openmethod/policies/std_rtti.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>rtti</code> facet using standard RTTI.</p>
<p>Implements the <code>rtti</code> policy using standard RTTI.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesminimal_rtti_hpp">&lt;boost/openmethod/policies/minimal_rtti.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>rtti</code> facet using a minimal RTTI implementation. Can be used only with the "final" constructs, or with intrusive v-table pointers.</p>
<p>Implements the <code>rtti</code> policy using a minimal RTTI implementation. Can be used only with the "final" constructs, or with intrusive v-table pointers.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesvptr_vector_hpp">&lt;boost/openmethod/policies/vptr_vector.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>extern_vptr</code> facet using a vector of pointers.</p>
<p>Implements the <code>extern_vptr</code> policy using a vector of pointers.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesvptr_map_hpp">&lt;boost/openmethod/policies/vptr_map.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>extern_vptr</code> facet using a map of pointers.</p>
<p>Implements the <code>extern_vptr</code> policy using a map of pointers.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesfast_perfect_hash_hpp">&lt;boost/openmethod/policies/fast_perfect_hash.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>type_hash</code> facet using a perfect hash function.</p>
<p>Implements the <code>type_hash</code> policy using a perfect hash function.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesdefault_error_handler_hpp">&lt;boost/openmethod/policies/default_error_handler.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>error_handler</code> facet by routing the error through a
<p>Implements the <code>error_handler</code> policy by routing the error through a
<code>std::function</code>.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesthrow_error_handler_hpp">&lt;boost/openmethod/policies/throw_error_handler.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>error_handler</code> facet by throwing an exception.</p>
<p>Implements the <code>error_handler</code> policy by throwing an exception.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesbasic_error_output_hpp">&lt;boost/openmethod/policies/basic_error_output.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>output</code> facet using a lightweight version of
<p>Implements the <code>output</code> policy using a lightweight version of
<code>std::ostream</code>.</p>
</div>
</div>
<div class="sect4">
<h5 id="ref_boostopenmethodpoliciesbasic_trace_output_hpp">&lt;boost/openmethod/policies/basic_trace_output.hpp&gt;</h5>
<div class="paragraph">
<p>Implements the <code>trace</code> facet using a lightweight version of
<p>Implements the <code>trace</code> policy using a lightweight version of
<code>std::ostream</code>.</p>
</div>
</div>
@@ -3804,7 +3804,7 @@ auto finalize() -&gt; void;
<h4 id="ref_description_14">Description</h4>
<div class="paragraph">
<p>De-allocates the resources allocated by <code>initialize</code> for the <code>Policy</code>, including
resources allocated by the facets in <code>Policy</code>. Resources are de-allocated in an
resources allocated by the policys in <code>Policy</code>. Resources are de-allocated in an
arbitrary order. It is not necessary to call <code>finalize</code> between calls to
<code>initialize</code>. It is provided mainly for the benefit of memory leak detection
schemes.</p>
@@ -5025,7 +5025,7 @@ using default_registry = policies::debug;
<h4 id="virtual_ptr_description_8">Description</h4>
<div class="paragraph">
<p><code>basic_policy</code> implements a policy, which consists of a a collection of methods,
classes, dispatch data, and facets, which specify how to obtain a pointer to a
classes, dispatch data, and policys, which specify how to obtain a pointer to a
v-table from an object, how to report errors, whether to perform runtime sanity
checks, etc.</p>
</div>
@@ -5062,7 +5062,7 @@ variables with the original <em>Policy</em>. The new policy does not retain any
knowledge of the classes and methods registered in the original.</p>
</div>
<div class="paragraph">
<p><code>fork</code> forks the facets in the policy as well: any facet instantiated from a
<p><code>fork</code> forks the policys in the policy as well: any policy instantiated from a
class template is assumed to take a policy as its first template argument. The
template is re-instantiated with the new policy as the first arguments, while
the other arguments remain the same.</p>
@@ -5080,11 +5080,11 @@ using with;</code></pre>
<dl>
<dt class="hdlist1">Requires</dt>
<dd>
<p><em>Facets</em> is a list of classes that derive from <code>facet</code>.</p>
<p><em>Facets</em> is a list of classes that derive from <code>policy</code>.</p>
</dd>
<dt class="hdlist1">Returns</dt>
<dd>
<p>A new policy containing <em>Facets</em>, and the facets from the original
<p>A new policy containing <em>Facets</em>, and the policys from the original
that do not have the same category as <em>Facets</em>.</p>
</dd>
<dt class="hdlist1">Examples</dt>
@@ -5125,11 +5125,11 @@ using without;</code></pre>
<dl>
<dt class="hdlist1">Requires</dt>
<dd>
<p><em>Facets</em> is a list of facet categories.</p>
<p><em>Facets</em> is a list of policy categories.</p>
</dd>
<dt class="hdlist1">Returns</dt>
<dd>
<p>A new policy containing the facets from the original that do not have
<p>A new policy containing the policys from the original that do not have
the same category as <em>Facets</em>.</p>
</dd>
<dt class="hdlist1">Examples</dt>
@@ -5159,7 +5159,7 @@ will not be used.</p>
</div>
</div>
<div class="paragraph">
<p>A policy that contains facets <code>std_rtti</code>, <code>fast_perfect_hash</code>, <code>vptr_vector</code> and
<p>A policy that contains policys <code>std_rtti</code>, <code>fast_perfect_hash</code>, <code>vptr_vector</code> and
<code>default_error_handler</code>.</p>
</div>
</div>
@@ -5171,7 +5171,7 @@ will not be used.</p>
</div>
</div>
<div class="paragraph">
<p>The <code>release</code> policy with additional facet implementations <code>runtime_checks</code>,
<p>The <code>release</code> policy with additional policy implementations <code>runtime_checks</code>,
<code>basic_error_output</code> and basic_trace_output.</p>
</div>
<div class="admonitionblock note">
@@ -5197,7 +5197,7 @@ same <code>domain</code>.
</div>
</div>
<div class="sect2">
<h3 id="virtual_ptr_facet">facet</h3>
<h3 id="virtual_ptr_policy">policy</h3>
<div class="sect3">
<h4 id="virtual_ptr_synopsis_9">Synopsis</h4>
<div class="paragraph">
@@ -5207,7 +5207,7 @@ same <code>domain</code>.
<div class="content">
<pre class="rouge highlight"><code data-lang="c++">namespace boost::openmethod::policies {
struct facet {
struct policy {
static auto finalize() -&gt; void;
};
@@ -5218,7 +5218,7 @@ struct facet {
<div class="sect3">
<h4 id="virtual_ptr_description_9">Description</h4>
<div class="paragraph">
<p><code>facet</code> is the base class of all facets. It provides an empty <code>finalize</code> static
<p><code>policy</code> is the base class of all policys. It provides an empty <code>finalize</code> static
function which can be overriden (via shadowing) by derived classes.</p>
</div>
</div>
@@ -5248,7 +5248,7 @@ function which can be overriden (via shadowing) by derived classes.</p>
<div class="content">
<pre class="rouge highlight"><code data-lang="c++">namespace boost::openmethod::policies {
struct rtti : facet {};
struct rtti : policy {};
} // boost::openmethod::policies</code></pre>
</div>
@@ -5257,7 +5257,7 @@ struct rtti : facet {};
<div class="sect3">
<h4 id="virtual_ptr_description_10">Description</h4>
<div class="paragraph">
<p>The <code>rtti</code> facet provides type information for classes and objects, implements
<p>The <code>rtti</code> policy provides type information for classes and objects, implements
downcast in presence of virtual inheritance, and writes descriptions of types to
an <code>ostream</code>-like object.</p>
</div>
@@ -5377,7 +5377,7 @@ struct std_rtti : rtti {
<div class="sect3">
<h4 id="virtual_ptr_description_11">Description</h4>
<div class="paragraph">
<p><code>std_rtti</code> is an implementation of the <code>rtti</code> facet that uses standard RTTI.</p>
<p><code>std_rtti</code> is an implementation of the <code>rtti</code> policy that uses standard RTTI.</p>
</div>
</div>
<div class="sect3">
@@ -5468,14 +5468,14 @@ struct deferred_static_rtti : rtti {};
<div class="sect3">
<h4 id="virtual_ptr_description_12">Description</h4>
<div class="paragraph">
<p><code>deferred_static_rtti</code> is a facet that defers collection of static type ids.</p>
<p><code>deferred_static_rtti</code> is a policy that defers collection of static type ids.</p>
</div>
<div class="paragraph">
<p>Some custom RTTI systems rely on static constructors to assign type ids.
OpenMethod itself relies on static constructors to register classes, methods and
overriders, calling the <code>static_type</code> function from the <code>rtti</code> facet in the
overriders, calling the <code>static_type</code> function from the <code>rtti</code> policy in the
process. This can result in collecting the type ids <em>before</em> they have been
initialized. Adding this facet to a policy moves the collection of type ids to
initialized. Adding this policy to a policy moves the collection of type ids to
<code>initialize</code>.</p>
</div>
</div>
@@ -5499,15 +5499,15 @@ initialized. Adding this facet to a policy moves the collection of type ids to
<div class="sect3">
<h4 id="virtual_ptr_description_13">Description</h4>
<div class="paragraph">
<p><code>minimal_rtti</code> is an implementation of the <code>rtti</code> facet that only uses static
<p><code>minimal_rtti</code> is an implementation of the <code>rtti</code> policy that only uses static
type information.</p>
</div>
<div class="paragraph">
<p><code>minimal_rtti</code> provides the only function strictly required for the <code>rtti</code>
facet.</p>
policy.</p>
</div>
<div class="paragraph">
<p>This facet can be used in programs that call methods solely via
<p>This policy can be used in programs that call methods solely via
<code>virtual_ptr</code>s created with the "final" constructs. Virtual inheritance
is not supported. Classes are not required to be polymorphic.</p>
</div>
@@ -5523,7 +5523,7 @@ static constexpr bool is_polymorphic = false;</code></pre>
</div>
</div>
<div class="paragraph">
<p>This facet does not support polymorphic classes.</p>
<p>This policy does not support polymorphic classes.</p>
</div>
</div>
<div class="sect4">
@@ -5551,7 +5551,7 @@ static auto static_type() -&gt; type_id;</code></pre>
<div class="content">
<pre class="rouge highlight"><code data-lang="c++">namespace boost::openmethod::policies {
struct extern_vptr : facet {};
struct extern_vptr : policy {};
}</code></pre>
</div>
@@ -5560,7 +5560,7 @@ struct extern_vptr : facet {};
<div class="sect3">
<h4 id="virtual_ptr_description_14">Description</h4>
<div class="paragraph">
<p><code>extern_vptr</code> is a facet that stores and returns pointers to v-tables for
<p><code>extern_vptr</code> is a policy that stores and returns pointers to v-tables for
registered classes.</p>
</div>
</div>
@@ -5605,14 +5605,14 @@ the same.</p>
<h4 id="virtual_ptr_synopsis_15">Synopsis</h4>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="c++">struct indirect_vptr : facet {};</code></pre>
<pre class="rouge highlight"><code data-lang="c++">struct indirect_vptr : policy {};</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="virtual_ptr_description_15">Description</h4>
<div class="paragraph">
<p><code>indirect_vptr</code> is a facet that makes <code>virtual_ptr</code>s and <code>inplace_vptr</code> use
<p><code>indirect_vptr</code> is a policy that makes <code>virtual_ptr</code>s and <code>inplace_vptr</code> use
pointers to pointers to v-tables, instead of straight pointers. As a
consequence, they remain valid after a call to <code>initialize</code>.</p>
</div>
@@ -5620,7 +5620,7 @@ consequence, they remain valid after a call to <code>initialize</code>.</p>
<div class="sect3">
<h4 id="virtual_ptr_requirements_3">Requirements</h4>
<div class="paragraph">
<p>None. The facet is its own implementation.</p>
<p>None. The policy is its own implementation.</p>
</div>
</div>
</div>
@@ -5658,7 +5658,7 @@ of indirection is added, making the policy usable in presence of dynamic
loading.</p>
</div>
<div class="paragraph">
<p><code>Policy</code> is the policy containing the facet.</p>
<p><code>Policy</code> is the policy containing the policy.</p>
</div>
</div>
<div class="sect3">
@@ -5676,7 +5676,7 @@ auto register_vptrs(ForwardIterator first, ForwardIterator last) -&gt; void;</co
<code>type_id`s of the classes registered in `Policy</code>.</p>
</div>
<div class="paragraph">
<p>If <code>Policy</code> contains a <code>type_hash</code> facet, call its <code>hash_initialize</code>
<p>If <code>Policy</code> contains a <code>type_hash</code> policy, call its <code>hash_initialize</code>
function, and uses it to convert the <code>type_id</code>s to an index.</p>
</div>
</div>
@@ -5693,7 +5693,7 @@ auto dynamic_vptr(const Class&amp; object) -&gt; const vptr_type&amp;;</code></p
</div>
<div class="paragraph">
<p>Obtains a <code>type_id</code> for <code>object</code> using <code>Policy::dynamic_type</code>. If <em>Policy</em>
contains a <code>type_hash</code> facet, uses it to convert the result to an index;
contains a <code>type_hash</code> policy, uses it to convert the result to an index;
otherwise, uses the <code>type_id</code> as the index.</p>
</div>
</div>
@@ -5731,7 +5731,7 @@ the v-tables in a map. If `Policy</code> contains <code>indirect_vptr</code>, a
indirection is added, making the policy usable in presence of dynamic loading.</p>
</div>
<div class="paragraph">
<p><code>Policy</code> is the policy containing the facet.</p>
<p><code>Policy</code> is the policy containing the policy.</p>
</div>
<div class="paragraph">
<p><code>MapAdaptor</code> is a Boost.Mp11 quoted metafunction that returns a map type.</p>
@@ -5763,8 +5763,8 @@ auto dynamic_vptr(const Class&amp; object) -&gt; const vptr_type&amp;;</code></p
<p>Returns a pointer to the v-table for <code>object</code> (by reference).</p>
</div>
<div class="paragraph">
<p>If <em>Policy</em> contains the <code>runtime_checks</code> facet, checks if <em>Class</em> is
registered. If it is not, and <em>Policy</em> contains a <code>error_handler</code> facet, calls
<p>If <em>Policy</em> contains the <code>runtime_checks</code> policy, checks if <em>Class</em> is
registered. If it is not, and <em>Policy</em> contains a <code>error_handler</code> policy, calls
its <code>error</code> function; then calls <code>abort</code>.</p>
</div>
</div>
@@ -5781,7 +5781,7 @@ its <code>error</code> function; then calls <code>abort</code>.</p>
<div class="content">
<pre class="rouge highlight"><code data-lang="c++">namespace boost::openmethod::policies {
struct type_hash : facet {};
struct type_hash : policy {};
} // boost::openmethod::policies</code></pre>
</div>
@@ -5790,7 +5790,7 @@ struct type_hash : facet {};
<div class="sect3">
<h4 id="virtual_ptr_description_18">Description</h4>
<div class="paragraph">
<p><code>type_hash</code> is a facet that provides a hash function for a fixed set of
<p><code>type_hash</code> is a policy that provides a hash function for a fixed set of
<code>type_id</code>s.</p>
</div>
</div>
@@ -5872,9 +5872,9 @@ function for <code>type_id</code>s.</p>
<code>hash_initialize</code>.</p>
</div>
<div class="paragraph">
<p>If the policy has a <code>runtime_checks</code> facet, <code>hash_type_id</code> checks that <code>type</code>
<p>If the policy has a <code>runtime_checks</code> policy, <code>hash_type_id</code> checks that <code>type</code>
corresponds to a registered class. If not, it reports a <code>unknown_class_error</code>
using the policy&#8217;s error_handler facet, if present, then calls <code>abort</code>.</p>
using the policy&#8217;s error_handler policy, if present, then calls <code>abort</code>.</p>
</div>
</div>
<div class="sect4">
@@ -5891,11 +5891,11 @@ function.</p>
</div>
<div class="paragraph">
<p>If no such factors cannot be found, <code>hash_initialize</code> reports a
<code>hash_search_error</code> using the policy&#8217;s error_handler facet, if present, the
<code>hash_search_error</code> using the policy&#8217;s error_handler policy, if present, the
calls <code>abort</code>.</p>
</div>
<div class="paragraph">
<p>If the policy has a <code>trace</code> facet, <code>hash_initialize</code> uses it to write a
<p>If the policy has a <code>trace</code> policy, <code>hash_initialize</code> uses it to write a
summary of the search.</p>
</div>
</div>
@@ -5947,11 +5947,11 @@ struct type_mismatch_error : openmethod_error {
<div class="sect3">
<h4 id="virtual_ptr_description_20">Description</h4>
<div class="paragraph">
<p><code>error_handler</code> is a facet that handles errors.</p>
<p><code>error_handler</code> is a policy that handles errors.</p>
</div>
<div class="paragraph">
<p>When an error is encountered, either during <code>initialize</code> or method dispatch, the
program is terminated via a call to <code>abort</code>. If this facet is present in the
program is terminated via a call to <code>abort</code>. If this policy is present in the
policy, its <code>error</code> function is called with an error object. It can prevent
termination by throwing an exception.</p>
</div>
@@ -6019,7 +6019,7 @@ static auto error(const Error&amp; error) -&gt; void;</code></pre>
</div>
<div class="paragraph">
<p>Calls the function last set via <code>set_error_handler</code> or, if it was never called,
and if <em>Policy</em> contains an <code>output</code> facet, use it to print a description
and if <em>Policy</em> contains an <code>output</code> policy, use it to print a description
of <code>error</code>.</p>
</div>
</div>
@@ -6059,7 +6059,7 @@ struct throw_error_handler : error_handler {
<div class="sect3">
<h4 id="virtual_ptr_description_22">Description</h4>
<div class="paragraph">
<p>throw_error_handler is an implementation of the <code>error_handler</code> facet that
<p>throw_error_handler is an implementation of the <code>error_handler</code> policy that
throws the error as an exception.</p>
</div>
</div>
@@ -6103,7 +6103,7 @@ struct basic_error_output : output {
<h4 id="virtual_ptr_description_23">Description</h4>
<div class="paragraph">
<p><code>basic_error_output</code> is an implementation of <code>output</code> that writes error
messages to a <code>RestrictedOutputStream</code>.</p>
messages to a <code>LightweightOutputStream</code>.</p>
</div>
</div>
<div class="sect3">
@@ -6148,7 +6148,7 @@ struct basic_trace_output : trace {
<h4 id="virtual_ptr_description_24">Description</h4>
<div class="paragraph">
<p><code>basic_error_output</code> is an implementation of <code>trace</code> that writes error
messages to a <code>RestrictedOutputStream</code>.</p>
messages to a <code>LightweightOutputStream</code>.</p>
</div>
</div>
<div class="sect3">
@@ -6180,11 +6180,11 @@ open it.</p>
</div>
</div>
<div class="sect2">
<h3 id="virtual_ptr_restrictedoutputstream">RestrictedOutputStream</h3>
<h3 id="virtual_ptr_restrictedoutputstream">LightweightOutputStream</h3>
<div class="sect3">
<h4 id="virtual_ptr_description_25">Description</h4>
<div class="paragraph">
<p>RestrictedOutputStream is a concept describing a <code>std::ostream</code>-like class with
<p>LightweightOutputStream is a concept describing a <code>std::ostream</code>-like class with
a reduced set of operations.</p>
</div>
<div class="paragraph">
@@ -6194,7 +6194,7 @@ uses a small subset of the operations supported by <code>std::ostream</code>. By
the library uses a lightweight implementation based on the C stream functions.</p>
</div>
<div class="paragraph">
<p>Implementations of <code>RestrictedOutputStream</code> provide the following functions:</p>
<p>Implementations of <code>LightweightOutputStream</code> provide the following functions:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
@@ -6210,7 +6210,7 @@ the library uses a lightweight implementation based on the C stream functions.</
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>RestrictedOutputStream&amp; operator&lt;&lt;(RestrictedOutputStream&amp; os, const char* str)</p>
<p>LightweightOutputStream&amp; operator&lt;&lt;(LightweightOutputStream&amp; os, const char* str)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Write a null-terminated string <code>str</code> to <code>os</code></p>
@@ -6218,7 +6218,7 @@ the library uses a lightweight implementation based on the C stream functions.</
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>RestrictedOutputStream&amp; operator&lt;&lt;(RestrictedOutputStream&amp; os, const std::string_view&amp; view)</p>
<p>LightweightOutputStream&amp; operator&lt;&lt;(LightweightOutputStream&amp; os, const std::string_view&amp; view)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Write a view to `os</p>
@@ -6226,7 +6226,7 @@ the library uses a lightweight implementation based on the C stream functions.</
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>RestrictedOutputStream&amp; operator&lt;&lt;(RestrictedOutputStream&amp; os, const void* value)</p>
<p>LightweightOutputStream&amp; operator&lt;&lt;(LightweightOutputStream&amp; os, const void* value)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Write a representation of a pointer to <code>os</code></p>
@@ -6234,7 +6234,7 @@ the library uses a lightweight implementation based on the C stream functions.</
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>RestrictedOutputStream&amp; operator&lt;&lt;(RestrictedOutputStream&amp; os, std::size_t value)</p>
<p>LightweightOutputStream&amp; operator&lt;&lt;(LightweightOutputStream&amp; os, std::size_t value)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Write an unsigned integer to <code>os</code></p>
@@ -6253,4 +6253,4 @@ Last updated 2025-06-22 13:38:14 -0400
</div>
</div>
</body>
</html>
</html>

21
doc/index.html Normal file
View File

@@ -0,0 +1,21 @@
<html>
<head>
<title>Boost.OpenMethod</title>
<meta http-equiv="refresh" content="0; URL=../../../doc/antora/openmethod/index.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="../../../doc/antora/openmethod/index.html">../../../doc/antora/openmethod/index.html</a>
<hr>
<tt>
Boost.OpenMethod<br>
<br>
Copyright&nbsp;(C)&nbsp;2025&nbsp;Jean-Louis&nbsp;Leroy<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<a href=http://www.boost.org/LICENSE_1_0.txt>http://www.boost.org/LICENSE_1_0.txt</a>) <br>
<br>
</tt>
</body>
</html>

View File

@@ -3,7 +3,7 @@
### Synopsis
Defined in `<boost/openmethod/compiler.hpp>`.
Defined in `<boost/openmethod/initialize.hpp>`.
```c++
namespace boost::openmethod {
@@ -37,7 +37,7 @@ combination of virtual arguments.
### Synopsis
Defined in `<boost/openmethod/compiler.hpp>`.
Defined in `<boost/openmethod/initialize.hpp>`.
```c++
namespace boost::openmethod {
@@ -51,7 +51,7 @@ auto finalize() -> void;
### Description
De-allocates the resources allocated by `initialize` for the `Policy`, including
resources allocated by the facets in `Policy`. Resources are de-allocated in an
resources allocated by the policys in `Policy`. Resources are de-allocated in an
arbitrary order. It is not necessary to call `finalize` between calls to
`initialize`. It is provided mainly for the benefit of memory leak detection
schemes.

54
doc/local-playbook.yml Normal file
View File

@@ -0,0 +1,54 @@
#
# Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/boostorg/openmethod
#
# An antora playbook used for local development
# The playbook includes Boost.OpenMethod as its only component
site:
title: Boost.OpenMethod
url: https://antora.cppalliance.org/develop/lib/doc
start_page: openmethod::index.adoc
robots: allow
keys:
repo_url: 'https://github.com/boostorg/openmethod'
content:
sources:
- url: ..
start_path: doc
edit_url: 'https://github.com/boostorg/openmethod/edit/{refname}/{path}'
ui:
bundle:
url: https://github.com/boostorg/website-v2-docs/releases/download/ui-master/ui-bundle.zip
snapshot: true
antora:
extensions:
- require: '@antora/lunr-extension' # https://gitlab.com/antora/antora-lunr-extension
index_latest_only: true
- require: '@cppalliance/antora-cpp-tagfiles-extension'
cpp-tagfiles:
using-namespaces:
- 'boost::'
- require: '@cppalliance/antora-cpp-reference-extension'
dependencies:
- name: 'boost'
repo: 'https://github.com/boostorg/boost.git'
tag: 'develop'
variable: 'BOOST_SRC_DIR'
system-env: 'BOOST_SRC_DIR'
asciidoc:
attributes:
# Enable pagination
page-pagination: ''
extensions:
- '@cppalliance/asciidoctor-boost-links'
- '@asciidoctor/tabs'

View File

@@ -15,13 +15,13 @@ struct minimal_rtti : rtti {
### Description
`minimal_rtti` is an implementation of the `rtti` facet that only uses static
`minimal_rtti` is an implementation of the `rtti` policy that only uses static
type information.
`minimal_rtti` provides the only function strictly required for the `rtti`
facet.
policy.
This facet can be used in programs that call methods solely via
This policy can be used in programs that call methods solely via
`virtual_ptr`{empty}s created with the "final" constructs. Virtual inheritance
is not supported. Classes are not required to be polymorphic.
@@ -35,7 +35,7 @@ template<class Class>
static constexpr bool is_polymorphic = false;
```
This facet does not support polymorphic classes.
This policy does not support polymorphic classes.
#### static_type

View File

@@ -3,6 +3,8 @@
# See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
message(STATUS "Building examples")
if (CMAKE_BUILD_TYPE MATCHES "Release")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-save-temps -masm=intel)
@@ -105,6 +107,10 @@ add_executable(asteroids asteroids.cpp)
target_link_libraries(asteroids Boost::openmethod)
add_test(NAME asteroids COMMAND asteroids)
add_executable(static_rtti static_rtti.cpp)
target_link_libraries(static_rtti Boost::openmethod)
add_test(NAME static_rtti COMMAND static_rtti)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(STATUS "Building dlopen example")
add_executable(dl_main dl_main.cpp)

View File

@@ -9,7 +9,7 @@
#include <boost/openmethod.hpp>
#include <boost/openmethod/shared_ptr.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using namespace boost::openmethod::aliases;

View File

@@ -8,7 +8,7 @@
#include <string>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -10,7 +10,7 @@
#include <iostream>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -12,7 +12,7 @@
#include <boost/openmethod.hpp>
#include <boost/openmethod/unique_ptr.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using namespace boost::openmethod::aliases;

View File

@@ -7,7 +7,7 @@
// Example for Wikipedia
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -5,7 +5,7 @@
#include <iostream>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
#include <boost/openmethod/core.hpp>
struct Animal {

View File

@@ -34,12 +34,12 @@ struct Dog : Animal {
#include <boost/openmethod/registry.hpp>
#include <boost/openmethod/policies/vptr_vector.hpp>
// tag::facet[]
// tag::policy[]
namespace bom = boost::openmethod;
struct custom_rtti : bom::policies::rtti {
template<class Registry>
struct fn : bom::policies::rtti::fn<Registry> {
struct fn : bom::policies::rtti::defaults {
template<class T>
static constexpr bool is_polymorphic = std::is_base_of_v<Animal, T>;
@@ -62,20 +62,20 @@ struct custom_rtti : bom::policies::rtti {
}
};
};
// end::facet[]
// end::policy[]
// tag::policy[]
struct custom_policy : bom::registry<custom_rtti, bom::policies::vptr_vector> {
// tag::registry[]
struct custom_registry : bom::registry<custom_rtti, bom::policies::vptr_vector> {
};
#define BOOST_OPENMETHOD_DEFAULT_REGISTRY custom_policy
// end::policy[]
#define BOOST_OPENMETHOD_DEFAULT_REGISTRY custom_registry
// end::registry[]
// tag::example[]
#include <iostream>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -8,7 +8,7 @@
#include <variant>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -81,9 +81,10 @@ struct Dog : virtual Animal {
namespace bom = boost::openmethod;
struct custom_rtti : bom::policies::rtti {
// tag::registry[]
struct custom_rtti : bom::policies::deferred_static_rtti {
template<class Registry>
struct fn : bom::policies::rtti::fn<Registry> {
struct fn : defaults {
template<class T>
static constexpr bool is_polymorphic = std::is_base_of_v<Animal, T>;
@@ -105,7 +106,6 @@ struct custom_rtti : bom::policies::rtti {
}
}
// tag::dynamic_cast_ref[]
// to support virtual inheritance:
template<typename Derived, typename Base>
static auto dynamic_cast_ref(Base&& obj) -> Derived {
@@ -116,20 +116,19 @@ struct custom_rtti : bom::policies::rtti {
abort(); // not supported
}
}
// end::dynamic_cast_ref[]
};
};
struct custom_policy : bom::registry<
custom_rtti, bom::policies::deferred_static_rtti,
bom::policies::vptr_vector> {};
struct custom_registry : bom::registry<custom_rtti, bom::policies::vptr_vector> {
};
// end::registry[]
#define BOOST_OPENMETHOD_DEFAULT_REGISTRY custom_policy
#define BOOST_OPENMETHOD_DEFAULT_REGISTRY custom_registry
#include <iostream>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -26,15 +26,15 @@ struct Carnivore : Animal {};
struct Cow : Herbivore {};
struct Wolf : Carnivore {};
struct dynamic_policy : boost::openmethod::default_registry::with<
struct dynamic : boost::openmethod::default_registry::with<
boost::openmethod::policies::indirect_vptr> {};
template<class Class>
using dyn_vptr = boost::openmethod::virtual_ptr<Class, dynamic_policy>;
using dyn_vptr = boost::openmethod::virtual_ptr<Class, dynamic>;
BOOST_OPENMETHOD(
encounter, (dyn_vptr<Animal>, dyn_vptr<Animal>), std::string,
dynamic_policy);
dynamic);
// end::header[]

View File

@@ -14,12 +14,12 @@
#include <boost/openmethod.hpp>
#include <boost/openmethod/unique_ptr.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
#include "dl.hpp"
BOOST_OPENMETHOD_CLASSES(
Animal, Herbivore, Cow, Wolf, Carnivore, dynamic_policy);
Animal, Herbivore, Cow, Wolf, Carnivore, dynamic);
BOOST_OPENMETHOD_OVERRIDE(
encounter, (dyn_vptr<Animal>, dyn_vptr<Animal>), std::string) {
@@ -32,14 +32,14 @@ BOOST_OPENMETHOD_OVERRIDE(
auto main() -> int {
using namespace boost::openmethod;
initialize<dynamic_policy>();
dynamic::initialize();
std::cout << "Before loading library\n";
auto gracie = make_unique_virtual<Cow, dynamic_policy>();
auto gracie = make_unique_virtual<Cow, dynamic>();
// Wolf _willy;
// auto willy = virtual_ptr<Wolf, dynamic_policy>(_willy);
auto willy = make_unique_virtual<Wolf, dynamic_policy>();
// auto willy = virtual_ptr<Wolf, dynamic>(_willy);
auto willy = make_unique_virtual<Wolf, dynamic>();
std::cout << "Gracie encounters Willy -> "
<< encounter(gracie, willy); // ignore
@@ -61,7 +61,7 @@ auto main() -> int {
std::cout << "\nAfter loading library\n";
boost::openmethod::initialize<dynamic_policy>();
dynamic::initialize();
auto make_tiger =
reinterpret_cast<Animal* (*)()>(dlsym(handle, "make_tiger"));
@@ -86,7 +86,7 @@ auto main() -> int {
std::cout << "\nAfter unloading library\n";
boost::openmethod::initialize<dynamic_policy>();
dynamic::initialize();
std::cout << "Gracie encounters Willy -> "
<< encounter(gracie, willy); // ignore

View File

@@ -18,7 +18,7 @@ BOOST_OPENMETHOD_OVERRIDE(
struct Tiger : Carnivore {};
BOOST_OPENMETHOD_CLASSES(Tiger, Carnivore, dynamic_policy);
BOOST_OPENMETHOD_CLASSES(Tiger, Carnivore, dynamic);
extern "C" auto make_tiger() -> Tiger* {
return new Tiger;

View File

@@ -84,7 +84,7 @@ BOOST_OPENMETHOD_OVERRIDE(
BOOST_OPENMETHOD_CLASSES(Animal, Cat, Dog);
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
auto main() -> int {
boost::openmethod::initialize();

View File

@@ -98,7 +98,7 @@ BOOST_OPENMETHOD_CLASSES(core::Animal, Cat, Dog);
} // namespace pets
// end::friend[]
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
auto main() -> int {
boost::openmethod::initialize();

View File

@@ -1,6 +1,6 @@
#include <iostream>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
#include "animal.hpp"
#include "cat.hpp"

View File

@@ -1,6 +1,6 @@
#include <iostream>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
#include "animal.hpp"
#include "cat.hpp"

View File

@@ -1,6 +1,6 @@
#include <iostream>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
#include "animal.hpp"
#include "cat.hpp"

View File

@@ -97,7 +97,7 @@ BOOST_OPENMETHOD_OVERRIDE(
// end::multi[]
// tag::main[]
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
// only needed in the file that calls boost::openmethod::initialize()
auto main() -> int {

View File

@@ -9,7 +9,7 @@
#include <typeinfo>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
#include <boost/openmethod/shared_ptr.hpp>
using std::make_shared;

View File

@@ -10,7 +10,7 @@
#include <iostream>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -128,7 +128,7 @@ struct Init {
#include <boost/openmethod.hpp>
#include <boost/openmethod/unique_ptr.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
namespace openmethods {

View File

@@ -0,0 +1,56 @@
// Copyright (c) 2018-2025 Jean-Louis Leroy
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//[ all
#include <boost/openmethod/default_registry.hpp>
#include <boost/openmethod/policies/static_rtti.hpp>
struct static_registry
: boost::openmethod::registry<boost::openmethod::policies::static_rtti> {};
#define BOOST_OPENMETHOD_DEFAULT_REGISTRY static_registry
#include <boost/openmethod.hpp>
#include <boost/openmethod/unique_ptr.hpp>
#include <boost/openmethod/initialize.hpp>
#include <iostream>
struct Animal {};
struct Dog : Animal {};
struct Cat : Animal {};
using namespace boost::openmethod::aliases;
BOOST_OPENMETHOD_CLASSES(Animal, Dog, Cat);
BOOST_OPENMETHOD(poke, (virtual_ptr<Animal>, std::ostream&), void);
BOOST_OPENMETHOD_OVERRIDE(
poke, (virtual_ptr<Dog> dog, std::ostream& os), void) {
os << "bark\n";
}
BOOST_OPENMETHOD_OVERRIDE(
poke, (virtual_ptr<Cat> cat, std::ostream& os), void) {
os << "hiss\n";
}
int main() {
boost::openmethod::initialize();
unique_virtual_ptr<Animal> a = make_unique_virtual<Cat>(),
b = make_unique_virtual<Dog>();
poke(a, std::cout); // hiss
poke(b, std::cout); // bark
return 0;
}
//]

View File

@@ -24,7 +24,7 @@ class Dolphin : public Animal {};
// Add behavior to existing classes, without modifying them.
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -35,7 +35,7 @@ struct custom_registry : bom::default_registry::with<throw_if_not_implemented> {
#define BOOST_OPENMETHOD_DEFAULT_REGISTRY custom_registry
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -7,7 +7,7 @@
#include <boost/openmethod.hpp>
#include <boost/openmethod/inplace_vptr.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_;

View File

@@ -5,7 +5,7 @@
#include <iostream>
#include <boost/openmethod.hpp>
#include <boost/openmethod/compiler.hpp>
#include <boost/openmethod/initialize.hpp>
using boost::openmethod::virtual_ptr;

View File

@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="116.84mm" height="25.4mm" viewBox="0 0 11684 2540" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="11684" height="2540"/>
</clipPath>
<clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
<rect x="11" y="2" width="11661" height="2535"/>
</clipPath>
</defs>
<defs>
<font id="EmbeddedFont_1" horiz-adv-x="2048">
<font-face font-family="Liberation Sans embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1852" descent="423"/>
<missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
<glyph unicode="x" horiz-adv-x="980" d="M 801,0 L 510,444 217,0 23,0 408,556 41,1082 240,1082 510,661 778,1082 979,1082 612,558 1002,0 801,0 Z"/>
<glyph unicode="w" horiz-adv-x="1509" d="M 1174,0 L 965,0 776,765 740,934 C 734,904 725,861 712,805 699,748 631,480 508,0 L 300,0 -3,1082 175,1082 358,347 C 363,331 377,265 401,149 L 418,223 644,1082 837,1082 1026,339 1072,149 1103,288 1308,1082 1484,1082 1174,0 Z"/>
<glyph unicode="u" horiz-adv-x="874" d="M 314,1082 L 314,396 C 314,325 321,269 335,230 349,191 371,162 402,145 433,128 478,119 537,119 624,119 692,149 742,208 792,267 817,350 817,455 L 817,1082 997,1082 997,231 C 997,105 999,28 1003,0 L 833,0 C 832,3 832,12 831,27 830,42 830,59 829,78 828,97 826,132 825,185 L 822,185 C 781,110 733,58 679,27 624,-4 557,-20 476,-20 357,-20 271,10 216,69 161,128 133,225 133,361 L 133,1082 314,1082 Z"/>
<glyph unicode="t" horiz-adv-x="531" d="M 554,8 C 495,-8 434,-16 372,-16 228,-16 156,66 156,229 L 156,951 31,951 31,1082 163,1082 216,1324 336,1324 336,1082 536,1082 536,951 336,951 336,268 C 336,216 345,180 362,159 379,138 408,127 450,127 474,127 509,132 554,141 L 554,8 Z"/>
<glyph unicode="s" horiz-adv-x="927" d="M 950,299 C 950,197 912,118 835,63 758,8 650,-20 511,-20 376,-20 273,2 200,47 127,91 79,160 57,254 L 216,285 C 231,227 263,185 311,158 359,131 426,117 511,117 602,117 669,131 712,159 754,187 775,229 775,285 775,328 760,362 731,389 702,416 654,438 589,455 L 460,489 C 357,516 283,542 240,568 196,593 162,624 137,661 112,698 100,743 100,796 100,895 135,970 206,1022 276,1073 378,1099 513,1099 632,1099 727,1078 798,1036 868,994 912,927 931,834 L 769,814 C 759,862 732,899 689,925 645,950 586,963 513,963 432,963 372,951 333,926 294,901 275,864 275,814 275,783 283,758 299,738 315,718 339,701 370,687 401,673 467,654 568,629 663,605 732,583 774,563 816,542 849,520 874,495 898,470 917,442 930,410 943,377 950,340 950,299 Z"/>
<glyph unicode="r" horiz-adv-x="530" d="M 142,0 L 142,830 C 142,906 140,990 136,1082 L 306,1082 C 311,959 314,886 314,861 L 318,861 C 347,954 380,1017 417,1051 454,1085 507,1102 575,1102 599,1102 623,1099 648,1092 L 648,927 C 624,934 592,937 552,937 477,937 420,905 381,841 342,776 322,684 322,564 L 322,0 142,0 Z"/>
<glyph unicode="p" horiz-adv-x="927" d="M 1053,546 C 1053,169 920,-20 655,-20 488,-20 376,43 319,168 L 314,168 C 317,163 318,106 318,-2 L 318,-425 138,-425 138,861 C 138,972 136,1046 132,1082 L 306,1082 C 307,1079 308,1070 309,1054 310,1037 312,1012 314,978 315,944 316,921 316,908 L 320,908 C 352,975 394,1024 447,1055 500,1086 569,1101 655,1101 788,1101 888,1056 954,967 1020,878 1053,737 1053,546 Z M 864,542 C 864,693 844,800 803,865 762,930 698,962 609,962 538,962 482,947 442,917 401,887 371,840 350,777 329,713 318,630 318,528 318,386 341,281 386,214 431,147 505,113 607,113 696,113 762,146 803,212 844,277 864,387 864,542 Z"/>
<glyph unicode="o" horiz-adv-x="980" d="M 1053,542 C 1053,353 1011,212 928,119 845,26 724,-20 565,-20 407,-20 288,28 207,125 126,221 86,360 86,542 86,915 248,1102 571,1102 736,1102 858,1057 936,966 1014,875 1053,733 1053,542 Z M 864,542 C 864,691 842,800 798,868 753,935 679,969 574,969 469,969 393,935 346,866 299,797 275,689 275,542 275,399 298,292 345,221 391,149 464,113 563,113 671,113 748,148 795,217 841,286 864,395 864,542 Z"/>
<glyph unicode="m" horiz-adv-x="1457" d="M 768,0 L 768,686 C 768,791 754,863 725,903 696,943 645,963 570,963 493,963 433,934 388,875 343,816 321,734 321,627 L 321,0 142,0 142,851 C 142,977 140,1054 136,1082 L 306,1082 C 307,1079 307,1070 308,1055 309,1040 310,1024 311,1005 312,986 313,950 314,897 L 317,897 C 356,974 400,1027 450,1057 500,1087 561,1102 633,1102 715,1102 780,1086 828,1053 875,1020 908,968 927,897 L 930,897 C 967,970 1013,1022 1066,1054 1119,1086 1183,1102 1258,1102 1367,1102 1447,1072 1497,1013 1546,954 1571,856 1571,721 L 1571,0 1393,0 1393,686 C 1393,791 1379,863 1350,903 1321,943 1270,963 1195,963 1116,963 1055,934 1012,876 968,817 946,734 946,627 L 946,0 768,0 Z"/>
<glyph unicode="l" horiz-adv-x="187" d="M 138,0 L 138,1484 318,1484 318,0 138,0 Z"/>
<glyph unicode="h" horiz-adv-x="874" d="M 317,897 C 356,968 402,1020 457,1053 511,1086 580,1102 663,1102 780,1102 867,1073 923,1015 978,956 1006,858 1006,721 L 1006,0 825,0 825,686 C 825,762 818,819 804,856 790,893 767,920 735,937 703,954 659,963 602,963 517,963 450,934 399,875 348,816 322,737 322,638 L 322,0 142,0 142,1484 322,1484 322,1098 C 322,1057 321,1015 319,972 316,929 315,904 314,897 L 317,897 Z"/>
<glyph unicode="e" horiz-adv-x="980" d="M 276,503 C 276,379 302,283 353,216 404,149 479,115 578,115 656,115 719,131 766,162 813,193 844,233 861,281 L 1019,236 C 954,65 807,-20 578,-20 418,-20 296,28 213,123 129,218 87,360 87,548 87,727 129,864 213,959 296,1054 416,1102 571,1102 889,1102 1048,910 1048,527 L 1048,503 276,503 Z M 862,641 C 852,755 823,838 775,891 727,943 658,969 568,969 481,969 412,940 361,882 310,823 282,743 278,641 L 862,641 Z"/>
<glyph unicode="c" horiz-adv-x="901" d="M 275,546 C 275,402 298,295 343,226 388,157 457,122 548,122 612,122 666,139 709,174 752,209 778,262 788,334 L 970,322 C 956,218 912,135 837,73 762,11 668,-20 553,-20 402,-20 286,28 207,124 127,219 87,359 87,542 87,724 127,863 207,959 287,1054 402,1102 551,1102 662,1102 754,1073 827,1016 900,959 945,880 964,779 L 779,765 C 770,825 746,873 708,908 670,943 616,961 546,961 451,961 382,929 339,866 296,803 275,696 275,546 Z"/>
<glyph unicode="a" horiz-adv-x="1060" d="M 414,-20 C 305,-20 224,9 169,66 114,123 87,202 87,302 87,414 124,500 198,560 271,620 390,652 554,656 L 797,660 797,719 C 797,807 778,870 741,908 704,946 645,965 565,965 484,965 426,951 389,924 352,897 330,853 323,793 L 135,810 C 166,1005 310,1102 569,1102 705,1102 807,1071 876,1009 945,946 979,856 979,738 L 979,272 C 979,219 986,179 1000,152 1014,125 1041,111 1080,111 1097,111 1117,113 1139,118 L 1139,6 C 1094,-5 1047,-10 1000,-10 933,-10 885,8 855,43 824,78 807,132 803,207 L 797,207 C 751,124 698,66 637,32 576,-3 501,-20 414,-20 Z M 455,115 C 521,115 580,130 631,160 682,190 723,231 753,284 782,336 797,390 797,445 L 797,534 600,530 C 515,529 451,520 408,504 364,488 330,463 307,430 284,397 272,353 272,299 272,240 288,195 320,163 351,131 396,115 455,115 Z"/>
<glyph unicode="@" horiz-adv-x="1747" d="M 1902,755 C 1902,631 1883,519 1845,419 1806,318 1753,241 1685,186 1616,131 1540,104 1455,104 1389,104 1338,119 1302,148 1266,177 1248,221 1248,280 L 1251,350 1245,350 C 1201,268 1147,207 1082,166 1017,125 946,104 871,104 766,104 685,138 628,206 570,274 541,368 541,489 541,598 563,700 606,794 649,888 709,963 786,1018 863,1073 949,1101 1043,1101 1189,1101 1289,1040 1344,919 L 1350,919 1389,1079 1545,1079 1429,573 C 1404,464 1392,379 1392,320 1392,257 1419,226 1473,226 1526,226 1576,249 1621,295 1666,341 1701,404 1727,485 1753,566 1766,655 1766,753 1766,872 1740,978 1689,1071 1638,1163 1564,1234 1467,1284 1370,1333 1257,1358 1128,1358 967,1358 824,1322 700,1251 576,1180 479,1077 408,943 337,808 302,658 302,491 302,362 328,249 381,151 433,52 509,-23 608,-76 707,-129 822,-155 954,-155 1051,-155 1149,-142 1248,-117 1347,-92 1450,-51 1557,7 L 1612,-105 C 1515,-163 1411,-207 1298,-237 1185,-268 1070,-283 954,-283 793,-283 653,-251 533,-187 412,-124 320,-33 257,85 193,202 161,338 161,491 161,678 203,847 286,1000 369,1153 484,1272 631,1357 778,1442 943,1484 1126,1484 1287,1484 1425,1454 1542,1394 1659,1333 1748,1248 1810,1138 1871,1028 1902,900 1902,755 Z M 1296,747 C 1296,815 1274,870 1230,912 1186,953 1127,974 1054,974 987,974 927,953 875,911 822,868 781,810 751,735 721,660 706,578 706,491 706,411 722,348 754,303 785,258 834,235 900,235 983,235 1060,270 1129,340 1198,410 1246,497 1273,602 1288,663 1296,712 1296,747 Z"/>
<glyph unicode=":" horiz-adv-x="239" d="M 187,875 L 187,1082 382,1082 382,875 187,875 Z M 187,0 L 187,207 382,207 382,0 187,0 Z"/>
<glyph unicode="8" horiz-adv-x="980" d="M 1050,393 C 1050,263 1009,162 926,89 843,16 725,-20 570,-20 419,-20 302,16 217,87 132,158 89,260 89,391 89,483 115,560 168,623 221,686 288,724 370,737 L 370,741 C 293,759 233,798 189,858 144,918 122,988 122,1069 122,1176 162,1263 243,1330 323,1397 431,1430 566,1430 705,1430 814,1397 895,1332 975,1267 1015,1178 1015,1067 1015,986 993,916 948,856 903,796 842,758 765,743 L 765,739 C 855,724 925,686 975,625 1025,563 1050,486 1050,393 Z M 828,1057 C 828,1216 741,1296 566,1296 481,1296 417,1276 373,1236 328,1196 306,1136 306,1057 306,976 329,915 375,873 420,830 485,809 568,809 653,809 717,829 762,868 806,907 828,970 828,1057 Z M 863,410 C 863,497 837,563 785,608 733,652 660,674 566,674 475,674 403,650 352,603 301,555 275,489 275,406 275,212 374,115 572,115 670,115 743,139 791,186 839,233 863,307 863,410 Z"/>
<glyph unicode="0" horiz-adv-x="980" d="M 1059,705 C 1059,470 1018,290 935,166 852,42 729,-20 567,-20 405,-20 283,42 202,165 121,288 80,468 80,705 80,947 120,1128 199,1249 278,1370 402,1430 573,1430 739,1430 862,1369 941,1247 1020,1125 1059,944 1059,705 Z M 876,705 C 876,908 853,1056 806,1147 759,1238 681,1284 573,1284 462,1284 383,1239 335,1149 286,1059 262,911 262,705 262,505 287,359 336,266 385,173 462,127 569,127 675,127 753,174 802,269 851,364 876,509 876,705 Z"/>
<glyph unicode="/" horiz-adv-x="557" d="M 0,-20 L 411,1484 569,1484 162,-20 0,-20 Z"/>
<glyph unicode="." horiz-adv-x="239" d="M 187,0 L 187,219 382,219 382,0 187,0 Z"/>
</font>
</defs>
<defs>
<font id="EmbeddedFont_2" horiz-adv-x="2048">
<font-face font-family="Liberation Sans Narrow embedded" units-per-em="2048" font-weight="normal" font-style="italic" ascent="1482" descent="423"/>
<missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
<glyph unicode="u" horiz-adv-x="848" d="M 339,1082 L 240,446 C 236,420 232,394 228,367 224,341 222,317 222,296 222,241 234,197 257,166 280,135 317,120 369,120 404,120 438,128 470,145 501,162 530,186 556,217 582,248 604,285 622,329 640,372 654,421 662,475 L 753,1082 894,1082 766,230 C 763,208 759,184 756,159 L 745,88 737,31 C 734,15 733,5 732,0 L 593,0 C 593,3 594,12 596,27 L 603,78 C 606,96 609,115 612,135 615,155 617,172 619,185 L 613,185 C 594,154 575,125 556,100 536,75 514,53 491,36 467,18 441,4 412,-5 383,-14 351,-19 314,-19 233,-19 173,5 132,54 91,103 71,173 71,265 71,289 73,316 78,346 83,376 87,403 91,428 L 192,1082 339,1082 Z"/>
<glyph unicode="t" horiz-adv-x="477" d="M 368,4 C 348,-2 326,-7 302,-12 277,-17 252,-20 226,-20 179,-20 143,-3 116,31 89,65 76,110 76,166 76,187 78,210 82,234 85,258 89,279 91,296 L 194,951 89,951 111,1082 214,1082 300,1324 398,1324 359,1082 523,1082 502,951 339,951 239,320 C 237,307 234,290 231,272 228,253 227,237 227,224 227,192 233,167 245,149 256,132 275,123 301,123 315,123 328,124 341,127 353,129 367,132 383,137 L 368,4 Z"/>
<glyph unicode="s" horiz-adv-x="821" d="M 744,317 C 744,260 735,211 716,169 697,126 671,91 637,63 603,35 562,14 513,1 464,-13 410,-20 349,-20 298,-20 254,-15 216,-4 177,7 144,22 117,43 89,63 66,88 48,119 29,149 15,184 4,223 L 125,279 C 133,252 144,229 157,208 170,187 185,169 204,155 223,140 245,129 271,122 297,115 327,111 362,111 397,111 429,115 458,122 487,129 513,140 534,155 555,170 571,190 583,214 594,238 600,267 600,301 600,328 595,351 585,370 574,389 560,405 541,420 522,434 499,447 471,459 444,470 414,483 381,497 346,511 312,526 280,543 248,560 220,580 196,603 171,626 152,654 138,686 123,717 116,754 116,797 116,852 126,898 145,937 164,975 191,1006 224,1030 257,1054 295,1072 339,1083 383,1094 430,1099 479,1099 524,1099 565,1094 602,1085 639,1076 672,1061 700,1041 728,1020 751,994 769,962 787,929 799,890 806,844 L 672,819 C 660,872 637,910 604,933 571,956 526,968 469,968 440,968 413,965 388,960 362,955 340,946 321,934 302,922 286,907 275,887 264,868 258,845 258,817 258,790 263,767 274,749 285,731 299,715 318,701 337,687 360,674 386,663 386,663 416,650 474,624 505,611 537,597 569,583 602,569 631,550 657,526 682,502 703,474 720,440 736,406 744,365 744,317 Z"/>
<glyph unicode="r" horiz-adv-x="610" d="M 589,938 C 580,941 569,944 556,947 543,950 529,951 515,951 480,951 449,939 421,914 393,889 369,858 348,820 327,782 309,740 294,694 279,649 269,605 262,564 L 175,0 28,0 157,830 C 161,853 165,877 168,900 L 178,968 188,1031 196,1082 335,1082 C 335,1067 335,1049 335,1029 L 325,969 316,910 C 313,891 311,874 309,861 L 310,861 C 327,902 343,938 360,969 377,999 394,1024 412,1044 430,1063 449,1078 470,1088 491,1097 513,1102 538,1102 544,1102 551,1102 558,1101 565,1100 572,1098 579,1097 586,1096 593,1094 600,1093 607,1091 612,1089 616,1088 L 589,938 Z"/>
<glyph unicode="p" horiz-adv-x="954" d="M 453,-20 C 386,-20 331,-3 288,32 246,67 216,115 198,178 L 194,178 C 194,177 193,171 192,159 190,148 188,133 185,116 L 177,59 C 174,38 171,18 168,-1 L 105,-425 -42,-425 150,862 C 154,888 157,913 161,937 165,961 168,983 171,1002 174,1022 176,1039 178,1052 180,1066 182,1076 183,1082 L 328,1082 C 328,1077 327,1068 325,1056 324,1044 322,1031 319,1016 317,1001 315,986 312,969 310,952 307,937 305,923 L 308,921 C 329,952 349,979 370,1002 391,1025 413,1044 436,1059 460,1074 485,1085 513,1092 540,1099 570,1102 604,1102 649,1102 688,1094 722,1077 756,1060 785,1037 808,1006 832,975 850,938 862,895 874,851 880,802 880,748 880,715 879,678 876,639 873,599 869,558 863,516 848,421 829,340 804,273 780,205 751,149 717,106 683,63 644,31 600,11 556,-10 507,-20 453,-20 Z M 563,963 C 528,963 494,957 462,944 430,931 400,910 373,879 346,848 322,806 301,754 281,702 264,636 251,556 240,490 235,431 236,378 236,335 240,297 250,264 259,231 273,203 290,181 307,158 328,141 353,130 377,119 405,113 435,113 470,113 501,119 528,132 556,144 581,165 603,196 626,226 645,267 663,318 680,369 695,433 707,510 720,591 726,659 726,716 726,798 713,860 687,901 661,942 620,963 563,963 Z"/>
<glyph unicode="o" horiz-adv-x="848" d="M 881,683 C 881,648 879,614 876,579 873,544 867,506 859,467 842,379 820,304 791,242 762,180 727,130 688,91 649,52 605,24 557,7 509,-11 458,-20 403,-20 350,-20 303,-10 260,10 217,29 181,58 151,96 120,133 97,179 80,234 63,288 55,350 55,419 56,450 57,483 60,516 62,549 66,584 73,620 89,704 111,776 139,837 166,897 199,947 238,986 276,1025 319,1054 368,1073 416,1092 469,1101 526,1101 584,1101 635,1092 679,1073 723,1054 760,1027 790,991 820,955 843,911 858,860 873,808 881,749 881,683 Z M 728,683 C 728,734 723,778 714,814 705,850 691,880 674,903 656,926 635,942 610,953 585,964 556,969 525,969 496,969 467,965 438,957 409,948 381,931 354,906 327,881 303,845 281,798 259,751 241,689 226,612 219,575 214,541 211,508 208,475 207,444 207,416 207,361 212,315 223,276 233,237 247,206 266,182 284,158 305,141 330,130 355,119 382,113 412,113 441,113 470,117 499,125 528,133 555,150 581,176 606,201 630,238 652,285 673,332 691,395 706,473 713,513 719,550 722,583 725,616 727,650 728,683 Z"/>
<glyph unicode="n" horiz-adv-x="848" d="M 588,0 L 688,645 C 692,672 696,698 700,725 704,752 706,775 706,795 706,848 695,889 672,918 649,947 611,962 559,962 524,962 491,954 459,937 428,920 400,896 375,865 349,834 328,796 309,753 291,709 278,660 269,607 L 175,0 28,0 160,852 C 164,874 168,898 171,923 L 182,994 191,1051 C 194,1067 195,1077 196,1082 L 335,1082 C 335,1079 336,1069 338,1054 L 331,1004 322,945 C 319,926 317,910 314,897 L 315,897 C 334,928 353,957 373,982 392,1007 414,1029 438,1047 461,1064 487,1078 516,1087 545,1096 577,1101 614,1101 695,1101 756,1077 797,1028 838,979 858,909 858,817 858,804 856,783 851,752 846,721 842,693 838,668 L 733,0 588,0 Z"/>
<glyph unicode="i" horiz-adv-x="398" d="M 237,1312 L 264,1484 411,1484 384,1312 237,1312 Z M 27,0 L 200,1082 347,1082 174,0 27,0 Z"/>
<glyph unicode="h" horiz-adv-x="848" d="M 320,897 C 339,928 358,957 377,982 396,1007 418,1029 441,1047 465,1064 491,1078 519,1087 547,1096 580,1101 616,1101 696,1101 756,1077 796,1028 837,979 857,909 857,817 857,796 855,770 850,740 845,710 841,682 837,657 L 735,0 587,0 687,646 C 691,672 695,698 699,725 703,752 705,775 705,795 705,848 694,889 671,918 648,947 610,962 558,962 524,962 491,953 460,936 429,919 401,895 376,864 351,833 330,796 312,752 294,709 281,660 272,606 L 175,0 28,0 265,1484 412,1484 350,1099 C 347,1077 343,1055 340,1033 336,1011 333,990 330,972 327,953 325,937 323,924 320,911 319,902 318,897 L 320,897 Z"/>
<glyph unicode="f" horiz-adv-x="583" d="M 356,951 L 204,0 57,0 209,951 84,951 105,1082 230,1082 249,1204 C 256,1243 264,1280 274,1314 285,1348 300,1378 319,1403 338,1428 363,1448 394,1463 425,1477 463,1484 510,1484 527,1484 545,1483 564,1481 583,1479 599,1476 612,1472 L 591,1335 C 586,1336 581,1337 574,1338 568,1339 561,1340 554,1341 547,1342 540,1342 533,1343 527,1343 521,1343 516,1343 495,1343 478,1339 464,1332 450,1325 438,1314 429,1300 420,1286 413,1269 408,1249 403,1228 398,1205 393,1179 L 377,1082 551,1082 529,951 356,951 Z"/>
<glyph unicode="e" horiz-adv-x="821" d="M 210,503 C 207,484 206,466 205,447 204,428 203,409 203,390 203,301 221,233 258,186 294,139 348,115 421,115 452,115 480,120 505,130 530,139 553,152 574,169 594,185 612,204 628,226 643,247 656,270 667,294 L 780,231 C 767,201 750,171 730,142 710,112 686,85 657,61 628,37 593,18 552,3 511,-12 461,-20 404,-20 349,-20 301,-10 258,9 215,28 178,55 148,92 118,128 95,172 80,225 65,278 57,338 57,405 57,510 69,606 92,692 115,778 147,851 188,912 229,973 278,1020 334,1053 390,1086 451,1102 517,1102 577,1102 629,1092 674,1073 718,1054 755,1027 784,992 813,957 835,916 850,868 865,819 872,766 872,708 872,694 872,679 871,662 870,645 868,628 867,610 865,592 863,574 861,556 858,537 855,520 852,503 L 210,503 Z M 722,641 C 723,654 724,667 725,679 725,690 725,702 725,713 725,757 720,795 710,828 700,860 686,887 668,908 650,929 629,944 604,954 579,964 551,969 520,969 494,969 467,964 438,955 409,945 381,928 354,903 327,878 303,845 281,803 259,760 242,706 230,641 L 722,641 Z"/>
</font>
</defs>
<defs class="TextShapeIndex">
<g ooo:slide="id1" ooo:id-list="id3 id4 id5 id6 id7 id8 id9 id10"/>
</defs>
<defs class="EmbeddedBulletChars">
<g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
</g>
<g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
</g>
<g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
</g>
<g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
</g>
<g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
</g>
<g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
</g>
<g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
</g>
<g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
</g>
<g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
<path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
</g>
<g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
</g>
</defs>
<g>
<g id="id2" class="Master_Slide">
<g id="bg-id2" class="Background"/>
<g id="bo-id2" class="BackgroundObjects"/>
</g>
</g>
<g class="SlideGroup">
<g>
<g id="container-id1">
<g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="com.sun.star.drawing.CustomShape">
<g id="id3">
<rect class="BoundingBox" stroke="none" fill="none" x="5152" y="1091" width="4724" height="731"/>
<path fill="rgb(204,255,0)" stroke="none" d="M 7514,1821 L 5152,1821 5152,1091 9875,1091 9875,1821 7514,1821 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id4">
<rect class="BoundingBox" stroke="none" fill="none" x="2168" y="1091" width="2439" height="731"/>
<path fill="rgb(255,255,153)" stroke="none" d="M 3387,1821 L 2168,1821 2168,1091 4606,1091 4606,1821 3387,1821 Z"/>
</g>
</g>
<g class="TextShape">
<g id="id5">
<rect class="BoundingBox" stroke="none" fill="none" x="500" y="1000" width="10713" height="879"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="564px" font-weight="400"><tspan class="TextPosition" x="750" y="1633"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">http://user:pass@www.example.com:80</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id6">
<rect class="BoundingBox" stroke="none" fill="none" x="2172" y="713" width="2418" height="434"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 4580,1137 C 4580,1033 4481,929 4381,929 L 3581,929 C 3481,929 3381,825 3381,722 3381,825 3281,929 3181,929 L 2381,929 C 2281,929 2181,1033 2181,1137"/>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id7">
<rect class="BoundingBox" stroke="none" fill="none" x="5163" y="690" width="4723" height="441"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 9876,1121 C 9876,1015 9680,910 9484,910 L 7917,910 C 7720,910 7524,804 7524,699 7524,804 7328,910 7132,910 L 5564,910 C 5368,910 5172,1015 5172,1121"/>
</g>
</g>
<g class="TextShape">
<g id="id8">
<rect class="BoundingBox" stroke="none" fill="none" x="2540" y="200" width="1743" height="650"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans Narrow, sans-serif" font-size="423px" font-style="italic" font-weight="400"><tspan class="TextPosition" x="2790" y="634"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">userinfo</tspan></tspan></tspan></text>
</g>
</g>
<g class="TextShape">
<g id="id9">
<rect class="BoundingBox" stroke="none" fill="none" x="6932" y="200" width="1163" height="650"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans Narrow, sans-serif" font-size="423px" font-style="italic" font-weight="400"><tspan class="TextPosition" x="7182" y="634"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">host</tspan></tspan></tspan></text>
</g>
</g>
<g class="TextShape">
<g id="id10">
<rect class="BoundingBox" stroke="none" fill="none" x="9773" y="200" width="1104" height="650"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans Narrow, sans-serif" font-size="423px" font-style="italic" font-weight="400"><tspan class="TextPosition" x="10023" y="634"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">port</tspan></tspan></tspan></text>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="107.95mm" height="40.64mm" viewBox="0 0 10795 4064" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="10795" height="4064"/>
</clipPath>
<clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
<rect x="10" y="4" width="10774" height="4056"/>
</clipPath>
</defs>
<defs>
<font id="EmbeddedFont_1" horiz-adv-x="2048">
<font-face font-family="Liberation Mono embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1693" descent="609"/>
<missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
<glyph unicode="w" horiz-adv-x="1218" d="M 1018,0 L 814,0 671,471 614,673 575,534 407,0 204,0 21,1082 199,1082 292,475 C 314,299 325,190 325,149 351,256 370,327 383,363 L 518,787 711,787 841,362 C 862,292 881,221 896,149 896,169 897,194 900,224 903,254 906,285 910,317 914,348 918,378 922,407 926,436 929,458 931,475 L 1032,1082 1208,1082 1018,0 Z"/>
<glyph unicode="v" horiz-adv-x="1112" d="M 715,0 L 502,0 69,1082 271,1082 539,378 556,325 608,141 643,258 682,376 958,1082 1159,1082 715,0 Z"/>
<glyph unicode="u" horiz-adv-x="874" d="M 365,1082 L 365,396 C 365,292 381,220 414,180 447,139 505,119 589,119 675,119 743,148 793,207 843,266 868,348 868,455 L 868,1082 1049,1082 1049,231 C 1049,105 1051,28 1055,0 L 885,0 C 884,3 884,12 883,27 882,42 882,59 881,78 880,97 878,132 877,185 L 874,185 C 833,110 785,58 731,27 676,-4 609,-20 528,-20 409,-20 323,10 268,69 213,128 185,225 185,361 L 185,1082 365,1082 Z"/>
<glyph unicode="t" horiz-adv-x="821" d="M 190,940 L 190,1082 360,1082 418,1364 538,1364 538,1082 970,1082 970,940 538,940 538,288 C 538,235 552,196 581,171 609,146 655,133 720,133 809,133 908,144 1017,167 L 1017,30 C 904,-1 793,-16 682,-16 574,-16 493,7 439,53 385,98 358,170 358,269 L 358,940 190,940 Z"/>
<glyph unicode="s" horiz-adv-x="900" d="M 1060,309 C 1060,206 1021,126 944,68 866,9 758,-20 621,-20 484,-20 379,2 308,45 236,88 189,155 167,248 L 326,279 C 339,222 366,180 408,154 449,127 520,114 621,114 801,114 891,171 891,285 891,328 875,362 842,389 809,415 759,436 692,453 516,496 404,530 357,555 310,580 273,611 248,648 223,685 210,731 210,786 210,884 245,961 316,1016 387,1071 489,1099 623,1099 740,1099 834,1077 904,1033 974,988 1018,924 1035,839 L 873,819 C 866,867 842,903 802,928 762,953 702,965 623,965 460,965 378,915 378,814 378,774 392,742 420,718 447,694 492,675 553,660 L 672,629 C 781,602 859,576 907,550 954,524 992,492 1019,453 1046,414 1060,366 1060,309 Z"/>
<glyph unicode="r" horiz-adv-x="821" d="M 1045,918 C 970,931 900,937 833,937 726,937 639,897 573,816 507,735 474,633 474,508 L 474,0 294,0 294,701 C 294,752 290,811 281,880 272,949 259,1016 242,1082 L 413,1082 C 440,990 456,907 461,832 L 466,832 C 499,907 532,962 564,997 596,1032 634,1058 678,1076 722,1093 776,1102 839,1102 908,1102 977,1096 1045,1085 L 1045,918 Z"/>
<glyph unicode="l" horiz-adv-x="847" d="M 835,147 L 1116,142 1116,0 746,4 C 671,17 616,47 581,94 566,114 558,169 556,258 L 556,1342 267,1342 267,1484 736,1484 736,237 C 737,207 745,185 761,170 775,157 800,150 835,147 Z M 556,142 L 556,258 556,142 Z"/>
<glyph unicode="i" horiz-adv-x="1007" d="M 745,142 L 1125,142 1125,0 143,0 143,142 565,142 565,940 246,940 246,1082 745,1082 745,142 Z M 545,1292 L 545,1484 745,1484 745,1292 545,1292 Z"/>
<glyph unicode="e" horiz-adv-x="954" d="M 322,503 C 322,382 349,287 403,218 456,149 530,115 623,115 692,115 752,130 804,160 855,189 890,230 907,281 L 1065,236 C 1036,153 982,90 904,46 825,2 732,-20 623,-20 466,-20 345,29 260,127 175,225 133,365 133,548 133,726 175,863 258,959 341,1054 460,1102 617,1102 774,1102 892,1054 973,959 1054,864 1094,720 1094,527 L 1094,503 322,503 Z M 619,969 C 530,969 459,940 407,882 355,823 327,743 324,641 L 908,641 C 889,860 793,969 619,969 Z"/>
<glyph unicode="c" horiz-adv-x="980" d="M 130,542 C 130,722 173,860 259,957 345,1054 469,1102 632,1102 753,1102 853,1073 932,1015 1011,956 1059,878 1078,779 L 886,765 C 875,826 849,874 806,909 763,944 703,961 624,961 519,961 442,928 393,863 344,798 319,692 319,546 319,398 344,290 393,222 442,153 518,119 623,119 695,119 755,137 802,172 849,207 879,261 890,334 L 1080,322 C 1071,258 1047,200 1008,148 968,95 915,54 850,25 785,-5 712,-20 631,-20 468,-20 343,28 258,124 173,220 130,359 130,542 Z"/>
<glyph unicode="b" horiz-adv-x="927" d="M 1090,546 C 1090,357 1056,215 989,121 921,27 824,-20 698,-20 535,-20 424,41 364,164 L 362,164 C 362,132 361,99 359,64 356,29 354,8 353,0 L 179,0 C 183,36 185,110 185,223 L 185,1484 365,1484 365,1061 C 365,1018 364,965 361,904 L 365,904 C 426,1037 537,1104 699,1104 960,1104 1090,918 1090,546 Z M 904,540 C 904,689 884,798 843,865 802,932 737,965 650,965 551,965 478,929 433,856 388,783 365,672 365,524 365,385 387,281 431,214 475,147 547,113 648,113 738,113 803,148 844,218 884,287 904,395 904,540 Z"/>
<glyph unicode="a" horiz-adv-x="1059" d="M 1101,111 C 1118,111 1138,113 1160,118 L 1160,6 C 1115,-5 1068,-10 1021,-10 954,-10 906,8 876,43 845,78 828,132 824,207 L 818,207 C 775,126 724,68 665,33 606,-2 533,-20 446,-20 341,-20 261,9 208,66 155,123 128,202 128,302 128,535 279,653 582,656 L 818,660 818,719 C 818,806 800,869 765,908 730,946 673,965 596,965 517,965 461,951 426,923 391,895 371,852 364,793 L 176,810 C 207,1005 348,1102 599,1102 732,1102 833,1071 900,1009 967,946 1000,856 1000,738 L 1000,272 C 1000,219 1007,179 1021,152 1035,125 1062,111 1101,111 Z M 492,117 C 556,117 613,132 662,163 711,194 750,235 777,286 804,337 818,390 818,445 L 818,534 628,530 C 549,529 489,520 448,504 407,488 375,464 352,431 329,398 317,354 317,299 317,244 332,200 362,167 391,134 435,117 492,117 Z"/>
<glyph unicode="_" horiz-adv-x="1271" d="M -5,-220 L -5,-124 1233,-124 1233,-220 -5,-220 Z"/>
</font>
</defs>
<defs class="TextShapeIndex">
<g ooo:slide="id1" ooo:id-list="id3 id4 id5 id6 id7 id8 id9 id10 id11 id12"/>
</defs>
<defs class="EmbeddedBulletChars">
<g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
</g>
<g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
</g>
<g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
</g>
<g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
</g>
<g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
</g>
<g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
</g>
<g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
</g>
<g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
</g>
<g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
<path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
</g>
<g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
</g>
</defs>
<g>
<g id="id2" class="Master_Slide">
<g id="bg-id2" class="Background"/>
<g id="bo-id2" class="BackgroundObjects"/>
</g>
</g>
<g class="SlideGroup">
<g>
<g id="container-id1">
<g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="com.sun.star.drawing.CustomShape">
<g id="id3">
<rect class="BoundingBox" stroke="none" fill="none" x="-1" y="0" width="10796" height="4065"/>
<path fill="rgb(255,255,255)" stroke="none" d="M 5397,4064 L -1,4064 -1,0 10794,0 10794,4064 5397,4064 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id4">
<rect class="BoundingBox" stroke="none" fill="none" x="2913" y="290" width="3512" height="654"/>
<path fill="rgb(221,221,221)" stroke="none" d="M 4669,934 L 2922,934 2922,299 6415,299 6415,934 4669,934 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 4669,934 L 2922,934 2922,299 6415,299 6415,934 4669,934 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Mono, monospace" font-size="353px" font-weight="400"><tspan class="TextPosition" x="3293" y="710"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">url_view_base</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id5">
<rect class="BoundingBox" stroke="none" fill="none" x="4820" y="1560" width="3511" height="654"/>
<path fill="rgb(221,221,221)" stroke="none" d="M 6575,2204 L 4829,2204 4829,1569 8321,1569 8321,2204 6575,2204 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 6575,2204 L 4829,2204 4829,1569 8321,1569 8321,2204 6575,2204 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Mono, monospace" font-size="353px" font-weight="400"><tspan class="TextPosition" x="5729" y="1980"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">url_base</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id6">
<rect class="BoundingBox" stroke="none" fill="none" x="2596" y="2830" width="3511" height="654"/>
<path fill="rgb(255,255,255)" stroke="none" d="M 4351,3474 L 2605,3474 2605,2839 6097,2839 6097,3474 4351,3474 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 4351,3474 L 2605,3474 2605,2839 6097,2839 6097,3474 4351,3474 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Mono, monospace" font-size="353px" font-weight="400"><tspan class="TextPosition" x="4034" y="3250"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">url</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id7">
<rect class="BoundingBox" stroke="none" fill="none" x="6724" y="2830" width="3511" height="654"/>
<path fill="rgb(255,255,255)" stroke="none" d="M 8479,3474 L 6733,3474 6733,2839 10225,2839 10225,3474 8479,3474 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 8479,3474 L 6733,3474 6733,2839 10225,2839 10225,3474 8479,3474 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Mono, monospace" font-size="353px" font-weight="400"><tspan class="TextPosition" x="7421" y="3250"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">static_url</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id8">
<rect class="BoundingBox" stroke="none" fill="none" x="691" y="1560" width="3511" height="654"/>
<path fill="rgb(255,255,255)" stroke="none" d="M 2446,2204 L 700,2204 700,1569 4192,1569 4192,2204 2446,2204 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 2446,2204 L 700,2204 700,1569 4192,1569 4192,2204 2446,2204 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Mono, monospace" font-size="353px" font-weight="400"><tspan class="TextPosition" x="1600" y="1980"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">url_view</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.ConnectorShape">
<g id="id9">
<rect class="BoundingBox" stroke="none" fill="none" x="2437" y="926" width="2242" height="654"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 4669,935 L 2446,1570"/>
</g>
</g>
<g class="com.sun.star.drawing.ConnectorShape">
<g id="id10">
<rect class="BoundingBox" stroke="none" fill="none" x="4660" y="926" width="1925" height="654"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 4669,935 L 6575,1570"/>
</g>
</g>
<g class="com.sun.star.drawing.ConnectorShape">
<g id="id11">
<rect class="BoundingBox" stroke="none" fill="none" x="4342" y="2196" width="2243" height="654"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 6575,2205 L 4351,2840"/>
</g>
</g>
<g class="com.sun.star.drawing.ConnectorShape">
<g id="id12">
<rect class="BoundingBox" stroke="none" fill="none" x="6566" y="2196" width="1923" height="654"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 6575,2205 L 8479,2840"/>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 150 KiB

View File

@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="165.1mm" height="16.51mm" viewBox="0 0 16510 1651" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="16510" height="1651"/>
</clipPath>
<clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
<rect x="16" y="1" width="16477" height="1648"/>
</clipPath>
</defs>
<defs>
<font id="EmbeddedFont_1" horiz-adv-x="2048">
<font-face font-family="Liberation Sans embedded" units-per-em="2048" font-weight="normal" font-style="italic" ascent="1852" descent="423"/>
<missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
<glyph unicode="y" horiz-adv-x="1271" d="M 16,-425 C -32,-425 -76,-420 -116,-411 L -85,-277 C -55,-282 -29,-285 -8,-285 55,-285 111,-264 160,-221 208,-178 255,-116 302,-35 L 329,12 112,1082 295,1082 407,484 C 417,431 426,374 435,314 444,253 448,214 449,196 456,211 464,229 475,250 486,271 637,549 928,1082 L 1127,1082 501,0 C 427,-129 368,-219 323,-270 278,-322 231,-361 182,-386 133,-412 77,-425 16,-425 Z"/>
<glyph unicode="u" horiz-adv-x="1033" d="M 415,1082 L 289,437 C 277,378 271,328 271,287 271,176 331,120 450,120 534,120 608,152 672,216 736,280 779,367 800,476 L 918,1082 1098,1082 932,231 C 919,168 906,91 893,0 L 723,0 C 723,7 727,33 734,78 741,122 746,158 751,185 L 748,185 C 693,108 637,55 582,26 526,-4 460,-19 383,-19 284,-19 210,5 161,54 111,103 86,173 86,265 86,308 93,362 107,429 L 234,1082 415,1082 Z"/>
<glyph unicode="t" horiz-adv-x="557" d="M 275,-20 C 218,-20 174,-3 142,31 109,65 93,110 93,166 93,203 98,246 108,296 L 234,951 109,951 135,1082 262,1082 367,1324 487,1324 440,1082 640,1082 614,951 414,951 289,306 C 281,266 277,234 277,211 277,152 307,123 367,123 395,123 428,128 467,137 L 448,4 C 382,-12 324,-20 275,-20 Z"/>
<glyph unicode="s" horiz-adv-x="1006" d="M 907,317 C 907,209 866,126 783,68 700,9 581,-20 425,-20 309,-20 217,0 149,39 80,78 32,139 5,223 L 152,279 C 174,220 208,178 255,151 301,124 363,111 441,111 536,111 609,127 658,160 707,192 732,239 732,301 732,342 715,377 681,405 647,432 575,463 465,497 380,525 316,552 273,579 230,606 198,637 175,673 152,708 141,750 141,797 141,894 180,968 257,1021 334,1073 443,1099 584,1099 820,1099 953,1014 982,844 L 819,819 C 804,872 777,910 736,933 695,956 641,968 572,968 489,968 426,955 382,929 337,902 315,865 315,817 315,789 322,765 336,746 350,727 370,710 397,695 423,680 484,657 579,627 664,600 728,573 771,546 814,519 847,486 871,449 895,412 907,368 907,317 Z"/>
<glyph unicode="r" horiz-adv-x="742" d="M 718,938 C 689,947 659,951 628,951 558,951 495,914 439,841 382,768 344,675 324,564 L 214,0 34,0 196,830 221,968 239,1082 409,1082 374,861 378,861 C 422,950 465,1012 508,1048 551,1084 600,1102 656,1102 687,1102 718,1097 751,1088 L 718,938 Z"/>
<glyph unicode="q" horiz-adv-x="1086" d="M 401,-21 C 296,-21 215,11 157,74 98,137 69,223 69,333 69,468 90,600 131,727 172,854 229,948 304,1009 378,1070 473,1101 588,1101 670,1101 737,1084 789,1049 840,1014 877,966 898,903 L 903,903 C 910,939 919,978 930,1021 941,1064 948,1089 952,1096 L 1125,1096 C 1110,1044 1088,946 1060,801 L 822,-425 642,-425 727,14 759,160 755,160 C 706,97 655,51 601,22 547,-7 480,-21 401,-21 Z M 453,118 C 519,118 576,132 623,159 670,186 709,226 742,281 775,335 800,403 819,485 838,566 847,639 847,704 847,787 826,852 784,899 741,945 682,968 607,968 526,968 461,944 414,896 367,847 329,768 300,659 271,549 257,451 257,365 257,283 273,221 304,180 335,139 385,118 453,118 Z"/>
<glyph unicode="p" horiz-adv-x="1139" d="M 554,-20 C 472,-20 405,-3 354,32 302,67 265,115 244,178 L 239,178 C 239,171 236,149 231,113 225,77 191,-102 128,-425 L -51,-425 198,861 C 213,935 225,1009 233,1082 L 400,1082 C 400,1064 398,1037 394,1000 389,963 386,936 383,921 L 387,921 C 436,984 487,1030 541,1059 595,1088 662,1102 741,1102 846,1102 927,1071 986,1008 1044,945 1073,858 1073,748 1073,613 1053,482 1012,355 971,228 913,133 839,72 764,11 669,-20 554,-20 Z M 689,963 C 623,963 567,950 520,923 473,896 433,855 400,801 367,746 342,678 323,597 304,515 295,442 295,377 295,294 316,229 359,183 401,136 460,113 535,113 618,113 683,138 731,189 779,239 817,319 844,429 871,538 885,634 885,716 885,798 869,860 838,901 807,942 757,963 689,963 Z"/>
<glyph unicode="o" horiz-adv-x="1033" d="M 1074,683 C 1074,596 1061,506 1034,413 1007,319 969,240 920,175 870,110 809,61 737,29 665,-4 583,-20 491,-20 360,-20 257,19 181,98 105,177 67,284 67,419 70,555 94,676 141,781 188,886 252,966 335,1020 418,1074 520,1101 642,1101 782,1101 889,1065 963,992 1037,919 1074,816 1074,683 Z M 888,683 C 888,874 805,969 640,969 550,969 478,946 424,900 369,853 327,783 297,689 267,595 252,504 252,416 252,317 273,242 316,191 359,139 421,113 502,113 571,113 626,125 668,148 709,171 746,207 777,256 808,305 834,367 854,443 873,519 885,599 888,683 Z"/>
<glyph unicode="n" horiz-adv-x="1033" d="M 717,0 L 843,645 C 855,704 861,754 861,795 861,906 801,962 682,962 598,962 524,930 460,866 396,802 353,715 332,606 L 214,0 34,0 200,851 C 213,914 226,991 239,1082 L 409,1082 C 409,1075 406,1049 399,1005 392,960 386,924 381,897 L 384,897 C 439,974 495,1027 551,1057 606,1086 672,1101 749,1101 848,1101 922,1077 972,1028 1021,979 1046,909 1046,817 1046,774 1039,720 1025,653 L 898,0 717,0 Z"/>
<glyph unicode="m" horiz-adv-x="1589" d="M 660,0 L 784,634 C 801,717 809,775 809,808 809,858 796,896 771,923 746,949 704,962 647,962 570,962 502,929 445,863 387,797 349,711 331,604 L 213,0 34,0 200,851 C 213,914 226,991 239,1082 L 409,1082 C 409,1075 406,1049 399,1005 392,960 386,924 381,897 L 384,897 C 433,973 482,1026 531,1056 580,1086 638,1101 706,1101 787,1101 851,1081 898,1042 945,1002 974,944 983,869 1038,956 1093,1016 1147,1050 1200,1084 1262,1101 1331,1101 1421,1101 1490,1077 1539,1028 1587,979 1611,909 1611,817 1611,774 1604,720 1590,653 L 1463,0 1285,0 1409,634 C 1426,717 1434,775 1434,808 1434,858 1421,896 1396,923 1371,949 1329,962 1272,962 1195,962 1127,930 1070,865 1013,800 975,714 956,607 L 838,0 660,0 Z"/>
<glyph unicode="i" horiz-adv-x="478" d="M 287,1312 L 321,1484 501,1484 467,1312 287,1312 Z M 33,0 L 243,1082 423,1082 212,0 33,0 Z"/>
<glyph unicode="h" horiz-adv-x="1033" d="M 383,897 C 438,974 494,1027 550,1057 605,1086 671,1101 748,1101 847,1101 921,1077 971,1028 1020,979 1045,909 1045,817 1045,774 1038,720 1024,653 L 897,0 716,0 842,645 C 854,704 860,754 860,795 860,906 800,962 681,962 597,962 523,930 459,866 395,802 352,715 331,606 L 213,0 34,0 322,1484 502,1484 427,1098 C 415,1031 399,964 380,897 L 383,897 Z"/>
<glyph unicode="g" horiz-adv-x="1139" d="M 397,-425 C 171,-425 40,-341 4,-173 L 167,-131 C 190,-236 268,-288 401,-288 496,-288 569,-263 621,-214 673,-165 710,-85 731,27 L 765,201 763,201 C 722,142 685,99 654,73 622,47 586,27 547,13 507,-1 461,-8 410,-8 308,-8 226,26 164,93 101,160 70,248 70,359 70,448 83,543 108,646 133,749 167,834 210,902 253,970 306,1020 368,1053 430,1085 503,1101 588,1101 669,1101 737,1082 793,1044 848,1006 884,957 900,897 L 902,897 C 907,922 915,957 927,1004 939,1050 947,1076 950,1082 L 1121,1082 1102,1000 1072,858 911,31 C 879,-130 822,-247 739,-318 656,-389 542,-425 397,-425 Z M 259,373 C 259,292 277,231 312,189 347,146 398,125 466,125 538,125 603,151 662,204 721,256 766,328 799,419 831,510 847,605 847,704 847,787 826,852 783,899 740,945 682,968 607,968 547,968 497,956 457,931 417,906 383,868 356,815 329,762 306,692 287,605 268,517 259,440 259,373 Z"/>
<glyph unicode="f" horiz-adv-x="689" d="M 434,951 L 249,0 69,0 254,951 102,951 128,1082 280,1082 303,1204 C 318,1279 339,1335 364,1372 389,1409 422,1437 463,1456 504,1475 557,1484 622,1484 671,1484 713,1480 746,1472 L 720,1335 675,1341 629,1343 C 587,1343 555,1332 533,1311 510,1289 492,1245 479,1179 L 460,1082 671,1082 645,951 434,951 Z"/>
<glyph unicode="e" horiz-adv-x="1033" d="M 256,503 C 252,480 249,442 247,390 247,301 269,233 314,186 358,139 425,115 514,115 579,115 637,131 690,163 743,195 784,239 813,294 L 951,231 C 902,144 841,80 766,40 691,0 600,-20 493,-20 359,-20 255,17 181,92 106,166 69,270 69,405 69,539 93,659 140,766 187,872 254,955 340,1014 426,1073 523,1102 630,1102 767,1102 873,1068 949,999 1025,930 1063,833 1063,708 1063,638 1055,570 1039,503 L 256,503 Z M 880,641 L 884,713 C 884,796 863,859 820,903 777,947 715,969 634,969 545,969 470,941 409,884 348,827 305,746 280,641 L 880,641 Z"/>
<glyph unicode="c" horiz-adv-x="980" d="M 469,122 C 606,122 702,199 758,352 L 914,303 C 833,88 684,-20 465,-20 337,-20 239,16 170,89 101,162 67,264 67,395 67,528 91,652 140,767 188,882 252,966 332,1021 411,1075 509,1102 625,1102 738,1102 827,1074 893,1017 958,960 994,883 1001,784 L 824,759 C 820,824 800,874 764,909 728,944 680,961 619,961 535,961 467,939 415,894 363,849 323,777 294,679 265,581 251,484 251,389 251,211 324,122 469,122 Z"/>
<glyph unicode="a" horiz-adv-x="1060" d="M 927,-10 C 865,-10 820,3 792,29 763,54 749,92 749,143 L 754,207 748,207 C 693,123 635,64 576,31 517,-3 445,-20 361,-20 268,-20 192,8 134,64 75,120 46,191 46,278 46,401 90,495 179,558 267,621 408,654 601,657 L 833,660 C 846,725 852,768 852,787 852,848 834,893 799,922 764,951 715,965 652,965 573,965 513,951 472,923 431,894 402,851 384,793 L 206,822 C 236,920 288,991 363,1036 437,1080 537,1102 662,1102 776,1102 866,1075 933,1022 999,969 1032,897 1032,807 1032,764 1026,712 1013,650 L 939,272 C 932,240 928,211 928,184 928,135 955,111 1009,111 1027,111 1047,113 1069,118 L 1055,6 C 1011,-5 968,-10 927,-10 Z M 809,536 L 610,532 C 531,530 468,523 423,511 378,498 343,483 318,464 293,445 273,421 259,392 244,363 237,327 237,286 237,236 253,195 286,164 318,133 360,117 411,117 476,117 534,131 586,159 638,186 681,222 715,267 749,312 771,360 782,411 L 809,536 Z"/>
</font>
</defs>
<defs>
<font id="EmbeddedFont_2" horiz-adv-x="2048">
<font-face font-family="Liberation Sans embedded" units-per-em="2048" font-weight="bold" font-style="normal" ascent="1852" descent="423"/>
<missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
<glyph unicode="”" horiz-adv-x="742" d="M 872,1217 C 872,1136 864,1065 847,1004 830,942 802,884 763,831 L 579,831 C 668,943 712,1049 712,1149 L 585,1149 585,1409 872,1409 872,1217 Z M 442,1217 C 442,1134 434,1062 417,1003 400,943 372,886 333,831 L 151,831 C 238,943 282,1049 282,1149 L 155,1149 155,1409 442,1409 442,1217 Z"/>
<glyph unicode="“" horiz-adv-x="742" d="M 579,831 L 579,1026 C 579,1109 588,1180 606,1241 624,1302 652,1358 690,1409 L 872,1409 C 831,1357 799,1303 776,1248 753,1192 741,1140 741,1092 L 868,1092 868,831 579,831 Z M 151,831 L 151,1026 C 151,1107 160,1178 177,1240 194,1301 222,1358 259,1409 L 442,1409 C 401,1357 369,1303 346,1248 323,1192 311,1140 311,1092 L 438,1092 438,831 151,831 Z"/>
<glyph unicode="?" horiz-adv-x="1060" d="M 1133,1026 C 1133,961 1119,903 1090,852 1061,801 1006,747 927,690 L 851,635 C 806,602 772,569 750,536 727,503 715,466 713,426 L 446,426 C 450,494 469,555 504,608 538,661 588,711 655,758 726,807 777,851 806,889 835,926 850,968 850,1014 850,1073 831,1119 793,1153 754,1187 700,1204 629,1204 562,1204 505,1184 460,1145 414,1106 387,1054 379,989 L 94,1001 C 112,1136 168,1242 261,1317 354,1392 476,1430 625,1430 783,1430 907,1394 998,1323 1088,1251 1133,1152 1133,1026 Z M 438,0 L 438,270 727,270 727,0 438,0 Z"/>
<glyph unicode=":" horiz-adv-x="319" d="M 197,752 L 197,1034 485,1034 485,752 197,752 Z M 197,0 L 197,281 485,281 485,0 197,0 Z"/>
<glyph unicode="/" horiz-adv-x="557" d="M 20,-41 L 311,1484 549,1484 263,-41 20,-41 Z"/>
<glyph unicode="#" horiz-adv-x="1086" d="M 909,862 L 840,530 1055,530 1055,381 809,381 727,0 571,0 651,381 344,381 264,0 111,0 190,381 35,381 35,530 223,530 293,862 86,862 86,1010 324,1010 408,1395 561,1395 479,1010 786,1010 870,1395 1026,1395 942,1010 1106,1010 1106,862 909,862 Z M 449,862 L 377,530 686,530 756,862 449,862 Z"/>
<glyph unicode=" " horiz-adv-x="556"/>
</font>
</defs>
<defs class="TextShapeIndex">
<g ooo:slide="id1" ooo:id-list="id3 id4 id5 id6 id7 id8"/>
</defs>
<defs class="EmbeddedBulletChars">
<g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
</g>
<g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
</g>
<g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
</g>
<g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
</g>
<g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
</g>
<g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
</g>
<g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
</g>
<g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
</g>
<g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
<path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
</g>
<g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
</g>
</defs>
<g>
<g id="id2" class="Master_Slide">
<g id="bg-id2" class="Background"/>
<g id="bo-id2" class="BackgroundObjects"/>
</g>
</g>
<g class="SlideGroup">
<g>
<g id="container-id1">
<g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="com.sun.star.drawing.CustomShape">
<g id="id3">
<rect class="BoundingBox" stroke="none" fill="none" x="0" y="-1" width="16511" height="1652"/>
<path fill="rgb(255,255,255)" stroke="none" d="M 8255,1650 L 0,1650 0,-1 16510,-1 16510,1650 8255,1650 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id4">
<rect class="BoundingBox" stroke="none" fill="none" x="12990" y="290" width="3195" height="997"/>
<path fill="rgb(255,237,182)" stroke="none" d="M 13162,299 L 13162,299 C 13133,299 13105,307 13080,321 13056,335 13035,356 13021,381 13007,405 12999,433 12999,462 L 12999,1114 12999,1114 C 12999,1143 13007,1171 13021,1196 13035,1220 13056,1241 13080,1255 13105,1269 13133,1277 13162,1277 L 16012,1277 16012,1277 C 16041,1277 16069,1269 16094,1255 16118,1241 16139,1220 16153,1196 16167,1171 16175,1143 16175,1114 L 16175,462 16175,462 16175,462 C 16175,433 16167,405 16153,381 16139,356 16118,335 16094,321 16069,307 16041,299 16012,299 L 13162,299 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 13162,299 L 13162,299 C 13133,299 13105,307 13080,321 13056,335 13035,356 13021,381 13007,405 12999,433 12999,462 L 12999,1114 12999,1114 C 12999,1143 13007,1171 13021,1196 13035,1220 13056,1241 13080,1255 13105,1269 13133,1277 13162,1277 L 16012,1277 16012,1277 C 16041,1277 16069,1269 16094,1255 16118,1241 16139,1220 16153,1196 16167,1171 16175,1143 16175,1114 L 16175,462 16175,462 16175,462 C 16175,433 16167,405 16153,381 16139,356 16118,335 16094,321 16069,307 16041,299 16012,299 L 13162,299 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="388px" font-weight="700"><tspan class="TextPosition" x="13458" y="955"><tspan fill="rgb(51,51,51)" stroke="none" style="white-space: pre"></tspan><tspan fill="rgb(51,51,51)" stroke="none" style="white-space: pre">#” </tspan><tspan font-style="italic" font-weight="400" fill="rgb(51,51,51)" stroke="none" style="white-space: pre">fragment</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id5">
<rect class="BoundingBox" stroke="none" fill="none" x="9814" y="290" width="3196" height="997"/>
<path fill="rgb(255,220,255)" stroke="none" d="M 9987,299 L 9987,299 C 9958,299 9930,307 9906,321 9881,335 9860,356 9846,381 9832,405 9824,433 9824,462 L 9824,1114 9824,1114 C 9824,1143 9832,1171 9846,1196 9860,1220 9881,1241 9906,1255 9930,1269 9958,1277 9987,1277 L 12837,1277 12837,1277 C 12866,1277 12894,1269 12919,1255 12943,1241 12964,1220 12978,1196 12992,1171 13000,1143 13000,1114 L 13000,462 13000,462 13000,462 C 13000,433 12992,405 12978,381 12964,356 12943,335 12919,321 12894,307 12866,299 12837,299 L 9987,299 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 9987,299 L 9987,299 C 9958,299 9930,307 9906,321 9881,335 9860,356 9846,381 9832,405 9824,433 9824,462 L 9824,1114 9824,1114 C 9824,1143 9832,1171 9846,1196 9860,1220 9881,1241 9906,1255 9930,1269 9958,1277 9987,1277 L 12837,1277 12837,1277 C 12866,1277 12894,1269 12919,1255 12943,1241 12964,1220 12978,1196 12992,1171 13000,1143 13000,1114 L 13000,462 13000,462 13000,462 C 13000,433 12992,405 12978,381 12964,356 12943,335 12919,321 12894,307 12866,299 12837,299 L 9987,299 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="388px" font-weight="700"><tspan class="TextPosition" x="10556" y="955"><tspan fill="rgb(51,51,51)" stroke="none" style="white-space: pre"></tspan><tspan fill="rgb(51,51,51)" stroke="none" style="white-space: pre">?” </tspan><tspan font-style="italic" font-weight="400" fill="rgb(51,51,51)" stroke="none" style="white-space: pre">query</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id6">
<rect class="BoundingBox" stroke="none" fill="none" x="6640" y="290" width="3195" height="997"/>
<path fill="rgb(193,255,255)" stroke="none" d="M 6812,299 L 6812,299 C 6783,299 6755,307 6731,321 6706,335 6685,356 6671,381 6657,405 6649,433 6649,462 L 6649,1114 6649,1114 C 6649,1143 6657,1171 6671,1196 6685,1220 6706,1241 6731,1255 6755,1269 6783,1277 6812,1277 L 9662,1277 9662,1277 C 9691,1277 9719,1269 9744,1255 9768,1241 9789,1220 9803,1196 9817,1171 9825,1143 9825,1114 L 9825,462 9825,462 9825,462 C 9825,433 9817,405 9803,381 9789,356 9768,335 9744,321 9719,307 9691,299 9662,299 L 6812,299 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 6812,299 L 6812,299 C 6783,299 6755,307 6731,321 6706,335 6685,356 6671,381 6657,405 6649,433 6649,462 L 6649,1114 6649,1114 C 6649,1143 6657,1171 6671,1196 6685,1220 6706,1241 6731,1255 6755,1269 6783,1277 6812,1277 L 9662,1277 9662,1277 C 9691,1277 9719,1269 9744,1255 9768,1241 9789,1220 9803,1196 9817,1171 9825,1143 9825,1114 L 9825,462 9825,462 9825,462 C 9825,433 9817,405 9803,381 9789,356 9768,335 9744,321 9719,307 9691,299 9662,299 L 6812,299 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="388px" font-style="italic" font-weight="400"><tspan class="TextPosition" x="7858" y="955"><tspan fill="rgb(51,51,51)" stroke="none" style="white-space: pre">path</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id7">
<rect class="BoundingBox" stroke="none" fill="none" x="289" y="297" width="3196" height="998"/>
<path fill="rgb(255,255,177)" stroke="none" d="M 462,306 L 462,306 C 433,306 405,314 380,328 356,342 335,363 321,388 307,412 299,440 299,469 L 299,1121 299,1121 C 299,1150 307,1178 321,1203 335,1227 356,1248 381,1262 405,1276 433,1284 462,1284 L 3312,1284 3312,1284 C 3341,1284 3369,1276 3394,1262 3418,1248 3439,1227 3453,1203 3467,1178 3475,1150 3475,1121 L 3475,469 3475,469 3475,469 C 3475,440 3467,412 3453,387 3439,363 3418,342 3394,328 3369,314 3341,306 3312,306 L 462,306 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 462,306 L 462,306 C 433,306 405,314 380,328 356,342 335,363 321,388 307,412 299,440 299,469 L 299,1121 299,1121 C 299,1150 307,1178 321,1203 335,1227 356,1248 381,1262 405,1276 433,1284 462,1284 L 3312,1284 3312,1284 C 3341,1284 3369,1276 3394,1262 3418,1248 3439,1227 3453,1203 3467,1178 3475,1150 3475,1121 L 3475,469 3475,469 3475,469 C 3475,440 3467,412 3453,387 3439,363 3418,342 3394,328 3369,314 3341,306 3312,306 L 462,306 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="388px" font-style="italic" font-weight="400"><tspan class="TextPosition" x="890" y="962"><tspan fill="rgb(51,51,51)" stroke="none" style="white-space: pre">scheme</tspan><tspan font-style="normal" font-weight="700" fill="rgb(51,51,51)" stroke="none" style="white-space: pre"> “:”</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id8">
<rect class="BoundingBox" stroke="none" fill="none" x="3465" y="290" width="3196" height="997"/>
<path fill="rgb(215,255,195)" stroke="none" d="M 3637,299 L 3637,299 C 3608,299 3580,307 3555,321 3531,335 3510,356 3496,381 3482,405 3474,433 3474,462 L 3474,1114 3474,1114 C 3474,1143 3482,1171 3496,1196 3510,1220 3531,1241 3555,1255 3580,1269 3608,1277 3637,1277 L 6487,1277 6487,1277 C 6516,1277 6544,1269 6569,1255 6593,1241 6614,1220 6628,1196 6642,1171 6650,1143 6650,1114 L 6650,462 6650,462 6650,462 C 6650,433 6642,405 6628,381 6614,356 6593,335 6569,321 6544,307 6516,299 6487,299 L 3637,299 Z"/>
<path fill="none" stroke="rgb(0,0,0)" stroke-width="18" stroke-linejoin="round" d="M 3637,299 L 3637,299 C 3608,299 3580,307 3555,321 3531,335 3510,356 3496,381 3482,405 3474,433 3474,462 L 3474,1114 3474,1114 C 3474,1143 3482,1171 3496,1196 3510,1220 3531,1241 3555,1255 3580,1269 3608,1277 3637,1277 L 6487,1277 6487,1277 C 6516,1277 6544,1269 6569,1255 6593,1241 6614,1220 6628,1196 6642,1171 6650,1143 6650,1114 L 6650,462 6650,462 6650,462 C 6650,433 6642,405 6628,381 6614,356 6593,335 6569,321 6544,307 6516,299 6487,299 L 3637,299 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="388px" font-weight="700"><tspan class="TextPosition" x="3955" y="955"><tspan fill="rgb(51,51,51)" stroke="none" style="white-space: pre"></tspan><tspan fill="rgb(51,51,51)" stroke="none" style="white-space: pre">//” </tspan><tspan font-style="italic" font-weight="400" fill="rgb(51,51,51)" stroke="none" style="white-space: pre">authority</tspan></tspan></tspan></text>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

15
doc/modules/ROOT/nav.adoc Normal file
View File

@@ -0,0 +1,15 @@
* Tutorials
** xref:hello_world.adoc[Hello World]
** xref:multiple_dispatch.adoc[Multiple Dispatch]
** xref:headers_namespaces.adoc[Headers and Namespaces]
** xref:friendship.adoc[Friendship]
** xref:performance.adoc[Performance]
** xref:smart_pointers.adoc[Smart Pointers]
** xref:virtual_ptr_alt.adoc[Virtual Pointer Alternatives]
** xref:core_api.adoc[Core API]
** xref:policies.adoc[Registries and Policies]
** xref:error_handling.adoc[Error Handling]
** xref:custom_rtti.adoc[Custom RTTI]
** xref:dynamic_loading.adoc[Dynamic Loading]
* xref:reference:boost/openmethod.adoc[Reference (generated)]
* xref:reference.adoc[Reference (manual)]

View File

@@ -1,7 +1,5 @@
[#BOOST_OPENMETHOD]
## BOOST_OPENMETHOD
= BOOST_OPENMETHOD
### Synopsis

View File

@@ -13,7 +13,7 @@ BOOST_OPENMETHOD_CLASSES(CLASSES...[, POLICY]);
### Description
Register `CLASSES` in POLICY.
Registers `CLASSES` in POLICY.
NOTE: The default value for `POLICY` is the value of
`BOOST_OPENMETHOD_DEFAULT_REGISTRY` when `<boost/openmethod/core.hpp>` is

View File

@@ -29,7 +29,7 @@ name can get tedious, so OpenMethod provides a macro for that:
[source,c++]
----
include::{exampledir}/core_api.cpp[tag=method]
include::example$core_api.cpp[tag=method]
----
NOTE: BOOST_OPENMETHOD and associated macros use `BOOST_OPENMETHOD_ID` in
@@ -48,7 +48,7 @@ Overriders are ordinary functions, added to a method using the nested template
[source,c++]
----
include::{exampledir}/core_api.cpp[tag=poke_cat]
include::example$core_api.cpp[tag=poke_cat]
----
NOTE: `override` can register multiple overriders.
@@ -58,14 +58,14 @@ identifier. In the meantime, OpenMethod provides a small convenience macro:
[source,c++]
----
include::{exampledir}/core_api.cpp[tag=poke_dog]
include::example$core_api.cpp[tag=poke_dog]
----
`next` is available from the method's nested `next` template:
[source,c++]
----
include::{exampledir}/core_api.cpp[tag=poke_bulldog]
include::example$core_api.cpp[tag=poke_bulldog]
----
NOTE: Since the function uses itself as a template argument in its body, its
@@ -81,12 +81,12 @@ We register the classes with `use_classes`:
[source,c++]
----
include::{exampledir}/core_api.cpp[tag=use_classes]
include::example$core_api.cpp[tag=use_classes]
----
Finally, we call the method via the static member of the method class `fn`:
[source,c++]
----
include::{exampledir}/core_api.cpp[tag=main]
include::example$core_api.cpp[tag=main]
----

View File

@@ -1,38 +1,43 @@
## Custom RTTI
Stock policies use the `std_rtti` implementation of `rtti`. Here is its full
Stock registries use the `std_rtti` implementation of `rtti`. Here is its full
source:
[source,c++]
----
struct std_rtti : rtti {
template<class Class>
static constexpr auto is_polymorphic = std::is_polymorphic_v<Class>;
template<class Registry>
struct fn {
template<class Class>
static constexpr bool is_polymorphic = std::is_polymorphic_v<Class>;
template<typename T>
static type_id static_type() {
return reinterpret_cast<type_id>(&typeid(T));
}
template<class Class>
static auto static_type() -> type_id {
return &typeid(Class);
}
template<typename T>
static type_id dynamic_type(const T& obj) {
return reinterpret_cast<type_id>(&typeid(obj));
}
template<class Class>
static auto dynamic_type(const Class& obj) -> type_id {
return &typeid(obj);
}
template<class Stream>
static void type_name(type_id type, Stream& stream) {
stream << reinterpret_cast<const std::type_info*>(type)->name();
}
template<typename Stream>
static auto type_name(type_id type, Stream& stream) -> void {
stream << boost::core::demangle(
reinterpret_cast<const std::type_info*>(type)->name());
}
static std::type_index type_index(type_id type) {
return std::type_index(*reinterpret_cast<const std::type_info*>(type));
}
static auto type_index(type_id type) -> std::type_index {
return std::type_index(
*reinterpret_cast<const std::type_info*>(type));
}
template<typename D, typename B>
static D dynamic_cast_ref(B&& obj) {
return dynamic_cast<D>(obj);
}
template<typename D, typename B>
static auto dynamic_cast_ref(B&& obj) -> D {
return dynamic_cast<D>(obj);
}
};
};
----
@@ -45,7 +50,7 @@ struct std_rtti : rtti {
* `dynamic_type` is used to locate the v-table for an object. This function is
usually required. If only the `virtual_ptr` "final" constructs are used, or
if `boost_openmethod_vptr` is provided for all the classes in the policy, it
if `boost_openmethod_vptr` is provided for all the classes in the registry, it
can be omitted.
* `type_name` writes a representation of `type` to `stream`. It is used to format
@@ -93,78 +98,61 @@ This scheme has an interesting property: its type ids are monotonically
allocated in a small, dense range. Thus, we don't need to hash them. We can use
them as indexes in the table of vptrs.
This time we are going to replace the default policy globally. First we need to
define the custom RTTI facet. We must _not_ include
This time we are going to replace the default registry globally. First we need to
define the custom RTTI policy. We must _not_ include
`<boost/openmethod/core.hpp>` or any header that includes it yet.
Here is the facet implementation:
Here is the policy implementation:
[source,c++]
----
include::{exampledir}/custom_rtti.cpp[tag=facet]
include::example$custom_rtti.cpp[tag=policy]
----
This facet is quite minimal. It does not support virtual inheritance. It would
This policy is quite minimal. It does not support virtual inheritance. It would
not produce good error or trace messages, because types would be represented by
their integer ids.
This time we create a policy from scratch. For that we use the `basic_policy`
CRTP template:
This time we create a registry from scratch:
[source,c++]
----
include::{exampledir}/custom_rtti.cpp[tag=policy]
include::example$custom_rtti.cpp[tag=registry]
----
Next, we include the main header. Because `BOOST_OPENMETHOD_DEFAULT_REGISTRY` is
defined, its value is used for the default policy. Then comes the usual example.
defined, its value is used for the default registry. Then comes the usual example.
[source,c++]
----
include::{exampledir}/custom_rtti.cpp[tag=example]
include::example$custom_rtti.cpp[tag=example]
----
This programs works even if standard RTTI is disabled.
## Deferred RTTI
In the previous example, the RTTI system assigns types id statically. It is more
In the previous example, the RTTI system assigns type ids statically. It is more
common to allocate them using a global counter, manipulated by static
constructors. This is a problem, because `static_type` is used by class
registration. It may read the custom type ids _before_ they are have been
initialized.
The solution is to add the `deferred_static_rtti` facet to the policy; it defers
reading the type information until `initialize` is called.
This time let's support virtual inheritance as well. First the domain classes:
constructors. Like so:
[source,c++]
----
include::{exampledir}/deferred_custom_rtti.cpp[tag=classes]
include::example$deferred_custom_rtti.cpp[tag=classes]
// ditto for Dog
----
The rtti facet is the same, with one more function:
This is a problem, because `static_type` is used by class registration. It may
read the custom type ids _before_ they are have been initialized.
The solution is to derive the rtti policy from `deferred_static_rtti`. It defers
reading the type information until `initialize` is called.
This time let's support virtual inheritance as well.
[source,c++]
----
struct custom_rtti : bom::policies::rtti {
// as before
include::{exampledir}/deferred_custom_rtti.cpp[tag=dynamic_cast_ref]
};
----
Finally, the policy contains an additional facet - `deferred_static_rtti`:
[source,c++]
----
struct custom_policy
: bom::policies::basic_policy<
custom_policy, custom_rtti,
bom::policies::deferred_static_rtti, // <-- additional facet
bom::policies::vptr_vector<custom_policy>> {};
include::example$deferred_custom_rtti.cpp[tag=registry]
----
The example is the same as in the previous section.

View File

@@ -14,20 +14,20 @@ NOTE: This applies only to cases where a dynamic library adds to an _existing_
policy. Even if the dynamic library itself uses open-methods, for example as an
implementation detail, but it uses its own policy, there is no issue.
The solution is to use a policy that contains the `indirect_vptr` facet. Instead
The solution is to use a policy that contains the `indirect_vptr` policy. Instead
of storing the vptr directly, it stores a reference to the vptr.
Here is an example:
[source,c++]
----
include::{exampledir}/dl.hpp[tag=header]
include::example$dl.hpp[tag=header]
----
NOTE: The policy must be passed to the method as well as the
`virtual_ptr`{empty}s.
The `indirect_vptr` facet tells `virtual_ptr` to use a pointer to the vptr. Even
The `indirect_vptr` policy tells `virtual_ptr` to use a pointer to the vptr. Even
tough the value of the vptr changes when `initialize` is called, the vptrs are
stored in the same place (the policy's `static_vptr<Class>` variables).
@@ -35,7 +35,7 @@ We can now register the classes and and provide an overrider:
[source,c++]
----
include::{exampledir}/dl_main.cpp[tag=main]
include::example$dl_main.cpp[tag=main]
----
At this point we only have one overrider. Animals of all species ignore one
@@ -43,26 +43,26 @@ another:
[source,c++]
----
include::{exampledir}/dl_main.cpp[tag=before_dlopen]
include::example$dl_main.cpp[tag=before_dlopen]
----
Let's load a dynamic library containing this code:
[source,c++]
----
include::{exampledir}/dl_shared.cpp[tag=dl_shared]
include::example$dl_shared.cpp[tag=dl_shared]
----
Now back to `main`:
[source,c++]
----
include::{exampledir}/dl_main.cpp[tag=dlopen]
include::example$dl_main.cpp[tag=dlopen]
----
After unloading the library, we must call `initialize` again:
[source,c++]
----
include::{exampledir}/dl_main.cpp[tag=after_dlclose]
include::example$dl_main.cpp[tag=after_dlclose]
----

View File

@@ -2,17 +2,16 @@
## Error Handling
When an error is encountered, the program is terminated by a call to `abort`. If
the policy contains an `error_handler` facet, it provides an `error` member
the registry contains an `error_handler` policy, it provides an `error` member
function (or overloaded functions) to be called with an object identifying the
error. The `release` and `debug` policies implement the error facet with
error. `release_registry` and `debug_registry` implement the error policy with
`default_error_handler`, which wraps the error object in a variant, and calls a
handler via a `std::function`. By default, it prints a description of the error
to `stderr` in the `debug` policy, and does nothing in the `release` policy. The
handler can be set with `set_error_handler`:
to `stderr`, but this can be changed, for example, to throw an exception:
[source,c++]
----
include::{exampledir}/default_error_handler.cpp[tag=example]
include::example$default_error_handler.cpp[tag=example]
----
Output:
@@ -24,12 +23,12 @@ not implemented
spin
----
We can also replace the `error_handler` facet with our own. For example:
We can also replace the `error_handler` policy with our own. For example:
[source,c++]
----
include::{exampledir}/throw_error_handler.cpp[tag=example]
include::example$throw_error_handler.cpp[tag=example]
----
[source,console]
@@ -39,7 +38,7 @@ not implemented
spin
----
Stock facet `throw_error_handler` does this for all the exception types:
Stock policy `throw_error_handler` does this for all the error types:
```c++
namespace boost::openmethod::policies {

View File

@@ -17,7 +17,7 @@ We can thus grant friendship to all the overriders of `poke`:
[source,c++]
----
include::{exampledir}/friendship.cpp[tag=friend_all]
include::example$friendship.cpp[tag=friend_all]
----
Be aware, though, that the overriders of _any_ method called `poke` - with any
@@ -27,5 +27,5 @@ We can also befriend individual overriders:
[source,c++]
----
include::{exampledir}/friendship.cpp[tag=friend]
include::example$friendship.cpp[tag=friend]
----

View File

@@ -11,7 +11,7 @@ Let's break the Animals example into headers and namespaces. First we put
[source,c++]
----
include::{exampledir}/headers_namespaces/animal.hpp[]
include::example$headers_namespaces/animal.hpp[]
----
`BOOST_OPENMETHOD` can be placed in a header file. It adds several constructs to
@@ -32,19 +32,19 @@ Next, let's implement the `Cat` class, and a derived class, `Cheetah`, in the
[source,c++]
----
include::{exampledir}/headers_namespaces/cat.hpp[]
include::example$headers_namespaces/cat.hpp[]
----
[source,c++]
----
include::{exampledir}/headers_namespaces/cat.cpp[]
include::example$headers_namespaces/cat.cpp[]
----
`BOOST_OPENMETHOD_CLASSES` should be placed in an implementation file. It can
also go in a header file, but this wastes space, as the same registrar will be
created in every translation unit that includes the header. It doesn't matter
which namespace the macro is called in. It can take be used with any class name
in scope, or with qualified names.
which namespace the macro is called in. It can be used with any class name in
scope, or with qualified names.
`BOOST_OPENMETHOD_OVERRIDE` uses the guide function declared by
`BOOST_OPENMETHOD` to locate a method that can be called with the same arguments
@@ -83,7 +83,7 @@ the static function `fn` just yet.
[source,c++]
----
include::{exampledir}/headers_namespaces/dog.hpp[]
include::example$headers_namespaces/dog.hpp[]
----
Unlike function declarations, which can occur multiple times in a TU, an
@@ -101,15 +101,15 @@ Now we use `BOOST_OPENMETHOD_DEFINE_OVERRIDER` to define the overrider:
[source,c++]
----
include::{exampledir}/headers_namespaces/dog.cpp[]
include::example$headers_namespaces/dog.cpp[]
----
Let's look at the main program now. It derived `Bulldog` from `Dog` and provides
Let's look at the main program now. It derives `Bulldog` from `Dog` and provides
an overrider for the new class:
[source,c++]
----
include::{exampledir}/headers_namespaces/main.cpp[]
include::example$headers_namespaces/main.cpp[]
----
Again ADL plays a role: it helps the overrider (and `main`) to locate the `poke`

View File

@@ -1,3 +1,4 @@
:exampledir: ../example
## Hello World
@@ -6,7 +7,7 @@ functions:
[source,c++]
----
include::{exampledir}/virtual_func.cpp[tag=code]
include::example$virtual_func.cpp[tag=code]
----
We are going to rewrite this using open-methods.
@@ -15,7 +16,7 @@ First we remove the `poke` virtual functions from the domain classes:
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=domain_classes]
include::example$hello_world.cpp[tag=domain_classes]
----
Note that the Animal classes do not depend on iostreams anymore. This is a major
@@ -28,7 +29,7 @@ namespace.
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=method]
include::example$hello_world.cpp[tag=method]
----
This defines a free function called `poke`, which takes two arguments. The first
@@ -45,7 +46,7 @@ Let's add overriders for `Cat` and `Dog`:
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=overriders]
include::example$hello_world.cpp[tag=overriders]
----
`Bulldog::poke` calls the `poke` it overrides in its `Dog` base. The equivalent
@@ -55,7 +56,7 @@ been called if the overrider did not exist.
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=next]
include::example$hello_world.cpp[tag=next]
----
All classes involved in open-method calls need to be registered using the
@@ -63,7 +64,7 @@ All classes involved in open-method calls need to be registered using the
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=classes]
include::example$hello_world.cpp[tag=classes]
----
Classes can be registered incrementally, as long as all the direct bases of a
@@ -85,7 +86,7 @@ It builds the dispatch tables. Typically this is done in `main`:
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=main,indent=0]
include::example$hello_world.cpp[tag=main,indent=0]
----
We call `poke` like any ordinary function. We can pass it the animals by
@@ -94,5 +95,5 @@ reference, because `virtual_ptr` has a conversion constructor for that:
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=call]
include::example$hello_world.cpp[tag=call]
----

View File

@@ -0,0 +1,76 @@
//
// Copyright (c) 2025 Jean-Louis Leroy (jean-louis.leroy@gmail.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/openmethod
//
# Introduction
Open-methods are similar to virtual functions, but they are not required to be
members of a class. By being both free and virtual, tdoc/hello_world.adochey provide a solution to
the Expression Problem:
> Given a set of types, and a set of operations on these types, is it possible
to add new operations on the existing types, and new types to the existing
operations, without modifying existing code?
Open-methods also address the banana-gorilla-jungle problem:
> The problem with object-oriented languages is theyve got all this implicit
environment that they carry around with them. You wanted a banana but what you
got was a gorilla holding the banana and the entire jungle. — Joe Armstrong,
creator of Erlang progamming language
As a bonus, open-methods can take more than one argument into account when
selecting the appropriate function to call - aka multiple dispatch. For that
reason, open-methods are often called multi-methods, but that term is
misleading, as it suggests that the feature is useful only when multiple
dispatch is needed. In reality,
https://openaccess.wgtn.ac.nz/articles/thesis/Multiple_Dispatch_in_Practice/16959112/1[it
has been observed] that, in large systems written in languages that support
multi-methods, most methods use single-dispatch. The real benefit is in the
solution to the Expression Problem.
Open-methods were introduced by the Common Lisp Object System, and they are
native to many languages: Clojure, Julia, Dylan, TADS, Cecil, Diesel, Nice, etc.
Bjarne Stroustrup wanted open-methods in C++ almost from the beginning. In D&E
he writes:
> I repeatedly considered a mechanism for a virtual function call based on more
than one object, often called multi-methods. I rejected multi-methods with
regret because I liked the idea, but couldnt find an acceptable form under
which to accept it. [...] Multi-methods is one of the interesting what-ifs of
C++. Could I have designed and implemented them well enough at the time? Would
their applications have been important enough to warrant the effort? What other
work might have been left undone to provide the time to design and implement
multi-methods? Since about 1985, I have always felt some twinge of regret for
not providing multi-methods (Stroustrup, 1994, The Design and Evolution of
C{plus}{plus}, 13.8).
Circa 2007, he and his PhD students Peter Pirkelbauer and Yuriy Solodkyy wrote a
series of papers and a prototype implementation based on the EDG compiler.
Unfortunately, open-methods never made it into the standard. Stroustrup bemoans,
in a more recent paper:
> In retrospect, I dont think that the object-oriented notation (e.g., x.f(y))
should ever have been introduced. The traditional mathematical notation f(x,y)
is sufficient. As a side benefit, the mathematical notation would naturally have
given us multi-methods, thereby saving us from the visitor pattern workaround
(Stroustrup, 2020, Thriving in a Crowded and ChangingWorld: C++ 20062020).
This library implements the features described in the
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2216.pdf[N2216 paper],
with some extensions:
* a mechanism for calling the next most specialized overrider
* support for smart pointers
* customization points for RTTI, error handling, tracing, smart pointers...
Multiple and virtual inheritance are supported, with the exception of repeated
inheritance.

View File

@@ -5,12 +5,12 @@ A method can have more than one `virtual_ptr` parameter. For example:
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=multi]
include::example$hello_world.cpp[tag=multi]
----
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=multi_call,indent=0]
include::example$hello_world.cpp[tag=multi_call,indent=0]
----
The appropriate overrider is selected using a process similar to overload

View File

@@ -8,7 +8,7 @@ clang compiles the following code:
[source,c++]
----
include::{exampledir}/hello_world.cpp[tag=call_poke_via_ref]
include::example$hello_world.cpp[tag=call_poke_via_ref]
----
...to this on the x64 architecture (variable names have been shortened for
@@ -17,9 +17,9 @@ readability):
[source,asm]
----
mov rax, qword ptr [rsi]
mov rdx, qword ptr [rip + hash_mult]
mov rdx, qword ptr [rip + mult]
imul rdx, qword ptr [rax - 8]
movzx ecx, byte ptr [rip + hash_shift]
movzx ecx, byte ptr [rip + shift]
shr rdx, cl
mov rax, qword ptr [rip + vptrs]
mov rax, qword ptr [rax + 8*rdx]
@@ -48,7 +48,7 @@ Let's look at another example: an AST for an arithmetic calculator:
[source,c++]
----
include::{exampledir}/ast.cpp[tag=ast]
include::example$ast.cpp[tag=ast]
----
The `Negate` overrider compiles to:
@@ -79,7 +79,7 @@ instruction. For example:
[source,c++]
----
include::{exampledir}/ast.cpp[tag=final,indent=0]
include::example$ast.cpp[tag=final,indent=0]
----
...compiles to:

View File

@@ -0,0 +1,72 @@
## Registries and Policies
Methods are scoped in a registry. A method can only reference classes in the
same registry. If a class is used as a virtual parameter in methods using
different registries, it must be registered with each of them.
Class templates `use_classes`, `method`, `virtual_ptr`, and macros
`BOOST_OPENMETHOD` and `BOOST_OPENMETHOD_CLASSES`, accept an additional
argument, a registry class, which defaults to `default_registry`, which is an
alias to `release_registry` or `debug_registry`, depending on the value of
preprocessor symbols `NDEBUG`. The default registry can be overriden by defining
the macroprocessor symbol `BOOST_OPENMETHOD_DEFAULT_REGISTRY` _before_ including
`<boost/openmethod/core.hpp>`. The value of the symbol is used as a default
template parameter for `use_classes`, `method`, `virtual_ptr`, and others. Once
the `core` header has been included, changing
`BOOST_OPENMETHOD_DEFAULT_REGISTRY` has no effect.
A registry has a collection of _policies_. Each policy belongs to a policy
category. A policy may contain at most one policy of a given category. Policies
control how type information is obtained, how vptrs are fetched, how errors are
handled and printed, etc. Some are used in `initialize` and method dispatch;
some are used by other policies in the same registry as part of their
implementation. See the reference for the list of policies. Policies are placed
in the `boost::openmethod::policies` namespace.
`release_registry` contains the following policies:
[cols="1,1,1"]
|===
|policy category |policy |role
| rtti
| std_rtti
| provides type information for classes and objects
| vptr
| vptr_vector
| stores vptrs in an indexed collection
| type_hash
| fast_perfect_hash
| hash type id to an index in a vector
| error_handler
| default_error_handler
| handles errors
| output
| basic_error_output
| prints error descriptions to `stderr`
|===
`debug_registry` contains the same policies as `release_registry`, plus
`runtime_checks` and `trace`.
Registries can be created from scratch, using the `registry` template, or
constructed from existing registries, by adding and/or removing policies. For
example, `debug_registry` is a tweak of `release_registry`:
[source,c++]
----
struct release_registry
: registry<
policies::std_rtti, policies::fast_perfect_hash,
policies::vptr_vector, policies::default_error_handler,
policies::stderr_output> {};
struct debug_registry
: release_registry::with<policies::runtime_checks, policies::trace> {};
----

View File

@@ -0,0 +1,176 @@
[#boost-openmethod]
= xref:reference:reference.adoc[Reference]
:mrdocs:
== Macros
[cols=2]
|===
| Name
| Description
| xref:BOOST_OPENMETHOD.adoc[BOOST_OPENMETHOD]
| declares a method
| xref:BOOST_OPENMETHOD_CLASSES.adoc[BOOST_OPENMETHOD_CLASSES]
| registers classes
| xref:BOOST_OPENMETHOD_DECLARE_OVERRIDER.adoc[BOOST_OPENMETHOD_DECLARE_OVERRIDER]
| declares a method overrider
| xref:BOOST_OPENMETHOD_DEFAULT_REGISTRY.adoc[BOOST_OPENMETHOD_DEFAULT_REGISTRY]
| default registry
| xref:BOOST_OPENMETHOD_DEFINE_OVERRIDER.adoc[BOOST_OPENMETHOD_DEFINE_OVERRIDER]
| defines the body of a method overrider
| xref:BOOST_OPENMETHOD_ID.adoc[BOOST_OPENMETHOD_ID]
| generates a method id
| xref:BOOST_OPENMETHOD_INLINE_OVERRIDE.adoc[BOOST_OPENMETHOD_INLINE_OVERRIDE]
| adds an overrider to a method as an inline function
| xref:BOOST_OPENMETHOD_OVERRIDE.adoc[BOOST_OPENMETHOD_OVERRIDE]
| adds an overrider to a method
| xref:BOOST_OPENMETHOD_OVERRIDER.adoc[BOOST_OPENMETHOD_OVERRIDER]
| returns the class template specialization containing an overrider
| xref:BOOST_OPENMETHOD_OVERRIDERS.adoc[BOOST_OPENMETHOD_OVERRIDERS]
| returns the class template containing the overriders for all the methods with a given name
| xref:BOOST_OPENMETHOD_REGISTER.adoc[BOOST_OPENMETHOD_REGISTER]
| creates a static registrar object
|===
== Namespaces
[cols=1]
|===
| Name
| xref:reference:boost/openmethod/aliases.adoc[`aliases`]
| xref:reference:boost/openmethod/policies.adoc[`policies`]
|===
== Types
[cols=2]
|===
| Name
| Description
| xref:reference:boost/openmethod/ambiguous_error.adoc[`ambiguous&lowbar;error`]
|
| xref:reference:boost/openmethod/call_error.adoc[`call&lowbar;error`]
|
| xref:reference:boost/openmethod/compiler.adoc[`compiler`]
|
| xref:reference:boost/openmethod/debug_registry.adoc[`debug&lowbar;registry`]
|
| xref:reference:boost/openmethod/final_error.adoc[`final&lowbar;error`]
|
| xref:reference:boost/openmethod/hash_search_error.adoc[`hash&lowbar;search&lowbar;error`]
|
| xref:reference:boost/openmethod/inplace_vptr-0f.adoc[`inplace&lowbar;vptr`]
|
| xref:reference:boost/openmethod/inplace_vptr-0a.adoc[`inplace&lowbar;vptr&lt;Class&gt;`]
|
| xref:reference:boost/openmethod/inplace_vptr-00.adoc[`inplace&lowbar;vptr&lt;Class, Other&gt;`]
|
| xref:reference:boost/openmethod/inplace_vptr-02.adoc[`inplace&lowbar;vptr&lt;Class, Base1, Base2, MoreBases&period;&period;&period;&gt;`]
|
| xref:reference:boost/openmethod/method-0d8.adoc[`method`]
|
| xref:reference:boost/openmethod/method-0db.adoc[`method&lt;Name, ReturnType(Parameters&period;&period;&period;), Registry&gt;`]
|
| xref:reference:boost/openmethod/not_implemented_error.adoc[`not&lowbar;implemented&lowbar;error`]
|
| xref:reference:boost/openmethod/not_initialized_error.adoc[`not&lowbar;initialized&lowbar;error`]
|
| xref:reference:boost/openmethod/openmethod_error.adoc[`openmethod&lowbar;error`]
|
| xref:reference:boost/openmethod/registry-07.adoc[`registry`]
|
| xref:reference:boost/openmethod/release_registry.adoc[`release&lowbar;registry`]
|
| xref:reference:boost/openmethod/static_offset_error.adoc[`static&lowbar;offset&lowbar;error`]
|
| xref:reference:boost/openmethod/static_slot_error.adoc[`static&lowbar;slot&lowbar;error`]
|
| xref:reference:boost/openmethod/static_stride_error.adoc[`static&lowbar;stride&lowbar;error`]
|
| xref:reference:boost/openmethod/unknown_class_error.adoc[`unknown&lowbar;class&lowbar;error`]
|
| xref:reference:boost/openmethod/use_classes.adoc[`use&lowbar;classes`]
|
| xref:reference:boost/openmethod/virtual_.adoc[`virtual&lowbar;`]
|
| xref:reference:boost/openmethod/virtual_ptr-0a.adoc[`virtual&lowbar;ptr`]
| A wide pointer combining a pointer to an object and a pointer to its v&hyphen;table&period;
| xref:reference:boost/openmethod/virtual_ptr-02.adoc[`virtual&lowbar;ptr&lt;Class, Registry&gt;`]
|
| xref:reference:boost/openmethod/virtual_traits-0be.adoc[`virtual&lowbar;traits`]
|
| xref:reference:boost/openmethod/virtual_traits-043.adoc[`virtual&lowbar;traits&lt;std::shared&lowbar;ptr&lt;Class&gt;, Registry&gt;`]
|
| xref:reference:boost/openmethod/virtual_traits-0bf.adoc[`virtual&lowbar;traits&lt;std::unique&lowbar;ptr&lt;Class&gt;, Registry&gt;`]
|
| xref:reference:boost/openmethod/virtual_traits-096.adoc[`virtual&lowbar;traits&lt;virtual&lowbar;ptr&lt;Class, Registry&gt;, Registry&gt;`]
|
| xref:reference:boost/openmethod/virtual_traits-08.adoc[`virtual&lowbar;traits&lt;T&, Registry&gt;`]
|
| xref:reference:boost/openmethod/virtual_traits-07a.adoc[`virtual&lowbar;traits&lt;std::shared&lowbar;ptr&lt;Class&gt; const&, Registry&gt;`]
|
| xref:reference:boost/openmethod/virtual_traits-048.adoc[`virtual&lowbar;traits&lt;virtual&lowbar;ptr&lt;Class, Registry&gt; const&, Registry&gt;`]
|
| xref:reference:boost/openmethod/virtual_traits-098.adoc[`virtual&lowbar;traits&lt;T&&, Registry&gt;`]
|
| xref:reference:boost/openmethod/virtual_traits-071.adoc[`virtual&lowbar;traits&lt;T*, Registry&gt;`]
|
| xref:reference:boost/openmethod/default_registry.adoc[`default&lowbar;registry`]
|
| xref:reference:boost/openmethod/shared_virtual_ptr.adoc[`shared&lowbar;virtual&lowbar;ptr`]
|
| xref:reference:boost/openmethod/type_id.adoc[`type&lowbar;id`]
|
| xref:reference:boost/openmethod/unique_virtual_ptr.adoc[`unique&lowbar;virtual&lowbar;ptr`]
|
| xref:reference:boost/openmethod/vptr_type.adoc[`vptr&lowbar;type`]
|
|===
== Functions
[cols=2]
|===
| Name
| Description
| xref:reference:boost/openmethod/boost_openmethod_vptr-02.adoc[`boost&lowbar;openmethod&lowbar;vptr`]
|
| xref:reference:boost/openmethod/final_virtual_ptr-04.adoc[`final&lowbar;virtual&lowbar;ptr`]
|
| xref:reference:boost/openmethod/finalize.adoc[`finalize`]
|
| xref:reference:boost/openmethod/initialize.adoc[`initialize`]
|
| xref:reference:boost/openmethod/make_shared_virtual.adoc[`make&lowbar;shared&lowbar;virtual`]
|
| xref:reference:boost/openmethod/make_unique_virtual.adoc[`make&lowbar;unique&lowbar;virtual`]
|
| xref:reference:boost/openmethod/operator_eq.adoc[`operator&equals;&equals;`]
| Equality operator
| xref:reference:boost/openmethod/operator_not_eq.adoc[`operator!&equals;`]
| Inequality operator
|===
== Variables
[cols=1]
|===
| Name
| xref:reference:boost/openmethod/is_method.adoc[`is&lowbar;method`]
| xref:reference:boost/openmethod/is_polymorphic.adoc[`is&lowbar;polymorphic`]
| xref:reference:boost/openmethod/is_smart_ptr.adoc[`is&lowbar;smart&lowbar;ptr`]
| xref:reference:boost/openmethod/same_smart_ptr.adoc[`same&lowbar;smart&lowbar;ptr`]
|===
== Deduction Guides
[cols=1]
|===
| Name
| xref:reference:boost/openmethod/virtual_ptr-0f.adoc[`virtual&lowbar;ptr&lt;Class, boost::openmethod::default&lowbar;registry&gt;`]
| xref:reference:boost/openmethod/virtual_ptr-0b.adoc[`virtual&lowbar;ptr&lt;Class, boost::openmethod::default&lowbar;registry&gt;`]
|===
[.small]#Created with https://www.mrdocs.com[MrDocs]#

View File

@@ -11,11 +11,11 @@ smart virtual_ptr to it. Since the exact type of the object is known, the vptr
is read from a static variable, without incuring the cost of a hash table
lookup.
Here is a variaton of the AST example that uses dynamic allocation and unique
Here is a variation of the AST example that uses dynamic allocation and unique
pointers:
[source,c++]
----
include::{exampledir}/ast_unique_ptr.cpp[tag=ast,indent=0]
include::example$ast_unique_ptr.cpp[tag=ast,indent=0]
----

View File

@@ -9,7 +9,7 @@ For example, the `poke` open-method in the Animals example can be rewritten as:
[source,c++]
----
include::{exampledir}/virtual_.cpp[tag=virtual_parameter,indent=0]
include::example$virtual_.cpp[tag=virtual_parameter,indent=0]
int main() {
boost::openmethod::initialize();
@@ -39,7 +39,7 @@ native virtual functions:
[source,c++]
----
include::{exampledir}/virtual_.cpp[tag=virtual_intrusive,indent=0]
include::example$virtual_.cpp[tag=virtual_intrusive,indent=0]
int main() {
boost::openmethod::initialize();
@@ -58,7 +58,7 @@ vptrs.
[source,c++]
----
include::{exampledir}/virtual_.cpp[tag=inplace_vptr,indent=0]
include::example$virtual_.cpp[tag=inplace_vptr,indent=0]
int main() {
boost::openmethod::initialize();

63
doc/mrdocs.yml Normal file
View File

@@ -0,0 +1,63 @@
# Input
source-root: ..
# Directories that contain documented source files
input:
- ../include
# Patterns to filter out the source-files in the directories
file-patterns:
- '*.hpp'
# exclude:
# - '../boost/libs/test'
# - '../include/boost/test/impl'
# Filters
include-symbols:
- 'boost::openmethod::**'
# see-below:
# - 'boost::urls::format_arg'
# implementation-defined:
# - 'boost::openmethod::detail::**'
exclude-symbols:
- 'boost::openmethod::detail::**'
- 'boost::openmethod::boost_openmethod_bases'
- 'boost::openmethod::boost_openmethod_registry'
sort-members: false
extract-friends: false
implementation-detail: impl
inherit-base-members: never
# Metadata Extraction
private-bases: false
# Generator
generate: adoc
base-url: https://www.github.com/boostorg/openmethod/blob/develop/
# Style
verbose: true
multipage: true
# The target for MrDocs simply includes all symbols defined in all
# headers with the appropriate compilation options.
# Nothing else should be included in the MrDocs configuration or
# would be useful to MrDocs.
#
# This single source file not only includes all symbols (the source
# files do not collectively include all headers) but also makes MrDocs
# run much faster than relying on the entire library.
#
# The time to extract the declarations went from ~8m6s to ~3s in our
# experiments: a 162x speedup while including all symbols!
#
# In practice, this special target is simply emulating the
# default behavior of the standardese tool with MrDocs, which
# requires the user to clearly specify the targets via the
# compilation database.
#
# The BOOST_OPENMETHOD_MRDOCS_BUILD=ON is the only option we usually need
# here.
# The other options are set just to ensure other targets are
# ignored even if these options are set as ON in the cache.
#
cmake: '-DCMAKE_VERBOSE_MAKEFILE=ON -D BOOST_OPENMETHOD_MRDOCS_BUILD=ON -D CMAKE_CXX_STANDARD=20 -D BOOST_OPENMETHOD_BUILD_EXAMPLES=OFF -D BOOST_OPENMETHOD_BUILD_TESTS=OFF -D BUILD_TESTING=OFF'

View File

@@ -19,7 +19,7 @@ struct basic_error_output : output {
### Description
`basic_error_output` is an implementation of `output` that writes error
messages to a `RestrictedOutputStream`.
messages to a `LightweightOutputStream`.
### Members

View File

@@ -67,7 +67,7 @@ macros:
* Include `<boost/openmethod/core.hpp>`and `<boost/openmethod/macros.hpp>`.
#### <boost/openmethod/compiler.hpp>
#### <boost/openmethod/initialize.hpp>
Provides `intialize` and `finalize`. Typically included only by the translation
unit that contains `main`, unless dynamic loading is used in other places in the
@@ -96,49 +96,49 @@ an alias to either `debug` or `release`, depending on the value of the
preprocessor symbol `NDEBUG`.
Usually not included directly. Can be used to create custom policies from stock
policies, by forking them and adjusting a few facets.
policies, by forking them and adjusting a few policys.
#### <boost/openmethod/policies/basic_policy.hpp>
Provides the constructs used in the policy framework, essentially
`basic_policy`, `facet`, and its abstract subclasses (`rtti`, `extern_vptr`,
`basic_policy`, `policy`, and its abstract subclasses (`rtti`, `extern_vptr`,
etc).
#### <boost/openmethod/policies/std_rtti.hpp>
Implements the `rtti` facet using standard RTTI.
Implements the `rtti` policy using standard RTTI.
#### <boost/openmethod/policies/minimal_rtti.hpp>
Implements the `rtti` facet using a minimal RTTI implementation. Can be used only with the "final" constructs, or with intrusive v-table pointers.
Implements the `rtti` policy using a minimal RTTI implementation. Can be used only with the "final" constructs, or with intrusive v-table pointers.
#### <boost/openmethod/policies/vptr_vector.hpp>
Implements the `extern_vptr` facet using a vector of pointers.
Implements the `extern_vptr` policy using a vector of pointers.
#### <boost/openmethod/policies/vptr_map.hpp>
Implements the `extern_vptr` facet using a map of pointers.
Implements the `extern_vptr` policy using a map of pointers.
#### <boost/openmethod/policies/fast_perfect_hash.hpp>
Implements the `type_hash` facet using a perfect hash function.
Implements the `type_hash` policy using a perfect hash function.
#### <boost/openmethod/policies/default_error_handler.hpp>
Implements the `error_handler` facet by routing the error through a
Implements the `error_handler` policy by routing the error through a
`std::function`.
#### <boost/openmethod/policies/throw_error_handler.hpp>
Implements the `error_handler` facet by throwing an exception.
Implements the `error_handler` policy by throwing an exception.
#### <boost/openmethod/policies/basic_error_output.hpp>
Implements the `output` facet using a lightweight version of
Implements the `output` policy using a lightweight version of
`std::ostream`.
#### <boost/openmethod/policies/basic_trace_output.hpp>
Implements the `trace` facet using a lightweight version of
Implements the `trace` policy using a lightweight version of
`std::ostream`.

2938
doc/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

15
doc/package.json Normal file
View File

@@ -0,0 +1,15 @@
{
"devDependencies": {
"@antora/cli": "3.1.3",
"@antora/site-generator": "3.1.3",
"antora": "3.1.3"
},
"dependencies": {
"@cppalliance/antora-cpp-reference-extension": "^0.0.6",
"@cppalliance/antora-cpp-tagfiles-extension": "^0.0.4",
"@cppalliance/asciidoctor-boost-links": "^0.0.2",
"@antora/expand-path-helper": "^2.0.0",
"@antora/lunr-extension": "^1.0.0-alpha.8",
"@asciidoctor/tabs": "^1.0.0-beta.3"
}
}

View File

@@ -1,91 +0,0 @@
## Policies and Facets
Methods and classes are scoped in a policy. A method can only reference classes
registered in the same policy. If a class is used as a virtual parameter in
methods using different policies, it must be registered with each of them.
Class templates `use_classes`, `method`, `virtual_ptr`, and macros
`BOOST_OPENMETHOD` and `BOOST_OPENMETHOD_CLASSES`, accept an additional
argument, a policy class, which defaults to `policies::debug` in debug builds,
and `policies::release` in release builds.
A policy has a collection of _facets_. Each facet belongs to a facet category. A
policy may contain at most one facet of a given category. Facets control how
type information is obtained, how vptrs are fetched, how errors are handled and
printed, etc. Some are used in `initialize` and method dispatch; some are used
by other facets in the same policy as part of their implementation. See the
reference for the list of facets. Policies and facets are placed in the
`boost::openmethod::policies` namespace. Two stock policies are provided by the
library: `release` and `debug`.
The `release` policy contains the following facets:
[cols="1,1,1"]
|===
|facet category |facet |role
| rtti
| std_rtti
| provides type information for classes and objects
| extern_vptr
| vptr_vector
| stores vptrs in an indexed collection
| type_hash
| fast_perfect_hash
| hash type id to an index in a vector
| error_handler
| default_error_handler
| handles errors
|===
The `debug` policy contains the same facets as `release`, plus a few more:
[cols="1,1,1"]
|===
|facet category |facet |role
| runtime_checks
| (itself)
| enables runtime checks
| output
| basic_error_output
| prints error descriptions to `stderr`
| trace
| basic_trace_output
| enables `initialize` to print information about dispatch table construction to `stderr`
|===
Policies, and some facets, have static variables. When it is the case, they are
implemented as CRTP classes.
Policies can be created from scratch, using the `basic_policy` template, or
constructed from existing policies by adding and removing facets. For example,
`policies::debug` is a tweak of `policies::release`:
[source,c++]
----
namespace boost::openmethod::policies {
struct debug : release::fork<debug>::with<
runtime_checks, basic_error_output<debug>,
basic_trace_output<debug>> {};
}
----
`boost::openmethod::default_registry` is an alias to `release` or `debug`,
depending on the value of preprocessor symbols `NDEBUG`. The default policy can
be overriden by defining the macroprocessor symbol
`BOOST_OPENMETHOD_DEFAULT_REGISTRY` _before_ including
`<boost/openmethod/core.hpp>`. The value of the symbol is used as a default
template parameter for `use_classes`, `method`, `virtual_ptr`, and others. Once
the `core` header has been included, changing `BOOST_OPENMETHOD_DEFAULT_REGISTRY`
has no effect.

View File

@@ -1,48 +0,0 @@
# Reference
:toc:
:toc-title:
:idprefix: ref_
include::overview.adoc[]
include::BOOST_OPENMETHOD.adoc[]
include::BOOST_OPENMETHOD_OVERRIDE.adoc[]
include::BOOST_OPENMETHOD_INLINE_OVERRIDE.adoc[]
include::BOOST_OPENMETHOD_DECLARE_OVERRIDER.adoc[]
include::BOOST_OPENMETHOD_DEFINE_OVERRIDER.adoc[]
include::BOOST_OPENMETHOD_OVERRIDER.adoc[]
include::BOOST_OPENMETHOD_ID.adoc[]
include::BOOST_OPENMETHOD_GUIDE.adoc[]
include::BOOST_OPENMETHOD_OVERRIDERS.adoc[]
include::BOOST_OPENMETHOD_REGISTER.adoc[]
include::BOOST_OPENMETHOD_CLASSES.adoc[]
include::BOOST_OPENMETHOD_DEFAULT_REGISTRY.adoc[]
include::initialize.adoc[]
include::typedefs.adoc[]
include::method.adoc[]
include::method_override.adoc[]
include::virtual_ptr.adoc[]
include::virtual_traits.adoc[]
include::use_classes.adoc[]
include::virtual_.adoc[]
include::inplace_vptr.adoc[]
include::abstract_policy.adoc[]
include::domain.adoc[]
include::basic_policy.adoc[]
include::facet.adoc[]
include::rtti.adoc[]
include::std_rtti.adoc[]
include::deferred_static_rtti.adoc[]
include::minimal_rtti.adoc[]
include::vptr.adoc[]
include::vptr_vector.adoc[]
include::vptr_map.adoc[]
include::type_hash.adoc[]
include::error_handler.adoc[]
include::default_error_handler.adoc[]
include::throw_error_handler.adoc[]
include::output.adoc[]
include::trace.adoc[]
include::restricted_output_stream.adoc[]

View File

@@ -1,9 +1,9 @@
## RestrictedOutputStream
## LightweightOutputStream
### Description
RestrictedOutputStream is a concept describing a `std::ostream`-like class with
LightweightOutputStream is a concept describing a `std::ostream`-like class with
a reduced set of operations.
While convenient, `std::ostream` and its implementations constitute a sizeable
@@ -11,7 +11,7 @@ piece of code, which may make it unsuitable for certain applications. OpenMethod
uses a small subset of the operations supported by `std::ostream`. By default,
the library uses a lightweight implementation based on the C stream functions.
Implementations of `RestrictedOutputStream` provide the following functions:
Implementations of `LightweightOutputStream` provide the following functions:
[cols="a,a", options="header"]
@@ -20,16 +20,16 @@ Implementations of `RestrictedOutputStream` provide the following functions:
| Name
| Description
| RestrictedOutputStream& operator<<(RestrictedOutputStream& os, const char* str)
| LightweightOutputStream& operator<<(LightweightOutputStream& os, const char* str)
| Write a null-terminated string `str` to `os`
| RestrictedOutputStream& operator<<(RestrictedOutputStream& os, const std::string_view& view)
| LightweightOutputStream& operator<<(LightweightOutputStream& os, const std::string_view& view)
| Write a view to `os
| RestrictedOutputStream& operator<<(RestrictedOutputStream& os, const void* value)
| LightweightOutputStream& operator<<(LightweightOutputStream& os, const void* value)
| Write a representation of a pointer to `os`
| RestrictedOutputStream& operator<<(RestrictedOutputStream& os, std::size_t value)
| LightweightOutputStream& operator<<(LightweightOutputStream& os, std::size_t value)
| Write an unsigned integer to `os`
|===

View File

@@ -8,14 +8,14 @@ Defined in <boost/openmethod/policies/basic_policy.hpp>.
```c++
namespace boost::openmethod::policies {
struct rtti : facet {};
struct rtti : policy {};
} // boost::openmethod::policies
```
### Description
The `rtti` facet provides type information for classes and objects, implements
The `rtti` policy provides type information for classes and objects, implements
downcast in presence of virtual inheritance, and writes descriptions of types to
an `ostream`-like object.
@@ -24,8 +24,7 @@ an `ostream`-like object.
#### is_polymorphic
```c++
template<class Class>
static constexpr bool is_polymorphic;
template<class Class> static constexpr bool is_polymorphic;
```
`true` if `Class` is polymorphic.
@@ -33,8 +32,7 @@ static constexpr bool is_polymorphic;
#### static_type
```c++
template<class Class>
static auto static_type() -> type_id;
template<class Class> static auto static_type() -> type_id;
```
Returns a `type_id` for `Class`.
@@ -42,8 +40,7 @@ Returns a `type_id` for `Class`.
#### dynamic_type
```c++
template<class Class>
static auto dynamic_type(const Class& obj) -> type_id;
template<class Class> static auto dynamic_type(const Class& obj) -> type_id;
```
Returns a `type_id` for an object's dynamic type.

View File

@@ -29,7 +29,7 @@ struct std_rtti : rtti {
### Description
`std_rtti` is an implementation of the `rtti` facet that uses standard RTTI.
`std_rtti` is an implementation of the `rtti` policy that uses standard RTTI.
### Members

Some files were not shown because too many files have changed in this diff Show More