Merge lp:~saviq/unity/phablet.drop-unity-api into lp:unity/phablet

Proposed by Michał Sawicz
Status: Merged
Approved by: Michael Zanetti
Approved revision: no longer in the source branch.
Merged at revision: 730
Proposed branch: lp:~saviq/unity/phablet.drop-unity-api
Merge into: lp:unity/phablet
Diff against target: 7762 lines (+0/-7328)
67 files modified
CMakeLists.txt (+0/-63)
CTestCustom.cmake.in (+0/-16)
debian/control (+0/-25)
debian/libunity-api-dev.install (+0/-3)
debian/libunity-api-doc.install (+0/-1)
debian/libunity-api.install (+0/-1)
doc/Doxyfile.in (+0/-1826)
include/CMakeLists.txt (+0/-4)
include/unity/CMakeLists.txt (+0/-10)
include/unity/Exception.h (+0/-158)
include/unity/UnityExceptions.h (+0/-258)
include/unity/api/CMakeLists.txt (+0/-12)
include/unity/api/Version.h.in (+0/-103)
include/unity/config.h (+0/-30)
include/unity/internal/ExceptionImpl.h (+0/-60)
include/unity/internal/UnityExceptionsImpl.h (+0/-95)
include/unity/scopes/CMakeLists.txt (+0/-6)
include/unity/util/CMakeLists.txt (+0/-6)
include/unity/util/Daemon.h (+0/-129)
include/unity/util/DefinesPtrs.h (+0/-89)
include/unity/util/FileIO.h (+0/-40)
include/unity/util/NonCopyable.h (+0/-89)
include/unity/util/internal/DaemonImpl.h (+0/-67)
include/unity/util/internal/ResourcePtr.h (+0/-793)
src/CMakeLists.txt (+0/-14)
src/libunity-api.pc.in (+0/-23)
src/unity/CMakeLists.txt (+0/-10)
src/unity/Exception.cpp (+0/-145)
src/unity/UnityExceptions.cpp (+0/-246)
src/unity/api/CMakeLists.txt (+0/-8)
src/unity/api/Version.cpp (+0/-59)
src/unity/api/internal/CMakeLists.txt (+0/-4)
src/unity/api/scopes/CMakeLists.txt (+0/-6)
src/unity/api/scopes/internal/CMakeLists.txt (+0/-4)
src/unity/internal/CMakeLists.txt (+0/-6)
src/unity/internal/ExceptionImpl.cpp (+0/-244)
src/unity/internal/UnityExceptionsImpl.cpp (+0/-126)
src/unity/util/CMakeLists.txt (+0/-8)
src/unity/util/Daemon.cpp (+0/-89)
src/unity/util/FileIO.cpp (+0/-106)
src/unity/util/internal/CMakeLists.txt (+0/-5)
src/unity/util/internal/DaemonImpl.cpp (+0/-271)
tests/CMakeLists.txt (+0/-3)
tests/cleanincludes/CMakeLists.txt (+0/-2)
tests/cleanincludes/includechecker.py (+0/-74)
tests/gtest/CMakeLists.txt (+0/-18)
tests/gtest/libgtest/CMakeLists.txt (+0/-13)
tests/gtest/unity/CMakeLists.txt (+0/-8)
tests/gtest/unity/Exceptions_test.cpp (+0/-536)
tests/gtest/unity/api/CMakeLists.txt (+0/-1)
tests/gtest/unity/api/Version/CMakeLists.txt (+0/-4)
tests/gtest/unity/api/Version/Version_test.cpp (+0/-31)
tests/gtest/unity/util/CMakeLists.txt (+0/-4)
tests/gtest/unity/util/Daemon/CMakeLists.txt (+0/-4)
tests/gtest/unity/util/Daemon/Daemon_test.cpp (+0/-353)
tests/gtest/unity/util/Daemon/daemon-tester.py (+0/-57)
tests/gtest/unity/util/DefinesPtrs/CMakeLists.txt (+0/-4)
tests/gtest/unity/util/DefinesPtrs/DefinesPtrs_test.cpp (+0/-45)
tests/gtest/unity/util/FileIO/CMakeLists.txt (+0/-4)
tests/gtest/unity/util/FileIO/FileIO_test.cpp (+0/-71)
tests/gtest/unity/util/internal/CMakeLists.txt (+0/-1)
tests/gtest/unity/util/internal/ResourcePtr/CMakeLists.txt (+0/-4)
tests/gtest/unity/util/internal/ResourcePtr/ResourcePtr_test.cpp (+0/-529)
tests/headers/CMakeLists.txt (+0/-34)
tests/headers/check_public_headers.py (+0/-99)
tests/headers/compile_headers.py (+0/-158)
valgrind-suppress (+0/-13)
To merge this branch: bzr merge lp:~saviq/unity/phablet.drop-unity-api
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+166019@code.launchpad.net

Commit message

drop unity-api parts that have been split away to lp:unity-api

Description of the change

The unity-api parts were split away to lp:unity-api.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

looks good to me and makes it saucy :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-05-28 09:06:22 +0000
+++ CMakeLists.txt 2013-06-04 09:01:26 +0000
@@ -47,29 +47,11 @@
47add_custom_target(cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=247add_custom_target(cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2
48 ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)48 ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)
4949
50#
51# Definitions for testing with valgrind.
52#
53
54configure_file(CTestCustom.cmake.in CTestCustom.cmake) # Tests in CTestCustom.cmake are skipped for valgrind
55
56find_program(MEMORYCHECK_COMMAND NAMES valgrind)
57if (MEMORYCHECK_COMMAND)
58 set(MEMORYCHECK_COMMAND_OPTIONS
59 "--suppressions=${CMAKE_SOURCE_DIR}/valgrind-suppress --leak-check=full --num-callers=40 --error-exitcode=3"
60 )
61 add_custom_target(valgrind DEPENDS NightlyMemCheck)
62else()
63 message(WARNING "Cannot find valgrind: valgrind target will not be available")
64endif()
65
66
67include(FindPkgConfig)50include(FindPkgConfig)
68find_package(Qt5Qml)51find_package(Qt5Qml)
69find_package(Qt5Quick)52find_package(Qt5Quick)
70find_package(Qt5Gui)53find_package(Qt5Gui)
71find_package(Qt5DBus)54find_package(Qt5DBus)
72find_package(Boost 1.49.0 COMPONENTS regex REQUIRED)
7355
74# Standard install paths56# Standard install paths
75include(GNUInstallDirs)57include(GNUInstallDirs)
@@ -80,17 +62,10 @@
8062
81include_directories(63include_directories(
82 ${CMAKE_CURRENT_BINARY_DIR}64 ${CMAKE_CURRENT_BINARY_DIR}
83 ${CMAKE_CURRENT_BINARY_DIR}/include
84 ${CMAKE_CURRENT_SOURCE_DIR}65 ${CMAKE_CURRENT_SOURCE_DIR}
85 ${CMAKE_CURRENT_SOURCE_DIR}/include
86 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}66 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
87 )67 )
8868
89# When building the library, we set the default symbol visibility
90# to "hidden", so we don't export things by default.
91# Exported functions and classes are prefixed by a UNITY_API macro,
92# which explicitly exports a symbol if UNITY_DLL_EXPORTS is defined.
93add_definitions(-DUNITY_DLL_EXPORTS)
94set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")69set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
9570
96set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra")71set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra")
@@ -109,21 +84,6 @@
109# "signals" and "slots"84# "signals" and "slots"
110add_definitions(-DQT_NO_KEYWORDS)85add_definitions(-DQT_NO_KEYWORDS)
11186
112# API version
113set(UNITY_API_MAJOR 0)
114set(UNITY_API_MINOR 1)
115set(UNITY_API_MICRO 0)
116set(UNITY_API_VERSION "${UNITY_API_MAJOR}.${UNITY_API_MINOR}.${UNITY_API_MICRO}")
117
118# API library
119set(UNITY_API_LIB unity-api)
120
121# Other libraries we depend on
122set(OTHER_API_LIBS )
123
124# All the libraries we need to link a normal executable that uses the Unity API
125set(LIBS ${UNITY_API_LIB} ${OTHER_API_LIBS})
126
127# Tests87# Tests
128include(CTest)88include(CTest)
129enable_testing()89enable_testing()
@@ -171,9 +131,7 @@
171 )131 )
172132
173# add subdirectories to build133# add subdirectories to build
174add_subdirectory(include)
175add_subdirectory(plugins)134add_subdirectory(plugins)
176add_subdirectory(src)
177135
178# install subdirectories136# install subdirectories
179set(QML_DIRS137set(QML_DIRS
@@ -203,27 +161,6 @@
203 )161 )
204162
205#163#
206# Documentation
207#
208
209find_package(Doxygen)
210find_program(DOT_EXECUTABLE dot /usr/bin)
211if (NOT DOXYGEN_FOUND OR NOT DOT_EXECUTABLE)
212 message(WARNING "Cannot generate documentation: doxygen and/or graphviz not found")
213else()
214 configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY IMMEDIATE)
215 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/lib${UNITY_API_LIB}/index.html
216 COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/Doxyfile
217 DEPENDS ${PROJECT_BINARY_DIR}/doc/Doxyfile
218 ${UNITY_API_LIB_SRC}
219 ${UNITY_API_LIB_HDRS})
220 add_custom_target(doc ALL
221 DEPENDS ${PROJECT_BINARY_DIR}/doc/lib${UNITY_API_LIB}/index.html)
222 install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/lib${UNITY_API_LIB}
223 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc)
224endif()
225
226#
227# Translation164# Translation
228#165#
229add_subdirectory(po)166add_subdirectory(po)
230167
=== removed file 'CTestCustom.cmake.in'
--- CTestCustom.cmake.in 2013-04-16 02:37:02 +0000
+++ CTestCustom.cmake.in 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
1#
2# Tests listed here will not be run by the valgrind target.
3#
4
5SET(CTEST_CUSTOM_MEMCHECK_IGNORE
6 cleanincludes
7 testAnimationControllerWithSignals
8 testCarousel
9 testClock
10 testCrossFadeImage
11 testIndicatorItem
12 testMathLocal
13 testRatingStars
14 testSideStage
15 testTimeLocal
16 whitespace)
170
=== modified file 'debian/control'
--- debian/control 2013-05-31 00:55:24 +0000
+++ debian/control 2013-06-04 09:01:26 +0000
@@ -4,16 +4,11 @@
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5Build-Depends: cmake,5Build-Depends: cmake,
6 debhelper (>= 9),6 debhelper (>= 9),
7 doxygen,
8 graphviz,
9 libboost-regex1.49-dev (>= 1.49),
10 libboost1.49-dev (>= 1.49),
11 libc6-dev,7 libc6-dev,
12 libdee-qt5-dev (>= 3.0),8 libdee-qt5-dev (>= 3.0),
13 libgl1-mesa-dev[!armhf] | libgl-dev[!armhf],9 libgl1-mesa-dev[!armhf] | libgl-dev[!armhf],
14 libgl1-mesa-dri,10 libgl1-mesa-dri,
15 libgles2-mesa-dev[armhf],11 libgles2-mesa-dev[armhf],
16 libgtest-dev,
17 libhud-client2-dev,12 libhud-client2-dev,
18 libpulse-dev,13 libpulse-dev,
19 libunity-core-6.0-dev,14 libunity-core-6.0-dev,
@@ -74,23 +69,3 @@
74 ${shlibs:Depends},69 ${shlibs:Depends},
75Description: Test package for the shell70Description: Test package for the shell
76 Autopilot tests for the qml-phone-shell package71 Autopilot tests for the qml-phone-shell package
77
78Package: libunity-api
79Architecture: all
80Depends: ${misc:Depends}, ${shlibs:Depends}
81Description: API for shell integration
82 Library to integrate with the Unity shell
83
84Package: libunity-api-dev
85Architecture: all
86Depends: libboost1.49-dev (>= 1.49),
87 libunity-api (= ${binary:Version}),
88 ${misc:Depends},
89Description: Header files for Unity API
90 Library to integrate with the Unity shell (dev files)
91
92Package: libunity-api-doc
93Architecture: all
94Depends: ${misc:Depends}
95Description: Documentation for Unity API
96 Library to integrate with the Unity shell (documentation)
9772
=== removed file 'debian/libunity-api-dev.install'
--- debian/libunity-api-dev.install 2013-04-19 01:18:29 +0000
+++ debian/libunity-api-dev.install 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1usr/include/unity/*
2usr/lib/libunity-api.so
3usr/lib/pkgconfig/libunity-api.pc
40
=== removed file 'debian/libunity-api-doc.install'
--- debian/libunity-api-doc.install 2013-04-19 01:18:29 +0000
+++ debian/libunity-api-doc.install 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1usr/share/doc/libunity-api/*
20
=== removed file 'debian/libunity-api.install'
--- debian/libunity-api.install 2013-04-09 03:34:17 +0000
+++ debian/libunity-api.install 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1usr/lib/libunity-api.so.*
20
=== removed file 'doc/Doxyfile.in'
--- doc/Doxyfile.in 2013-04-19 01:05:08 +0000
+++ doc/Doxyfile.in 1970-01-01 00:00:00 +0000
@@ -1,1826 +0,0 @@
1# Doxyfile 1.8.1.2
2
3# This file describes the settings to be used by the documentation system
4# doxygen (www.doxygen.org) for a project
5#
6# All text after a hash (#) is considered a comment and will be ignored
7# The format is:
8# TAG = value [value, ...]
9# For lists items can also be appended using:
10# TAG += value [value, ...]
11# Values that contain spaces should be placed between quotes (" ")
12
13#---------------------------------------------------------------------------
14# Project related configuration options
15#---------------------------------------------------------------------------
16
17# This tag specifies the encoding used for all characters in the config file
18# that follow. The default is UTF-8 which is also the encoding used for all
19# text before the first occurrence of this tag. Doxygen uses libiconv (or the
20# iconv built into libc) for the transcoding. See
21# http://www.gnu.org/software/libiconv for the list of possible encodings.
22
23DOXYFILE_ENCODING = UTF-8
24
25# The PROJECT_NAME tag is a single word (or sequence of words) that should
26# identify the project. Note that if you do not use Doxywizard you need
27# to put quotes around the project name if it contains spaces.
28
29PROJECT_NAME = "My Project"
30
31# The PROJECT_NUMBER tag can be used to enter a project or revision number.
32# This could be handy for archiving the generated documentation or
33# if some version control system is used.
34
35PROJECT_NUMBER =
36
37# Using the PROJECT_BRIEF tag one can provide an optional one line description
38# for a project that appears at the top of each page and should give viewer
39# a quick idea about the purpose of the project. Keep the description short.
40
41PROJECT_BRIEF =
42
43# With the PROJECT_LOGO tag one can specify an logo or icon that is
44# included in the documentation. The maximum height of the logo should not
45# exceed 55 pixels and the maximum width should not exceed 200 pixels.
46# Doxygen will copy the logo to the output directory.
47
48PROJECT_LOGO =
49
50# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
51# base path where the generated documentation will be put.
52# If a relative path is entered, it will be relative to the location
53# where doxygen was started. If left blank the current directory will be used.
54
55OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/doc
56
57# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
58# 4096 sub-directories (in 2 levels) under the output directory of each output
59# format and will distribute the generated files over these directories.
60# Enabling this option can be useful when feeding doxygen a huge amount of
61# source files, where putting all generated files in the same directory would
62# otherwise cause performance problems for the file system.
63
64CREATE_SUBDIRS = NO
65
66# The OUTPUT_LANGUAGE tag is used to specify the language in which all
67# documentation generated by doxygen is written. Doxygen will use this
68# information to generate all constant output in the proper language.
69# The default language is English, other supported languages are:
70# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
71# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
72# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
73# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
74# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
75# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
76
77OUTPUT_LANGUAGE = English
78
79# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
80# include brief member descriptions after the members that are listed in
81# the file and class documentation (similar to JavaDoc).
82# Set to NO to disable this.
83
84BRIEF_MEMBER_DESC = YES
85
86# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
87# the brief description of a member or function before the detailed description.
88# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
89# brief descriptions will be completely suppressed.
90
91REPEAT_BRIEF = YES
92
93# This tag implements a quasi-intelligent brief description abbreviator
94# that is used to form the text in various listings. Each string
95# in this list, if found as the leading text of the brief description, will be
96# stripped from the text and the result after processing the whole list, is
97# used as the annotated text. Otherwise, the brief description is used as-is.
98# If left blank, the following values are used ("$name" is automatically
99# replaced with the name of the entity): "The $name class" "The $name widget"
100# "The $name file" "is" "provides" "specifies" "contains"
101# "represents" "a" "an" "the"
102
103ABBREVIATE_BRIEF = "The $name class" \
104 "The $name widget" \
105 "The $name file" \
106 is \
107 provides \
108 specifies \
109 contains \
110 represents \
111 a \
112 an \
113 the
114
115# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
116# Doxygen will generate a detailed section even if there is only a brief
117# description.
118
119ALWAYS_DETAILED_SEC = NO
120
121# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
122# inherited members of a class in the documentation of that class as if those
123# members were ordinary class members. Constructors, destructors and assignment
124# operators of the base classes will not be shown.
125
126INLINE_INHERITED_MEMB = NO
127
128# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
129# path before files name in the file list and in the header files. If set
130# to NO the shortest path that makes the file name unique will be used.
131
132FULL_PATH_NAMES = YES
133
134# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
135# can be used to strip a user-defined part of the path. Stripping is
136# only done if one of the specified strings matches the left-hand part of
137# the path. The tag can be used to show relative paths in the file list.
138# If left blank the directory from which doxygen is run is used as the
139# path to strip.
140
141STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@
142
143# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
144# the path mentioned in the documentation of a class, which tells
145# the reader which header file to include in order to use a class.
146# If left blank only the name of the header file containing the class
147# definition is used. Otherwise one should specify the include paths that
148# are normally passed to the compiler using the -I flag.
149
150STRIP_FROM_INC_PATH = @PROJECT_SOURCE_DIR@/include @PROJECT_BINARY_DIR@/include
151
152# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
153# (but less readable) file names. This can be useful if your file system
154# doesn't support long names like on DOS, Mac, or CD-ROM.
155
156SHORT_NAMES = NO
157
158# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
159# will interpret the first line (until the first dot) of a JavaDoc-style
160# comment as the brief description. If set to NO, the JavaDoc
161# comments will behave just like regular Qt-style comments
162# (thus requiring an explicit @brief command for a brief description.)
163
164JAVADOC_AUTOBRIEF = NO
165
166# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
167# interpret the first line (until the first dot) of a Qt-style
168# comment as the brief description. If set to NO, the comments
169# will behave just like regular Qt-style comments (thus requiring
170# an explicit \brief command for a brief description.)
171
172QT_AUTOBRIEF = NO
173
174# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
175# treat a multi-line C++ special comment block (i.e. a block of //! or ///
176# comments) as a brief description. This used to be the default behaviour.
177# The new default is to treat a multi-line C++ comment block as a detailed
178# description. Set this tag to YES if you prefer the old behaviour instead.
179
180MULTILINE_CPP_IS_BRIEF = NO
181
182# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
183# member inherits the documentation from any documented member that it
184# re-implements.
185
186INHERIT_DOCS = YES
187
188# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
189# a new page for each member. If set to NO, the documentation of a member will
190# be part of the file/class/namespace that contains it.
191
192SEPARATE_MEMBER_PAGES = NO
193
194# The TAB_SIZE tag can be used to set the number of spaces in a tab.
195# Doxygen uses this value to replace tabs by spaces in code fragments.
196
197TAB_SIZE = 8
198
199# This tag can be used to specify a number of aliases that acts
200# as commands in the documentation. An alias has the form "name=value".
201# For example adding "sideeffect=\par Side Effects:\n" will allow you to
202# put the command \sideeffect (or @sideeffect) in the documentation, which
203# will result in a user-defined paragraph with heading "Side Effects:".
204# You can put \n's in the value part of an alias to insert newlines.
205
206ALIASES =
207
208# This tag can be used to specify a number of word-keyword mappings (TCL only).
209# A mapping has the form "name=value". For example adding
210# "class=itcl::class" will allow you to use the command class in the
211# itcl::class meaning.
212
213TCL_SUBST =
214
215# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
216# sources only. Doxygen will then generate output that is more tailored for C.
217# For instance, some of the names that are used will be different. The list
218# of all members will be omitted, etc.
219
220OPTIMIZE_OUTPUT_FOR_C = NO
221
222# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
223# sources only. Doxygen will then generate output that is more tailored for
224# Java. For instance, namespaces will be presented as packages, qualified
225# scopes will look different, etc.
226
227OPTIMIZE_OUTPUT_JAVA = NO
228
229# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
230# sources only. Doxygen will then generate output that is more tailored for
231# Fortran.
232
233OPTIMIZE_FOR_FORTRAN = NO
234
235# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
236# sources. Doxygen will then generate output that is tailored for
237# VHDL.
238
239OPTIMIZE_OUTPUT_VHDL = NO
240
241# Doxygen selects the parser to use depending on the extension of the files it
242# parses. With this tag you can assign which parser to use for a given extension.
243# Doxygen has a built-in mapping, but you can override or extend it using this
244# tag. The format is ext=language, where ext is a file extension, and language
245# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
246# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
247# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
248# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
249# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
250
251EXTENSION_MAPPING =
252
253# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
254# comments according to the Markdown format, which allows for more readable
255# documentation. See http://daringfireball.net/projects/markdown/ for details.
256# The output of markdown processing is further processed by doxygen, so you
257# can mix doxygen, HTML, and XML commands with Markdown formatting.
258# Disable only in case of backward compatibilities issues.
259
260MARKDOWN_SUPPORT = YES
261
262# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
263# to include (a tag file for) the STL sources as input, then you should
264# set this tag to YES in order to let doxygen match functions declarations and
265# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
266# func(std::string) {}). This also makes the inheritance and collaboration
267# diagrams that involve STL classes more complete and accurate.
268
269BUILTIN_STL_SUPPORT = NO
270
271# If you use Microsoft's C++/CLI language, you should set this option to YES to
272# enable parsing support.
273
274CPP_CLI_SUPPORT = NO
275
276# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
277# Doxygen will parse them like normal C++ but will assume all classes use public
278# instead of private inheritance when no explicit protection keyword is present.
279
280SIP_SUPPORT = NO
281
282# For Microsoft's IDL there are propget and propput attributes to indicate getter
283# and setter methods for a property. Setting this option to YES (the default)
284# will make doxygen replace the get and set methods by a property in the
285# documentation. This will only work if the methods are indeed getting or
286# setting a simple type. If this is not the case, or you want to show the
287# methods anyway, you should set this option to NO.
288
289IDL_PROPERTY_SUPPORT = YES
290
291# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
292# tag is set to YES, then doxygen will reuse the documentation of the first
293# member in the group (if any) for the other members of the group. By default
294# all members of a group must be documented explicitly.
295
296DISTRIBUTE_GROUP_DOC = NO
297
298# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
299# the same type (for instance a group of public functions) to be put as a
300# subgroup of that type (e.g. under the Public Functions section). Set it to
301# NO to prevent subgrouping. Alternatively, this can be done per class using
302# the \nosubgrouping command.
303
304SUBGROUPING = YES
305
306# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
307# unions are shown inside the group in which they are included (e.g. using
308# @ingroup) instead of on a separate page (for HTML and Man pages) or
309# section (for LaTeX and RTF).
310
311INLINE_GROUPED_CLASSES = NO
312
313# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
314# unions with only public data fields will be shown inline in the documentation
315# of the scope in which they are defined (i.e. file, namespace, or group
316# documentation), provided this scope is documented. If set to NO (the default),
317# structs, classes, and unions are shown on a separate page (for HTML and Man
318# pages) or section (for LaTeX and RTF).
319
320INLINE_SIMPLE_STRUCTS = NO
321
322# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
323# is documented as struct, union, or enum with the name of the typedef. So
324# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
325# with name TypeT. When disabled the typedef will appear as a member of a file,
326# namespace, or class. And the struct will be named TypeS. This can typically
327# be useful for C code in case the coding convention dictates that all compound
328# types are typedef'ed and only the typedef is referenced, never the tag name.
329
330TYPEDEF_HIDES_STRUCT = NO
331
332# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
333# determine which symbols to keep in memory and which to flush to disk.
334# When the cache is full, less often used symbols will be written to disk.
335# For small to medium size projects (<1000 input files) the default value is
336# probably good enough. For larger projects a too small cache size can cause
337# doxygen to be busy swapping symbols to and from disk most of the time
338# causing a significant performance penalty.
339# If the system has enough physical memory increasing the cache will improve the
340# performance by keeping more symbols in memory. Note that the value works on
341# a logarithmic scale so increasing the size by one will roughly double the
342# memory usage. The cache size is given by this formula:
343# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
344# corresponding to a cache size of 2^16 = 65536 symbols.
345
346SYMBOL_CACHE_SIZE = 0
347
348# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
349# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
350# their name and scope. Since this can be an expensive process and often the
351# same symbol appear multiple times in the code, doxygen keeps a cache of
352# pre-resolved symbols. If the cache is too small doxygen will become slower.
353# If the cache is too large, memory is wasted. The cache size is given by this
354# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
355# corresponding to a cache size of 2^16 = 65536 symbols.
356
357LOOKUP_CACHE_SIZE = 0
358
359#---------------------------------------------------------------------------
360# Build related configuration options
361#---------------------------------------------------------------------------
362
363# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
364# documentation are documented, even if no documentation was available.
365# Private class members and static file members will be hidden unless
366# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
367
368EXTRACT_ALL = NO
369
370# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
371# will be included in the documentation.
372
373EXTRACT_PRIVATE = NO
374
375# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
376# scope will be included in the documentation.
377
378EXTRACT_PACKAGE = NO
379
380# If the EXTRACT_STATIC tag is set to YES all static members of a file
381# will be included in the documentation.
382
383EXTRACT_STATIC = NO
384
385# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
386# defined locally in source files will be included in the documentation.
387# If set to NO only classes defined in header files are included.
388
389EXTRACT_LOCAL_CLASSES = YES
390
391# This flag is only useful for Objective-C code. When set to YES local
392# methods, which are defined in the implementation section but not in
393# the interface are included in the documentation.
394# If set to NO (the default) only methods in the interface are included.
395
396EXTRACT_LOCAL_METHODS = NO
397
398# If this flag is set to YES, the members of anonymous namespaces will be
399# extracted and appear in the documentation as a namespace called
400# 'anonymous_namespace{file}', where file will be replaced with the base
401# name of the file that contains the anonymous namespace. By default
402# anonymous namespaces are hidden.
403
404EXTRACT_ANON_NSPACES = NO
405
406# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
407# undocumented members of documented classes, files or namespaces.
408# If set to NO (the default) these members will be included in the
409# various overviews, but no documentation section is generated.
410# This option has no effect if EXTRACT_ALL is enabled.
411
412HIDE_UNDOC_MEMBERS = NO
413
414# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
415# undocumented classes that are normally visible in the class hierarchy.
416# If set to NO (the default) these classes will be included in the various
417# overviews. This option has no effect if EXTRACT_ALL is enabled.
418
419HIDE_UNDOC_CLASSES = NO
420
421# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
422# friend (class|struct|union) declarations.
423# If set to NO (the default) these declarations will be included in the
424# documentation.
425
426HIDE_FRIEND_COMPOUNDS = NO
427
428# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
429# documentation blocks found inside the body of a function.
430# If set to NO (the default) these blocks will be appended to the
431# function's detailed documentation block.
432
433HIDE_IN_BODY_DOCS = NO
434
435# The INTERNAL_DOCS tag determines if documentation
436# that is typed after a \internal command is included. If the tag is set
437# to NO (the default) then the documentation will be excluded.
438# Set it to YES to include the internal documentation.
439
440INTERNAL_DOCS = NO
441
442# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
443# file names in lower-case letters. If set to YES upper-case letters are also
444# allowed. This is useful if you have classes or files whose names only differ
445# in case and if your file system supports case sensitive file names. Windows
446# and Mac users are advised to set this option to NO.
447
448CASE_SENSE_NAMES = NO
449
450# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
451# will show members with their full class and namespace scopes in the
452# documentation. If set to YES the scope will be hidden.
453
454HIDE_SCOPE_NAMES = NO
455
456# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
457# will put a list of the files that are included by a file in the documentation
458# of that file.
459
460SHOW_INCLUDE_FILES = YES
461
462# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
463# will list include files with double quotes in the documentation
464# rather than with sharp brackets.
465
466FORCE_LOCAL_INCLUDES = NO
467
468# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
469# is inserted in the documentation for inline members.
470
471INLINE_INFO = YES
472
473# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
474# will sort the (detailed) documentation of file and class members
475# alphabetically by member name. If set to NO the members will appear in
476# declaration order.
477
478SORT_MEMBER_DOCS = YES
479
480# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
481# brief documentation of file, namespace and class members alphabetically
482# by member name. If set to NO (the default) the members will appear in
483# declaration order.
484
485SORT_BRIEF_DOCS = NO
486
487# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
488# will sort the (brief and detailed) documentation of class members so that
489# constructors and destructors are listed first. If set to NO (the default)
490# the constructors will appear in the respective orders defined by
491# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
492# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
493# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
494
495SORT_MEMBERS_CTORS_1ST = NO
496
497# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
498# hierarchy of group names into alphabetical order. If set to NO (the default)
499# the group names will appear in their defined order.
500
501SORT_GROUP_NAMES = NO
502
503# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
504# sorted by fully-qualified names, including namespaces. If set to
505# NO (the default), the class list will be sorted only by class name,
506# not including the namespace part.
507# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
508# Note: This option applies only to the class list, not to the
509# alphabetical list.
510
511SORT_BY_SCOPE_NAME = NO
512
513# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
514# do proper type resolution of all parameters of a function it will reject a
515# match between the prototype and the implementation of a member function even
516# if there is only one candidate or it is obvious which candidate to choose
517# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
518# will still accept a match between prototype and implementation in such cases.
519
520STRICT_PROTO_MATCHING = NO
521
522# The GENERATE_TODOLIST tag can be used to enable (YES) or
523# disable (NO) the todo list. This list is created by putting \todo
524# commands in the documentation.
525
526GENERATE_TODOLIST = YES
527
528# The GENERATE_TESTLIST tag can be used to enable (YES) or
529# disable (NO) the test list. This list is created by putting \test
530# commands in the documentation.
531
532GENERATE_TESTLIST = YES
533
534# The GENERATE_BUGLIST tag can be used to enable (YES) or
535# disable (NO) the bug list. This list is created by putting \bug
536# commands in the documentation.
537
538GENERATE_BUGLIST = YES
539
540# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
541# disable (NO) the deprecated list. This list is created by putting
542# \deprecated commands in the documentation.
543
544GENERATE_DEPRECATEDLIST= YES
545
546# The ENABLED_SECTIONS tag can be used to enable conditional
547# documentation sections, marked by \if sectionname ... \endif.
548
549ENABLED_SECTIONS =
550
551# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
552# the initial value of a variable or macro consists of for it to appear in
553# the documentation. If the initializer consists of more lines than specified
554# here it will be hidden. Use a value of 0 to hide initializers completely.
555# The appearance of the initializer of individual variables and macros in the
556# documentation can be controlled using \showinitializer or \hideinitializer
557# command in the documentation regardless of this setting.
558
559MAX_INITIALIZER_LINES = 30
560
561# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
562# at the bottom of the documentation of classes and structs. If set to YES the
563# list will mention the files that were used to generate the documentation.
564
565SHOW_USED_FILES = YES
566
567# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
568# This will remove the Files entry from the Quick Index and from the
569# Folder Tree View (if specified). The default is YES.
570
571SHOW_FILES = YES
572
573# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
574# Namespaces page. This will remove the Namespaces entry from the Quick Index
575# and from the Folder Tree View (if specified). The default is YES.
576
577SHOW_NAMESPACES = YES
578
579# The FILE_VERSION_FILTER tag can be used to specify a program or script that
580# doxygen should invoke to get the current version for each file (typically from
581# the version control system). Doxygen will invoke the program by executing (via
582# popen()) the command <command> <input-file>, where <command> is the value of
583# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
584# provided by doxygen. Whatever the program writes to standard output
585# is used as the file version. See the manual for examples.
586
587FILE_VERSION_FILTER =
588
589# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
590# by doxygen. The layout file controls the global structure of the generated
591# output files in an output format independent way. To create the layout file
592# that represents doxygen's defaults, run doxygen with the -l option.
593# You can optionally specify a file name after the option, if omitted
594# DoxygenLayout.xml will be used as the name of the layout file.
595
596LAYOUT_FILE =
597
598# The CITE_BIB_FILES tag can be used to specify one or more bib files
599# containing the references data. This must be a list of .bib files. The
600# .bib extension is automatically appended if omitted. Using this command
601# requires the bibtex tool to be installed. See also
602# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
603# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
604# feature you need bibtex and perl available in the search path.
605
606CITE_BIB_FILES =
607
608#---------------------------------------------------------------------------
609# configuration options related to warning and progress messages
610#---------------------------------------------------------------------------
611
612# The QUIET tag can be used to turn on/off the messages that are generated
613# by doxygen. Possible values are YES and NO. If left blank NO is used.
614
615QUIET = YES
616
617# The WARNINGS tag can be used to turn on/off the warning messages that are
618# generated by doxygen. Possible values are YES and NO. If left blank
619# NO is used.
620
621WARNINGS = YES
622
623# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
624# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
625# automatically be disabled.
626
627WARN_IF_UNDOCUMENTED = YES
628
629# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
630# potential errors in the documentation, such as not documenting some
631# parameters in a documented function, or documenting parameters that
632# don't exist or using markup commands wrongly.
633
634WARN_IF_DOC_ERROR = YES
635
636# The WARN_NO_PARAMDOC option can be enabled to get warnings for
637# functions that are documented, but have no documentation for their parameters
638# or return value. If set to NO (the default) doxygen will only warn about
639# wrong or incomplete parameter documentation, but not about the absence of
640# documentation.
641
642WARN_NO_PARAMDOC = NO
643
644# The WARN_FORMAT tag determines the format of the warning messages that
645# doxygen can produce. The string should contain the $file, $line, and $text
646# tags, which will be replaced by the file and line number from which the
647# warning originated and the warning text. Optionally the format may contain
648# $version, which will be replaced by the version of the file (if it could
649# be obtained via FILE_VERSION_FILTER)
650
651WARN_FORMAT = "$file:$line: $text"
652
653# The WARN_LOGFILE tag can be used to specify a file to which warning
654# and error messages should be written. If left blank the output is written
655# to stderr.
656
657WARN_LOGFILE =
658
659#---------------------------------------------------------------------------
660# configuration options related to the input files
661#---------------------------------------------------------------------------
662
663# The INPUT tag can be used to specify the files and/or directories that contain
664# documented source files. You may enter file names like "myfile.cpp" or
665# directories like "/usr/src/myproject". Separate the files or directories
666# with spaces.
667
668INPUT = @PROJECT_BINARY_DIR@/include @PROJECT_SOURCE_DIR@/include @PROJECT_SOURCE_DIR@/src
669
670# This tag can be used to specify the character encoding of the source files
671# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
672# also the default input encoding. Doxygen uses libiconv (or the iconv built
673# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
674# the list of possible encodings.
675
676INPUT_ENCODING = UTF-8
677
678# If the value of the INPUT tag contains directories, you can use the
679# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
680# and *.h) to filter out the source-files in the directories. If left
681# blank the following patterns are tested:
682# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
683# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
684# *.f90 *.f *.for *.vhd *.vhdl
685
686FILE_PATTERNS = *.c \
687 *.cc \
688 *.cxx \
689 *.cpp \
690 *.c++ \
691 *.d \
692 *.java \
693 *.ii \
694 *.ixx \
695 *.ipp \
696 *.i++ \
697 *.inl \
698 *.h \
699 *.hh \
700 *.hxx \
701 *.hpp \
702 *.h++ \
703 *.idl \
704 *.odl \
705 *.cs \
706 *.php \
707 *.php3 \
708 *.inc \
709 *.m \
710 *.markdown \
711 *.md \
712 *.mm \
713 *.dox \
714 *.py \
715 *.f90 \
716 *.f \
717 *.for \
718 *.vhd \
719 *.vhdl
720
721# The RECURSIVE tag can be used to turn specify whether or not subdirectories
722# should be searched for input files as well. Possible values are YES and NO.
723# If left blank NO is used.
724
725RECURSIVE = YES
726
727# The EXCLUDE tag can be used to specify files and/or directories that should be
728# excluded from the INPUT source files. This way you can easily exclude a
729# subdirectory from a directory tree whose root is specified with the INPUT tag.
730# Note that relative paths are relative to the directory from which doxygen is
731# run.
732
733EXCLUDE =
734
735# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
736# directories that are symbolic links (a Unix file system feature) are excluded
737# from the input.
738
739EXCLUDE_SYMLINKS = NO
740
741# If the value of the INPUT tag contains directories, you can use the
742# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
743# certain files from those directories. Note that the wildcards are matched
744# against the file with absolute path, so to exclude all test directories
745# for example use the pattern */test/*
746
747EXCLUDE_PATTERNS = */internal/*
748
749# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
750# (namespaces, classes, functions, etc.) that should be excluded from the
751# output. The symbol name can be a fully qualified name, a word, or if the
752# wildcard * is used, a substring. Examples: ANamespace, AClass,
753# AClass::ANamespace, ANamespace::*Test
754
755EXCLUDE_SYMBOLS =
756
757# The EXAMPLE_PATH tag can be used to specify one or more files or
758# directories that contain example code fragments that are included (see
759# the \include command).
760
761EXAMPLE_PATH =
762
763# If the value of the EXAMPLE_PATH tag contains directories, you can use the
764# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
765# and *.h) to filter out the source-files in the directories. If left
766# blank all files are included.
767
768EXAMPLE_PATTERNS = *
769
770# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
771# searched for input files to be used with the \include or \dontinclude
772# commands irrespective of the value of the RECURSIVE tag.
773# Possible values are YES and NO. If left blank NO is used.
774
775EXAMPLE_RECURSIVE = NO
776
777# The IMAGE_PATH tag can be used to specify one or more files or
778# directories that contain image that are included in the documentation (see
779# the \image command).
780
781IMAGE_PATH =
782
783# The INPUT_FILTER tag can be used to specify a program that doxygen should
784# invoke to filter for each input file. Doxygen will invoke the filter program
785# by executing (via popen()) the command <filter> <input-file>, where <filter>
786# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
787# input file. Doxygen will then use the output that the filter program writes
788# to standard output. If FILTER_PATTERNS is specified, this tag will be
789# ignored.
790
791INPUT_FILTER =
792
793# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
794# basis. Doxygen will compare the file name with each pattern and apply the
795# filter if there is a match. The filters are a list of the form:
796# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
797# info on how filters are used. If FILTER_PATTERNS is empty or if
798# non of the patterns match the file name, INPUT_FILTER is applied.
799
800FILTER_PATTERNS =
801
802# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
803# INPUT_FILTER) will be used to filter the input files when producing source
804# files to browse (i.e. when SOURCE_BROWSER is set to YES).
805
806FILTER_SOURCE_FILES = NO
807
808# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
809# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
810# and it is also possible to disable source filtering for a specific pattern
811# using *.ext= (so without naming a filter). This option only has effect when
812# FILTER_SOURCE_FILES is enabled.
813
814FILTER_SOURCE_PATTERNS =
815
816#---------------------------------------------------------------------------
817# configuration options related to source browsing
818#---------------------------------------------------------------------------
819
820# If the SOURCE_BROWSER tag is set to YES then a list of source files will
821# be generated. Documented entities will be cross-referenced with these sources.
822# Note: To get rid of all source code in the generated output, make sure also
823# VERBATIM_HEADERS is set to NO.
824
825SOURCE_BROWSER = NO
826
827# Setting the INLINE_SOURCES tag to YES will include the body
828# of functions and classes directly in the documentation.
829
830INLINE_SOURCES = NO
831
832# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
833# doxygen to hide any special comment blocks from generated source code
834# fragments. Normal C, C++ and Fortran comments will always remain visible.
835
836STRIP_CODE_COMMENTS = YES
837
838# If the REFERENCED_BY_RELATION tag is set to YES
839# then for each documented function all documented
840# functions referencing it will be listed.
841
842REFERENCED_BY_RELATION = NO
843
844# If the REFERENCES_RELATION tag is set to YES
845# then for each documented function all documented entities
846# called/used by that function will be listed.
847
848REFERENCES_RELATION = NO
849
850# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
851# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
852# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
853# link to the source code. Otherwise they will link to the documentation.
854
855REFERENCES_LINK_SOURCE = YES
856
857# If the USE_HTAGS tag is set to YES then the references to source code
858# will point to the HTML generated by the htags(1) tool instead of doxygen
859# built-in source browser. The htags tool is part of GNU's global source
860# tagging system (see http://www.gnu.org/software/global/global.html). You
861# will need version 4.8.6 or higher.
862
863USE_HTAGS = NO
864
865# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
866# will generate a verbatim copy of the header file for each class for
867# which an include is specified. Set to NO to disable this.
868
869VERBATIM_HEADERS = YES
870
871#---------------------------------------------------------------------------
872# configuration options related to the alphabetical class index
873#---------------------------------------------------------------------------
874
875# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
876# of all compounds will be generated. Enable this if the project
877# contains a lot of classes, structs, unions or interfaces.
878
879ALPHABETICAL_INDEX = YES
880
881# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
882# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
883# in which this list will be split (can be a number in the range [1..20])
884
885COLS_IN_ALPHA_INDEX = 5
886
887# In case all classes in a project start with a common prefix, all
888# classes will be put under the same header in the alphabetical index.
889# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
890# should be ignored while generating the index headers.
891
892IGNORE_PREFIX =
893
894#---------------------------------------------------------------------------
895# configuration options related to the HTML output
896#---------------------------------------------------------------------------
897
898# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
899# generate HTML output.
900
901GENERATE_HTML = YES
902
903# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
904# If a relative path is entered the value of OUTPUT_DIRECTORY will be
905# put in front of it. If left blank `html' will be used as the default path.
906
907HTML_OUTPUT = lib@UNITY_API_LIB@
908
909# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
910# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
911# doxygen will generate files with .html extension.
912
913HTML_FILE_EXTENSION = .html
914
915# The HTML_HEADER tag can be used to specify a personal HTML header for
916# each generated HTML page. If it is left blank doxygen will generate a
917# standard header. Note that when using a custom header you are responsible
918# for the proper inclusion of any scripts and style sheets that doxygen
919# needs, which is dependent on the configuration options used.
920# It is advised to generate a default header using "doxygen -w html
921# header.html footer.html stylesheet.css YourConfigFile" and then modify
922# that header. Note that the header is subject to change so you typically
923# have to redo this when upgrading to a newer version of doxygen or when
924# changing the value of configuration settings such as GENERATE_TREEVIEW!
925
926HTML_HEADER =
927
928# The HTML_FOOTER tag can be used to specify a personal HTML footer for
929# each generated HTML page. If it is left blank doxygen will generate a
930# standard footer.
931
932HTML_FOOTER =
933
934# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
935# style sheet that is used by each HTML page. It can be used to
936# fine-tune the look of the HTML output. If the tag is left blank doxygen
937# will generate a default style sheet. Note that doxygen will try to copy
938# the style sheet file to the HTML output directory, so don't put your own
939# style sheet in the HTML output directory as well, or it will be erased!
940
941HTML_STYLESHEET =
942
943# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
944# other source files which should be copied to the HTML output directory. Note
945# that these files will be copied to the base HTML output directory. Use the
946# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
947# files. In the HTML_STYLESHEET file, use the file name only. Also note that
948# the files will be copied as-is; there are no commands or markers available.
949
950HTML_EXTRA_FILES =
951
952# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
953# Doxygen will adjust the colors in the style sheet and background images
954# according to this color. Hue is specified as an angle on a colorwheel,
955# see http://en.wikipedia.org/wiki/Hue for more information.
956# For instance the value 0 represents red, 60 is yellow, 120 is green,
957# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
958# The allowed range is 0 to 359.
959
960HTML_COLORSTYLE_HUE = 220
961
962# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
963# the colors in the HTML output. For a value of 0 the output will use
964# grayscales only. A value of 255 will produce the most vivid colors.
965
966HTML_COLORSTYLE_SAT = 100
967
968# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
969# the luminance component of the colors in the HTML output. Values below
970# 100 gradually make the output lighter, whereas values above 100 make
971# the output darker. The value divided by 100 is the actual gamma applied,
972# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
973# and 100 does not change the gamma.
974
975HTML_COLORSTYLE_GAMMA = 80
976
977# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
978# page will contain the date and time when the page was generated. Setting
979# this to NO can help when comparing the output of multiple runs.
980
981HTML_TIMESTAMP = YES
982
983# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
984# documentation will contain sections that can be hidden and shown after the
985# page has loaded.
986
987HTML_DYNAMIC_SECTIONS = NO
988
989# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
990# entries shown in the various tree structured indices initially; the user
991# can expand and collapse entries dynamically later on. Doxygen will expand
992# the tree to such a level that at most the specified number of entries are
993# visible (unless a fully collapsed tree already exceeds this amount).
994# So setting the number of entries 1 will produce a full collapsed tree by
995# default. 0 is a special value representing an infinite number of entries
996# and will result in a full expanded tree by default.
997
998HTML_INDEX_NUM_ENTRIES = 100
999
1000# If the GENERATE_DOCSET tag is set to YES, additional index files
1001# will be generated that can be used as input for Apple's Xcode 3
1002# integrated development environment, introduced with OSX 10.5 (Leopard).
1003# To create a documentation set, doxygen will generate a Makefile in the
1004# HTML output directory. Running make will produce the docset in that
1005# directory and running "make install" will install the docset in
1006# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
1007# it at startup.
1008# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
1009# for more information.
1010
1011GENERATE_DOCSET = NO
1012
1013# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
1014# feed. A documentation feed provides an umbrella under which multiple
1015# documentation sets from a single provider (such as a company or product suite)
1016# can be grouped.
1017
1018DOCSET_FEEDNAME = "Doxygen generated docs"
1019
1020# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
1021# should uniquely identify the documentation set bundle. This should be a
1022# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
1023# will append .docset to the name.
1024
1025DOCSET_BUNDLE_ID = org.doxygen.Project
1026
1027# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
1028# the documentation publisher. This should be a reverse domain-name style
1029# string, e.g. com.mycompany.MyDocSet.documentation.
1030
1031DOCSET_PUBLISHER_ID = org.doxygen.Publisher
1032
1033# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
1034
1035DOCSET_PUBLISHER_NAME = Publisher
1036
1037# If the GENERATE_HTMLHELP tag is set to YES, additional index files
1038# will be generated that can be used as input for tools like the
1039# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
1040# of the generated HTML documentation.
1041
1042GENERATE_HTMLHELP = NO
1043
1044# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
1045# be used to specify the file name of the resulting .chm file. You
1046# can add a path in front of the file if the result should not be
1047# written to the html output directory.
1048
1049CHM_FILE =
1050
1051# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
1052# be used to specify the location (absolute path including file name) of
1053# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
1054# the HTML help compiler on the generated index.hhp.
1055
1056HHC_LOCATION =
1057
1058# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
1059# controls if a separate .chi index file is generated (YES) or that
1060# it should be included in the master .chm file (NO).
1061
1062GENERATE_CHI = NO
1063
1064# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
1065# is used to encode HtmlHelp index (hhk), content (hhc) and project file
1066# content.
1067
1068CHM_INDEX_ENCODING =
1069
1070# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
1071# controls whether a binary table of contents is generated (YES) or a
1072# normal table of contents (NO) in the .chm file.
1073
1074BINARY_TOC = NO
1075
1076# The TOC_EXPAND flag can be set to YES to add extra items for group members
1077# to the contents of the HTML help documentation and to the tree view.
1078
1079TOC_EXPAND = NO
1080
1081# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
1082# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
1083# that can be used as input for Qt's qhelpgenerator to generate a
1084# Qt Compressed Help (.qch) of the generated HTML documentation.
1085
1086GENERATE_QHP = NO
1087
1088# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
1089# be used to specify the file name of the resulting .qch file.
1090# The path specified is relative to the HTML output folder.
1091
1092QCH_FILE =
1093
1094# The QHP_NAMESPACE tag specifies the namespace to use when generating
1095# Qt Help Project output. For more information please see
1096# http://doc.trolltech.com/qthelpproject.html#namespace
1097
1098QHP_NAMESPACE = org.doxygen.Project
1099
1100# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
1101# Qt Help Project output. For more information please see
1102# http://doc.trolltech.com/qthelpproject.html#virtual-folders
1103
1104QHP_VIRTUAL_FOLDER = doc
1105
1106# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
1107# add. For more information please see
1108# http://doc.trolltech.com/qthelpproject.html#custom-filters
1109
1110QHP_CUST_FILTER_NAME =
1111
1112# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
1113# custom filter to add. For more information please see
1114# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
1115# Qt Help Project / Custom Filters</a>.
1116
1117QHP_CUST_FILTER_ATTRS =
1118
1119# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
1120# project's
1121# filter section matches.
1122# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
1123# Qt Help Project / Filter Attributes</a>.
1124
1125QHP_SECT_FILTER_ATTRS =
1126
1127# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
1128# be used to specify the location of Qt's qhelpgenerator.
1129# If non-empty doxygen will try to run qhelpgenerator on the generated
1130# .qhp file.
1131
1132QHG_LOCATION =
1133
1134# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
1135# will be generated, which together with the HTML files, form an Eclipse help
1136# plugin. To install this plugin and make it available under the help contents
1137# menu in Eclipse, the contents of the directory containing the HTML and XML
1138# files needs to be copied into the plugins directory of eclipse. The name of
1139# the directory within the plugins directory should be the same as
1140# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
1141# the help appears.
1142
1143GENERATE_ECLIPSEHELP = NO
1144
1145# A unique identifier for the eclipse help plugin. When installing the plugin
1146# the directory name containing the HTML and XML files should also have
1147# this name.
1148
1149ECLIPSE_DOC_ID = org.doxygen.Project
1150
1151# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
1152# at top of each HTML page. The value NO (the default) enables the index and
1153# the value YES disables it. Since the tabs have the same information as the
1154# navigation tree you can set this option to NO if you already set
1155# GENERATE_TREEVIEW to YES.
1156
1157DISABLE_INDEX = NO
1158
1159# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
1160# structure should be generated to display hierarchical information.
1161# If the tag value is set to YES, a side panel will be generated
1162# containing a tree-like index structure (just like the one that
1163# is generated for HTML Help). For this to work a browser that supports
1164# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
1165# Windows users are probably better off using the HTML help feature.
1166# Since the tree basically has the same information as the tab index you
1167# could consider to set DISABLE_INDEX to NO when enabling this option.
1168
1169GENERATE_TREEVIEW = YES
1170
1171# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
1172# (range [0,1..20]) that doxygen will group on one line in the generated HTML
1173# documentation. Note that a value of 0 will completely suppress the enum
1174# values from appearing in the overview section.
1175
1176ENUM_VALUES_PER_LINE = 4
1177
1178# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
1179# used to set the initial width (in pixels) of the frame in which the tree
1180# is shown.
1181
1182TREEVIEW_WIDTH = 250
1183
1184# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
1185# links to external symbols imported via tag files in a separate window.
1186
1187EXT_LINKS_IN_WINDOW = NO
1188
1189# Use this tag to change the font size of Latex formulas included
1190# as images in the HTML documentation. The default is 10. Note that
1191# when you change the font size after a successful doxygen run you need
1192# to manually remove any form_*.png images from the HTML output directory
1193# to force them to be regenerated.
1194
1195FORMULA_FONTSIZE = 10
1196
1197# Use the FORMULA_TRANPARENT tag to determine whether or not the images
1198# generated for formulas are transparent PNGs. Transparent PNGs are
1199# not supported properly for IE 6.0, but are supported on all modern browsers.
1200# Note that when changing this option you need to delete any form_*.png files
1201# in the HTML output before the changes have effect.
1202
1203FORMULA_TRANSPARENT = YES
1204
1205# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
1206# (see http://www.mathjax.org) which uses client side Javascript for the
1207# rendering instead of using prerendered bitmaps. Use this if you do not
1208# have LaTeX installed or if you want to formulas look prettier in the HTML
1209# output. When enabled you may also need to install MathJax separately and
1210# configure the path to it using the MATHJAX_RELPATH option.
1211
1212USE_MATHJAX = NO
1213
1214# When MathJax is enabled you need to specify the location relative to the
1215# HTML output directory using the MATHJAX_RELPATH option. The destination
1216# directory should contain the MathJax.js script. For instance, if the mathjax
1217# directory is located at the same level as the HTML output directory, then
1218# MATHJAX_RELPATH should be ../mathjax. The default value points to
1219# the MathJax Content Delivery Network so you can quickly see the result without
1220# installing MathJax. However, it is strongly recommended to install a local
1221# copy of MathJax from http://www.mathjax.org before deployment.
1222
1223MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
1224
1225# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
1226# names that should be enabled during MathJax rendering.
1227
1228MATHJAX_EXTENSIONS =
1229
1230# When the SEARCHENGINE tag is enabled doxygen will generate a search box
1231# for the HTML output. The underlying search engine uses javascript
1232# and DHTML and should work on any modern browser. Note that when using
1233# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
1234# (GENERATE_DOCSET) there is already a search function so this one should
1235# typically be disabled. For large projects the javascript based search engine
1236# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
1237
1238SEARCHENGINE = YES
1239
1240# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
1241# implemented using a PHP enabled web server instead of at the web client
1242# using Javascript. Doxygen will generate the search PHP script and index
1243# file to put on the web server. The advantage of the server
1244# based approach is that it scales better to large projects and allows
1245# full text search. The disadvantages are that it is more difficult to setup
1246# and does not have live searching capabilities.
1247
1248SERVER_BASED_SEARCH = NO
1249
1250#---------------------------------------------------------------------------
1251# configuration options related to the LaTeX output
1252#---------------------------------------------------------------------------
1253
1254# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
1255# generate Latex output.
1256
1257GENERATE_LATEX = NO
1258
1259# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
1260# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1261# put in front of it. If left blank `latex' will be used as the default path.
1262
1263LATEX_OUTPUT = latex
1264
1265# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
1266# invoked. If left blank `latex' will be used as the default command name.
1267# Note that when enabling USE_PDFLATEX this option is only used for
1268# generating bitmaps for formulas in the HTML output, but not in the
1269# Makefile that is written to the output directory.
1270
1271LATEX_CMD_NAME = latex
1272
1273# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
1274# generate index for LaTeX. If left blank `makeindex' will be used as the
1275# default command name.
1276
1277MAKEINDEX_CMD_NAME = makeindex
1278
1279# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
1280# LaTeX documents. This may be useful for small projects and may help to
1281# save some trees in general.
1282
1283COMPACT_LATEX = NO
1284
1285# The PAPER_TYPE tag can be used to set the paper type that is used
1286# by the printer. Possible values are: a4, letter, legal and
1287# executive. If left blank a4wide will be used.
1288
1289PAPER_TYPE = a4
1290
1291# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
1292# packages that should be included in the LaTeX output.
1293
1294EXTRA_PACKAGES =
1295
1296# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
1297# the generated latex document. The header should contain everything until
1298# the first chapter. If it is left blank doxygen will generate a
1299# standard header. Notice: only use this tag if you know what you are doing!
1300
1301LATEX_HEADER =
1302
1303# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
1304# the generated latex document. The footer should contain everything after
1305# the last chapter. If it is left blank doxygen will generate a
1306# standard footer. Notice: only use this tag if you know what you are doing!
1307
1308LATEX_FOOTER =
1309
1310# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
1311# is prepared for conversion to pdf (using ps2pdf). The pdf file will
1312# contain links (just like the HTML output) instead of page references
1313# This makes the output suitable for online browsing using a pdf viewer.
1314
1315PDF_HYPERLINKS = YES
1316
1317# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
1318# plain latex in the generated Makefile. Set this option to YES to get a
1319# higher quality PDF documentation.
1320
1321USE_PDFLATEX = YES
1322
1323# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
1324# command to the generated LaTeX files. This will instruct LaTeX to keep
1325# running if errors occur, instead of asking the user for help.
1326# This option is also used when generating formulas in HTML.
1327
1328LATEX_BATCHMODE = NO
1329
1330# If LATEX_HIDE_INDICES is set to YES then doxygen will not
1331# include the index chapters (such as File Index, Compound Index, etc.)
1332# in the output.
1333
1334LATEX_HIDE_INDICES = NO
1335
1336# If LATEX_SOURCE_CODE is set to YES then doxygen will include
1337# source code with syntax highlighting in the LaTeX output.
1338# Note that which sources are shown also depends on other settings
1339# such as SOURCE_BROWSER.
1340
1341LATEX_SOURCE_CODE = NO
1342
1343# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
1344# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
1345# http://en.wikipedia.org/wiki/BibTeX for more info.
1346
1347LATEX_BIB_STYLE = plain
1348
1349#---------------------------------------------------------------------------
1350# configuration options related to the RTF output
1351#---------------------------------------------------------------------------
1352
1353# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
1354# The RTF output is optimized for Word 97 and may not look very pretty with
1355# other RTF readers or editors.
1356
1357GENERATE_RTF = NO
1358
1359# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
1360# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1361# put in front of it. If left blank `rtf' will be used as the default path.
1362
1363RTF_OUTPUT = rtf
1364
1365# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
1366# RTF documents. This may be useful for small projects and may help to
1367# save some trees in general.
1368
1369COMPACT_RTF = NO
1370
1371# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
1372# will contain hyperlink fields. The RTF file will
1373# contain links (just like the HTML output) instead of page references.
1374# This makes the output suitable for online browsing using WORD or other
1375# programs which support those fields.
1376# Note: wordpad (write) and others do not support links.
1377
1378RTF_HYPERLINKS = NO
1379
1380# Load style sheet definitions from file. Syntax is similar to doxygen's
1381# config file, i.e. a series of assignments. You only have to provide
1382# replacements, missing definitions are set to their default value.
1383
1384RTF_STYLESHEET_FILE =
1385
1386# Set optional variables used in the generation of an rtf document.
1387# Syntax is similar to doxygen's config file.
1388
1389RTF_EXTENSIONS_FILE =
1390
1391#---------------------------------------------------------------------------
1392# configuration options related to the man page output
1393#---------------------------------------------------------------------------
1394
1395# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
1396# generate man pages
1397
1398GENERATE_MAN = NO
1399
1400# The MAN_OUTPUT tag is used to specify where the man pages will be put.
1401# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1402# put in front of it. If left blank `man' will be used as the default path.
1403
1404MAN_OUTPUT = man
1405
1406# The MAN_EXTENSION tag determines the extension that is added to
1407# the generated man pages (default is the subroutine's section .3)
1408
1409MAN_EXTENSION = .3
1410
1411# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
1412# then it will generate one additional man file for each entity
1413# documented in the real man page(s). These additional files
1414# only source the real man page, but without them the man command
1415# would be unable to find the correct page. The default is NO.
1416
1417MAN_LINKS = NO
1418
1419#---------------------------------------------------------------------------
1420# configuration options related to the XML output
1421#---------------------------------------------------------------------------
1422
1423# If the GENERATE_XML tag is set to YES Doxygen will
1424# generate an XML file that captures the structure of
1425# the code including all documentation.
1426
1427GENERATE_XML = NO
1428
1429# The XML_OUTPUT tag is used to specify where the XML pages will be put.
1430# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1431# put in front of it. If left blank `xml' will be used as the default path.
1432
1433XML_OUTPUT = xml
1434
1435# The XML_SCHEMA tag can be used to specify an XML schema,
1436# which can be used by a validating XML parser to check the
1437# syntax of the XML files.
1438
1439XML_SCHEMA =
1440
1441# The XML_DTD tag can be used to specify an XML DTD,
1442# which can be used by a validating XML parser to check the
1443# syntax of the XML files.
1444
1445XML_DTD =
1446
1447# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
1448# dump the program listings (including syntax highlighting
1449# and cross-referencing information) to the XML output. Note that
1450# enabling this will significantly increase the size of the XML output.
1451
1452XML_PROGRAMLISTING = YES
1453
1454#---------------------------------------------------------------------------
1455# configuration options for the AutoGen Definitions output
1456#---------------------------------------------------------------------------
1457
1458# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
1459# generate an AutoGen Definitions (see autogen.sf.net) file
1460# that captures the structure of the code including all
1461# documentation. Note that this feature is still experimental
1462# and incomplete at the moment.
1463
1464GENERATE_AUTOGEN_DEF = NO
1465
1466#---------------------------------------------------------------------------
1467# configuration options related to the Perl module output
1468#---------------------------------------------------------------------------
1469
1470# If the GENERATE_PERLMOD tag is set to YES Doxygen will
1471# generate a Perl module file that captures the structure of
1472# the code including all documentation. Note that this
1473# feature is still experimental and incomplete at the
1474# moment.
1475
1476GENERATE_PERLMOD = NO
1477
1478# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
1479# the necessary Makefile rules, Perl scripts and LaTeX code to be able
1480# to generate PDF and DVI output from the Perl module output.
1481
1482PERLMOD_LATEX = NO
1483
1484# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
1485# nicely formatted so it can be parsed by a human reader. This is useful
1486# if you want to understand what is going on. On the other hand, if this
1487# tag is set to NO the size of the Perl module output will be much smaller
1488# and Perl will parse it just the same.
1489
1490PERLMOD_PRETTY = YES
1491
1492# The names of the make variables in the generated doxyrules.make file
1493# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
1494# This is useful so different doxyrules.make files included by the same
1495# Makefile don't overwrite each other's variables.
1496
1497PERLMOD_MAKEVAR_PREFIX =
1498
1499#---------------------------------------------------------------------------
1500# Configuration options related to the preprocessor
1501#---------------------------------------------------------------------------
1502
1503# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
1504# evaluate all C-preprocessor directives found in the sources and include
1505# files.
1506
1507ENABLE_PREPROCESSING = YES
1508
1509# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
1510# names in the source code. If set to NO (the default) only conditional
1511# compilation will be performed. Macro expansion can be done in a controlled
1512# way by setting EXPAND_ONLY_PREDEF to YES.
1513
1514MACRO_EXPANSION = NO
1515
1516# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
1517# then the macro expansion is limited to the macros specified with the
1518# PREDEFINED and EXPAND_AS_DEFINED tags.
1519
1520EXPAND_ONLY_PREDEF = NO
1521
1522# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
1523# pointed to by INCLUDE_PATH will be searched when a #include is found.
1524
1525SEARCH_INCLUDES = YES
1526
1527# The INCLUDE_PATH tag can be used to specify one or more directories that
1528# contain include files that are not input files but should be processed by
1529# the preprocessor.
1530
1531INCLUDE_PATH =
1532
1533# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
1534# patterns (like *.h and *.hpp) to filter out the header-files in the
1535# directories. If left blank, the patterns specified with FILE_PATTERNS will
1536# be used.
1537
1538INCLUDE_FILE_PATTERNS =
1539
1540# The PREDEFINED tag can be used to specify one or more macro names that
1541# are defined before the preprocessor is started (similar to the -D option of
1542# gcc). The argument of the tag is a list of macros of the form: name
1543# or name=definition (no spaces). If the definition and the = are
1544# omitted =1 is assumed. To prevent a macro definition from being
1545# undefined via #undef or recursively expanded use the := operator
1546# instead of the = operator.
1547
1548PREDEFINED =
1549
1550# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
1551# this tag can be used to specify a list of macro names that should be expanded.
1552# The macro definition that is found in the sources will be used.
1553# Use the PREDEFINED tag if you want to use a different macro definition that
1554# overrules the definition found in the source code.
1555
1556EXPAND_AS_DEFINED =
1557
1558# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
1559# doxygen's preprocessor will remove all references to function-like macros
1560# that are alone on a line, have an all uppercase name, and do not end with a
1561# semicolon, because these will confuse the parser if not removed.
1562
1563SKIP_FUNCTION_MACROS = YES
1564
1565#---------------------------------------------------------------------------
1566# Configuration::additions related to external references
1567#---------------------------------------------------------------------------
1568
1569# The TAGFILES option can be used to specify one or more tagfiles. For each
1570# tag file the location of the external documentation should be added. The
1571# format of a tag file without this location is as follows:
1572# TAGFILES = file1 file2 ...
1573# Adding location for the tag files is done as follows:
1574# TAGFILES = file1=loc1 "file2 = loc2" ...
1575# where "loc1" and "loc2" can be relative or absolute paths
1576# or URLs. Note that each tag file must have a unique name (where the name does
1577# NOT include the path). If a tag file is not located in the directory in which
1578# doxygen is run, you must also specify the path to the tagfile here.
1579
1580TAGFILES =
1581
1582# When a file name is specified after GENERATE_TAGFILE, doxygen will create
1583# a tag file that is based on the input files it reads.
1584
1585GENERATE_TAGFILE =
1586
1587# If the ALLEXTERNALS tag is set to YES all external classes will be listed
1588# in the class index. If set to NO only the inherited external classes
1589# will be listed.
1590
1591ALLEXTERNALS = NO
1592
1593# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
1594# in the modules index. If set to NO, only the current project's groups will
1595# be listed.
1596
1597EXTERNAL_GROUPS = YES
1598
1599# The PERL_PATH should be the absolute path and name of the perl script
1600# interpreter (i.e. the result of `which perl').
1601
1602PERL_PATH = /usr/bin/perl
1603
1604#---------------------------------------------------------------------------
1605# Configuration options related to the dot tool
1606#---------------------------------------------------------------------------
1607
1608# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
1609# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
1610# or super classes. Setting the tag to NO turns the diagrams off. Note that
1611# this option also works with HAVE_DOT disabled, but it is recommended to
1612# install and use dot, since it yields more powerful graphs.
1613
1614CLASS_DIAGRAMS = YES
1615
1616# You can define message sequence charts within doxygen comments using the \msc
1617# command. Doxygen will then run the mscgen tool (see
1618# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
1619# documentation. The MSCGEN_PATH tag allows you to specify the directory where
1620# the mscgen tool resides. If left empty the tool is assumed to be found in the
1621# default search path.
1622
1623DOT_PATH = @DOXYGEN_DOT_PATH@
1624
1625# If set to YES, the inheritance and collaboration graphs will hide
1626# inheritance and usage relations if the target is undocumented
1627# or is not a class.
1628
1629HIDE_UNDOC_RELATIONS = YES
1630
1631# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
1632# available from the path. This tool is part of Graphviz, a graph visualization
1633# toolkit from AT&T and Lucent Bell Labs. The other options in this section
1634# have no effect if this option is set to NO (the default)
1635
1636HAVE_DOT = YES
1637
1638# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
1639# allowed to run in parallel. When set to 0 (the default) doxygen will
1640# base this on the number of processors available in the system. You can set it
1641# explicitly to a value larger than 0 to get control over the balance
1642# between CPU load and processing speed.
1643
1644DOT_NUM_THREADS = 0
1645
1646# By default doxygen will use the Helvetica font for all dot files that
1647# doxygen generates. When you want a differently looking font you can specify
1648# the font name using DOT_FONTNAME. You need to make sure dot is able to find
1649# the font, which can be done by putting it in a standard location or by setting
1650# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
1651# directory containing the font.
1652
1653DOT_FONTNAME = Helvetica
1654
1655# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
1656# The default size is 10pt.
1657
1658DOT_FONTSIZE = 10
1659
1660# By default doxygen will tell dot to use the Helvetica font.
1661# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
1662# set the path where dot can find it.
1663
1664DOT_FONTPATH =
1665
1666# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
1667# will generate a graph for each documented class showing the direct and
1668# indirect inheritance relations. Setting this tag to YES will force the
1669# CLASS_DIAGRAMS tag to NO.
1670
1671CLASS_GRAPH = YES
1672
1673# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
1674# will generate a graph for each documented class showing the direct and
1675# indirect implementation dependencies (inheritance, containment, and
1676# class references variables) of the class with other documented classes.
1677
1678COLLABORATION_GRAPH = YES
1679
1680# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
1681# will generate a graph for groups, showing the direct groups dependencies
1682
1683GROUP_GRAPHS = YES
1684
1685# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
1686# collaboration diagrams in a style similar to the OMG's Unified Modeling
1687# Language.
1688
1689UML_LOOK = NO
1690
1691# If the UML_LOOK tag is enabled, the fields and methods are shown inside
1692# the class node. If there are many fields or methods and many nodes the
1693# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
1694# threshold limits the number of items for each type to make the size more
1695# managable. Set this to 0 for no limit. Note that the threshold may be
1696# exceeded by 50% before the limit is enforced.
1697
1698UML_LIMIT_NUM_FIELDS = 10
1699
1700# If set to YES, the inheritance and collaboration graphs will show the
1701# relations between templates and their instances.
1702
1703TEMPLATE_RELATIONS = NO
1704
1705# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
1706# tags are set to YES then doxygen will generate a graph for each documented
1707# file showing the direct and indirect include dependencies of the file with
1708# other documented files.
1709
1710INCLUDE_GRAPH = YES
1711
1712# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
1713# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
1714# documented header file showing the documented files that directly or
1715# indirectly include this file.
1716
1717INCLUDED_BY_GRAPH = YES
1718
1719# If the CALL_GRAPH and HAVE_DOT options are set to YES then
1720# doxygen will generate a call dependency graph for every global function
1721# or class method. Note that enabling this option will significantly increase
1722# the time of a run. So in most cases it will be better to enable call graphs
1723# for selected functions only using the \callgraph command.
1724
1725CALL_GRAPH = NO
1726
1727# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
1728# doxygen will generate a caller dependency graph for every global function
1729# or class method. Note that enabling this option will significantly increase
1730# the time of a run. So in most cases it will be better to enable caller
1731# graphs for selected functions only using the \callergraph command.
1732
1733CALLER_GRAPH = NO
1734
1735# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
1736# will generate a graphical hierarchy of all classes instead of a textual one.
1737
1738GRAPHICAL_HIERARCHY = YES
1739
1740# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
1741# then doxygen will show the dependencies a directory has on other directories
1742# in a graphical way. The dependency relations are determined by the #include
1743# relations between the files in the directories.
1744
1745DIRECTORY_GRAPH = YES
1746
1747# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
1748# generated by dot. Possible values are svg, png, jpg, or gif.
1749# If left blank png will be used. If you choose svg you need to set
1750# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
1751# visible in IE 9+ (other browsers do not have this requirement).
1752
1753DOT_IMAGE_FORMAT = png
1754
1755# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
1756# enable generation of interactive SVG images that allow zooming and panning.
1757# Note that this requires a modern browser other than Internet Explorer.
1758# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
1759# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
1760# visible. Older versions of IE do not have SVG support.
1761
1762INTERACTIVE_SVG = NO
1763
1764# The tag DOT_PATH can be used to specify the path where the dot tool can be
1765# found. If left blank, it is assumed the dot tool can be found in the path.
1766
1767DOT_PATH =
1768
1769# The DOTFILE_DIRS tag can be used to specify one or more directories that
1770# contain dot files that are included in the documentation (see the
1771# \dotfile command).
1772
1773DOTFILE_DIRS =
1774
1775# The MSCFILE_DIRS tag can be used to specify one or more directories that
1776# contain msc files that are included in the documentation (see the
1777# \mscfile command).
1778
1779MSCFILE_DIRS =
1780
1781# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
1782# nodes that will be shown in the graph. If the number of nodes in a graph
1783# becomes larger than this value, doxygen will truncate the graph, which is
1784# visualized by representing a node as a red box. Note that doxygen if the
1785# number of direct children of the root node in a graph is already larger than
1786# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
1787# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
1788
1789DOT_GRAPH_MAX_NODES = 50
1790
1791# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
1792# graphs generated by dot. A depth value of 3 means that only nodes reachable
1793# from the root by following a path via at most 3 edges will be shown. Nodes
1794# that lay further from the root node will be omitted. Note that setting this
1795# option to 1 or 2 may greatly reduce the computation time needed for large
1796# code bases. Also note that the size of a graph can be further restricted by
1797# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
1798
1799MAX_DOT_GRAPH_DEPTH = 0
1800
1801# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
1802# background. This is disabled by default, because dot on Windows does not
1803# seem to support this out of the box. Warning: Depending on the platform used,
1804# enabling this option may lead to badly anti-aliased labels on the edges of
1805# a graph (i.e. they become hard to read).
1806
1807DOT_TRANSPARENT = NO
1808
1809# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
1810# files in one run (i.e. multiple -o and -T options on the command line). This
1811# makes dot run faster, but since only newer versions of dot (>1.8.10)
1812# support this, this feature is disabled by default.
1813
1814DOT_MULTI_TARGETS = NO
1815
1816# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
1817# generate a legend page explaining the meaning of the various boxes and
1818# arrows in the dot generated graphs.
1819
1820GENERATE_LEGEND = YES
1821
1822# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
1823# remove the intermediate dot files that are used to generate
1824# the various graphs.
1825
1826DOT_CLEANUP = YES
18270
=== removed directory 'include'
=== removed file 'include/CMakeLists.txt'
--- include/CMakeLists.txt 2013-04-22 18:14:52 +0000
+++ include/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1set(HDR_INSTALL_DIR include)
2add_subdirectory(unity)
3
4set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} PARENT_SCOPE)
50
=== removed directory 'include/unity'
=== removed file 'include/unity/CMakeLists.txt'
--- include/unity/CMakeLists.txt 2013-04-22 18:14:52 +0000
+++ include/unity/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1add_subdirectory(api)
2add_subdirectory(scopes)
3add_subdirectory(util)
4
5file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
6file(GLOB internal_headers "${CMAKE_CURRENT_SOURCE_DIR}/internal/*.h")
7
8install(FILES ${headers} DESTINATION ${HDR_INSTALL_DIR}/unity)
9
10set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
110
=== removed file 'include/unity/Exception.h'
--- include/unity/Exception.h 2013-04-17 02:18:48 +0000
+++ include/unity/Exception.h 1970-01-01 00:00:00 +0000
@@ -1,158 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_EXCEPTION_H
20#define UNITY_EXCEPTION_H
21
22#include <unity/config.h>
23
24#include <exception>
25#include <string>
26#include <memory>
27
28namespace unity
29{
30
31namespace internal
32{
33class ExceptionImpl;
34}
35
36// TODO: It probably would be best to split this into a base and ImplBase, with the derived part in the internal
37// namespace and declaring self(), the constructor, and pimpl(). That's because the Impl for the exception
38// is in the internal namespace, so public API clients can use Exception instances, but they cannot
39// create new derived exceptions because the Impl classes are internal to Unity.
40
41/**
42\brief Abstract base class for all Unity exceptions.
43
44This class is the base class for all Unity exceptions. Besides providing a common base class for
45structured exception handling, this class provides features to capture nested exceptions (for
46exceptions that are re-thrown) and to chain exceptions into an exception history that allows
47a number of exceptions to be remembered before throwing a new exception.
48
49The exception nesting is provided by the derivation from <code>std::nested_exception</code>. If you
50catch an exception and throw another exception from the catch handler, the caught exception
51is automatically preserved; you can access nested exceptions by calling the <code>nested_ptr()</code> and
52<code>rethrow_nested()</code> member functions of <code>std::nested_exception</code>.
53
54In addition, you can remember one or more exceptions by calling remember(). This is useful in situations
55where you need perform a number of actions that may fail with an error code, and you do not want to
56throw an exception until all of the actions have been attempted. This is particularly useful in shutdown
57scenarios, where it is often impossible to recover from an error, but it is still desirable to try to
58shut down as much as possible before reporting or logging the errors:
59
60~~~
61void
62shutdown()
63{
64 using namespace std;
65
66 exception_ptr ep;
67
68 try
69 {
70 shutdown_action_1();
71 }
72 catch (SomeException const&)
73 {
74 ep = make_exception_ptr(current_exception());
75 }
76
77 try
78 {
79 shutdown_action_2();
80 }
81 catch (SomeOtherException const&)
82 {
83 ep = e.remember(ep);
84 }
85
86 int err = shutdown_action_3();
87 if (err != 0)
88 {
89 try
90 {
91 throw YetAnotherException(err);
92 }
93 catch (YetAnotherException const& e)
94 {
95 ep = e.remember(ep);
96 }
97 }
98
99 if (ep)
100 {
101 rethrow_exception(ep);
102 }
103}
104~~~
105
106Calling to_string() on a caught exception returns a string with the entire exception history (both nested and
107chained).
108
109*/
110
111class UNITY_API Exception : public std::exception, public std::nested_exception
112{
113public:
114 //! @cond
115 Exception(Exception const&);
116 Exception& operator=(Exception const&);
117 virtual ~Exception() noexcept;
118 //! @endcond
119
120 /**
121 \brief Returns the name of the exception.
122
123 Derived classes must override what() to return <i>only</i> the (fully-qualified) name of the derived
124 exception. If the derived class sets a reason string (or contains other details), it should <i>not</i>
125 include the reason or details as part of the string return returned by what().
126 */
127 virtual char const* what() const noexcept = 0;
128
129 virtual std::string reason() const;
130
131 virtual std::string to_string(std::string const& indent = " ") const;
132 virtual std::string to_string(int indent_level, std::string const& indent) const;
133
134 std::exception_ptr remember(std::exception_ptr earlier_exception);
135 std::exception_ptr get_earlier() const noexcept;
136
137 /**
138 \brief Returns a <code>std::exception_ptr</code> to <code>this</code>.
139
140 \note Derived exceptions must implement this member function so the implemention of remember()
141 (provided by this abstract base class) can return a <code>std::exception_ptr</code> to its own derived exception.
142 */
143 virtual std::exception_ptr self() const = 0;
144
145protected:
146 //! @cond
147 Exception(std::shared_ptr<internal::ExceptionImpl> const& derived);
148 internal::ExceptionImpl* pimpl() const noexcept; // No need to reimplement in derived
149 //! @endcond
150
151private:
152 std::shared_ptr<internal::ExceptionImpl> p_; // shared_ptr instead of unique_ptr because
153 // exceptions must be copyable
154};
155
156} // namespace unity
157
158#endif
1590
=== removed file 'include/unity/UnityExceptions.h'
--- include/unity/UnityExceptions.h 2013-04-17 02:18:48 +0000
+++ include/unity/UnityExceptions.h 1970-01-01 00:00:00 +0000
@@ -1,258 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_EXCEPTIONS_H
20#define UNITY_EXCEPTIONS_H
21
22#include <unity/Exception.h>
23
24namespace unity
25{
26
27namespace internal
28{
29class InvalidArgumentExceptionImpl;
30}
31
32/**
33\brief Exception to indicate that an invalid argument was passed to a function, such as passing <code>nullptr</code>
34 when the function expects the argument to be non-null.
35*/
36
37class UNITY_API InvalidArgumentException : public Exception
38{
39public:
40 /**
41 \brief Constructs the exception.
42 \param reason Further details about the cause of the exception.
43 */
44 explicit InvalidArgumentException(std::string const& reason);
45 //! @cond
46 InvalidArgumentException(InvalidArgumentException const&);
47 InvalidArgumentException& operator=(InvalidArgumentException const&);
48 virtual ~InvalidArgumentException() noexcept;
49 //! @endcond
50
51 /**
52 \brief Returns the fully-qualified name of the exception.
53 */
54 virtual char const* what() const noexcept override;
55
56 /**
57 \brief Returns a <code>std::exception_ptr</code> to <code>this</code>.
58 */
59 virtual std::exception_ptr self() const override;
60};
61
62namespace internal
63{
64class LogicExceptionImpl;
65}
66
67/**
68\brief Exception to indicate a logic error, such as driving the API incorrectly, such as calling methods
69 in the wrong worder.
70*/
71
72class UNITY_API LogicException : public Exception
73{
74public:
75 /**
76 \brief Constructs the exception.
77 \param reason Further details about the cause of the exception.
78 */
79 explicit LogicException(std::string const& reason);
80 //! @cond
81 LogicException(LogicException const&);
82 LogicException& operator=(LogicException const&);
83 virtual ~LogicException() noexcept;
84 //! @endcond
85
86 /**
87 \brief Returns the fully-qualified name of the exception.
88 */
89 virtual char const* what() const noexcept override;
90
91 /**
92 \brief Returns a <code>std::exception_ptr</code> to <code>this</code>.
93 */
94 virtual std::exception_ptr self() const override;
95};
96
97namespace internal
98{
99class ShutdownExceptionImpl;
100}
101
102/**
103\brief Exception to indicate errors during shutdown.
104
105 Usually, it is not possible to handle or recover
106 from errors that arise during shutdown. This exception is thrown once all possible shutdown actions
107 have been carried out and provides information about anything that went wrong via the exception
108 chaining mechanism of the unity::Exception base class.
109*/
110
111class UNITY_API ShutdownException : public Exception
112{
113public:
114 /**
115 \brief Constructs the exception.
116 \param reason Further details about the cause of the exception.
117 */
118 explicit ShutdownException(std::string const& reason);
119 //! @cond
120 ShutdownException(ShutdownException const&);
121 ShutdownException& operator=(ShutdownException const&);
122 virtual ~ShutdownException() noexcept;
123 //! @endcond
124
125 /**
126 \brief Returns the fully-qualified name of the exception.
127 */
128 virtual char const* what() const noexcept override;
129
130 /**
131 \brief Returns a <code>std::exception_ptr</code> to <code>this</code>.
132 */
133 virtual std::exception_ptr self() const override;
134};
135
136namespace internal
137{
138class FileExceptionImpl;
139}
140
141/**
142\brief Exception to indicate file I/O errors, such as failure to open or write to a file.
143*/
144
145class UNITY_API FileException : public Exception
146{
147public:
148 /**
149 \brief Constructs the exception.
150 */
151 /**
152 \brief Constructs the exception from a reason string and and error number.
153 \param reason Further details about the cause of the exception.
154 \param err The UNIX <code>errno</code> value for the error.
155 */
156 FileException(std::string const& reason, int err);
157 //! @cond
158 FileException(FileException const&);
159 FileException& operator=(FileException const&);
160 virtual ~FileException() noexcept;
161 //! @endcond
162
163 /**
164 \brief Returns the fully-qualified name of the exception.
165 */
166 virtual char const* what() const noexcept override;
167
168 /**
169 \brief Returns a <code>std::exception_ptr</code> to <code>this</code>.
170 */
171 virtual std::exception_ptr self() const override;
172
173 /**
174 \return Returns the error number that was passed to the constructor.
175 */
176 int error() const noexcept;
177};
178
179namespace internal
180{
181class SyscallExceptionImpl;
182}
183
184/**
185\brief Exception to indicate system or library call errors that set <code>errno</code>.
186*/
187
188class UNITY_API SyscallException : public Exception
189{
190public:
191 /**
192 \brief Constructs the exception.
193 */
194 /**
195 \brief Constructs the exception from a reason string and and error number.
196 \param reason Further details about the cause of the exception.
197 \param err The UNIX <code>errno</code> value for the error.
198 */
199 SyscallException(std::string const& reason, int err);
200 //! @cond
201 SyscallException(SyscallException const&);
202 SyscallException& operator=(SyscallException const&);
203 virtual ~SyscallException() noexcept;
204 //! @endcond
205
206 /**
207 \brief Returns the fully-qualified name of the exception.
208 */
209 virtual char const* what() const noexcept override;
210
211 /**
212 \brief Returns a <code>std::exception_ptr</code> to <code>this</code>.
213 */
214 virtual std::exception_ptr self() const override;
215
216 /**
217 \return Returns the error number that was passed to the constructor.
218 */
219 int error() const noexcept;
220};
221
222namespace internal
223{
224class ResourceExceptionImpl;
225}
226
227/**
228\brief Exception for miscellaneous errors, such as failure of a third-party library or hitting resource limitations.
229*/
230
231class UNITY_API ResourceException : public Exception
232{
233public:
234 /**
235 \brief Constructs the exception.
236 \param reason Further details about the cause of the exception.
237 */
238 ResourceException(std::string const& reason);
239 //! @cond
240 ResourceException(ResourceException const&);
241 ResourceException& operator=(ResourceException const&);
242 virtual ~ResourceException() noexcept;
243 //! @endcond
244
245 /**
246 \brief Returns the fully-qualified name of the exception.
247 */
248 virtual char const* what() const noexcept override;
249
250 /**
251 \brief Returns a <code>std::exception_ptr</code> to <code>this</code>.
252 */
253 virtual std::exception_ptr self() const override;
254};
255
256} // namespace unity
257
258#endif
2590
=== removed directory 'include/unity/api'
=== removed file 'include/unity/api/CMakeLists.txt'
--- include/unity/api/CMakeLists.txt 2013-04-22 18:14:52 +0000
+++ include/unity/api/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
2file(GLOB internal_headers "${CMAKE_CURRENT_SOURCE_DIR}/internal/*.h")
3
4#
5# Generated headers
6#
7configure_file(Version.h.in Version.h)
8set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/Version.h)
9
10install(FILES ${headers} DESTINATION ${HDR_INSTALL_DIR}/unity/api)
11
12set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
130
=== removed file 'include/unity/api/Version.h.in'
--- include/unity/api/Version.h.in 2013-04-18 00:06:43 +0000
+++ include/unity/api/Version.h.in 1970-01-01 00:00:00 +0000
@@ -1,103 +0,0 @@
1//
2// DO NOT EDIT Version.h (this file)! It is generated from Version.h.in.
3//
4
5/*
6 * Copyright (C) 2013 Canonical Ltd
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 3 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * Authored by: Michi Henning <michi.henning@canonical.com>
21 */
22
23#include <unity/config.h>
24
25#ifndef UNITY_API_VERSION_H
26#define UNITY_API_VERSION_H
27
28#define UNITY_API_VERSION_MAJOR @UNITY_API_MAJOR@
29#define UNITY_API_VERSION_MINOR @UNITY_API_MINOR@
30#define UNITY_API_VERSION_MICRO @UNITY_API_MICRO@
31
32#define UNITY_API_VERSION_STRING "@UNITY_API_VERSION@"
33
34namespace unity
35{
36
37namespace api
38{
39
40/**
41\brief Class to obtain version information for the Unity API at run time.
42
43Version information is represented as
44<i>&lt;<code>major</code>&gt;</i>.<i>&lt;<code>minor</code>&gt;</i>.<i>&lt;<code>micro</code>&gt;</i>.
45
46Releases that differ in the major or minor version number are binary incompatible.
47
48Releases of the library that differ only in the micro version number are binary compatible with older releases,
49so client code does not need to be recompiled to use the newer library version.
50
51A different minor version is compatible at the API level, that is, it may add new APIs, but does not change existing
52ones. API clients must be recompiled for a new minor version.
53
54A different major version indicates incompatible API changes.
55*/
56
57// Version could be a namespace instead of a class, but that requires a lower-case name,
58// which is inconsistent with the remainder of the API.
59
60class UNITY_API Version
61{
62public:
63 /**
64 \brief Returns the major version number of the Unity API library.
65
66 The major version number is also available as the macro <code>UNITY_API_VERSION_MAJOR</code>.
67 */
68 static int major_version();
69
70 /**
71 \brief Returns the minor version number of the Unity API library.
72
73 The minor version number is also available as the macro <code>UNITY_API_VERSION_MINOR</code>.
74 */
75 static int minor_version();
76
77 /**
78 \brief Returns the micro version number of the Unity API library.
79
80 The micro version number is also available as the macro <code>UNITY_API_VERSION_MICRO</code>.
81 */
82 static int micro_version();
83
84 /**
85 \brief Returns the Unity API version as a string in the format
86 <i>&lt;<code>major</code>&gt;</i>.<i>&lt;<code>minor</code>&gt;</i>.<i>&lt;<code>micro</code>&gt;</i>.
87
88 The version string is also available as the macro <code>UNITY_API_VERSION_STRING</code>.
89 */
90 static const char* str(); // Returns "major.minor.micro"
91
92 // TODO: Add methods to report compiler version and compiler flags
93
94private:
95 Version() = delete;
96 ~Version() = delete;
97};
98
99} // namespace api
100
101} // namespace unity
102
103#endif
1040
=== removed directory 'include/unity/api/internal'
=== removed file 'include/unity/config.h'
--- include/unity/config.h 2013-04-08 03:05:05 +0000
+++ include/unity/config.h 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_CONFIG_H
20#define UNITY_CONFIG_H
21
22#define UNITY_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
23
24#ifdef UNITY_DLL_EXPORTS // Defined if we are building the Unity API library
25 #define UNITY_API UNITY_HELPER_DLL_EXPORT
26#else
27 #define UNITY_API /**/
28#endif
29
30#endif
310
=== removed directory 'include/unity/internal'
=== removed file 'include/unity/internal/ExceptionImpl.h'
--- include/unity/internal/ExceptionImpl.h 2013-04-04 02:16:16 +0000
+++ include/unity/internal/ExceptionImpl.h 1970-01-01 00:00:00 +0000
@@ -1,60 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_INTERNAL_EXCEPTIONIMPL_H
20#define UNITY_INTERNAL_EXCEPTIONIMPL_H
21
22#include <unity/util/NonCopyable.h>
23
24#include <string>
25#include <exception>
26
27namespace unity
28{
29
30class Exception;
31
32namespace internal
33{
34
35class ExceptionImpl : private util::NonCopyable
36{
37public:
38 explicit ExceptionImpl(std::string const& reason);
39
40 virtual char const* what() const noexcept = 0;
41 virtual std::string reason() const;
42 virtual std::string to_string(std::nested_exception const& nested, int indent_level, std::string const& indent) const;
43
44 std::exception_ptr remember(unity::Exception const* env, std::exception_ptr earlier_exception);
45 std::exception_ptr remember(unity::Exception const* env, Exception const& earlier_exception);
46 std::exception_ptr get_earlier() const noexcept;
47
48protected:
49 virtual ~ExceptionImpl() noexcept;
50
51private:
52 std::string const reason_;
53 std::exception_ptr previous_;
54};
55
56} // namespace internal
57
58} // namespace unity
59
60#endif
610
=== removed file 'include/unity/internal/UnityExceptionsImpl.h'
--- include/unity/internal/UnityExceptionsImpl.h 2013-04-04 02:16:16 +0000
+++ include/unity/internal/UnityExceptionsImpl.h 1970-01-01 00:00:00 +0000
@@ -1,95 +0,0 @@
1/*
2 * Copyright (C) 2012 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_INTERNAL_UNITYEXCEPTIONSIMPL_H
20#define UNITY_INTERNAL_UNITYEXCEPTIONSIMPL_H
21
22#include <unity/internal/ExceptionImpl.h>
23
24#include <string>
25#include <exception>
26
27namespace unity
28{
29
30class Exception;
31
32namespace internal
33{
34
35class InvalidArgumentExceptionImpl : public ExceptionImpl
36{
37public:
38 InvalidArgumentExceptionImpl(std::string const& reason);
39
40 virtual char const* what() const noexcept override;
41};
42
43class LogicExceptionImpl : public ExceptionImpl
44{
45public:
46 LogicExceptionImpl(std::string const& reason);
47
48 virtual char const* what() const noexcept override;
49};
50
51class ShutdownExceptionImpl : public ExceptionImpl
52{
53public:
54 ShutdownExceptionImpl(std::string const& reason);
55
56 virtual char const* what() const noexcept override;
57};
58
59class FileExceptionImpl : public ExceptionImpl
60{
61public:
62 FileExceptionImpl(std::string const& reason, int err);
63
64 virtual char const* what() const noexcept override;
65 int error() const noexcept;
66
67private:
68 int errno_;
69};
70
71class SyscallExceptionImpl : public ExceptionImpl
72{
73public:
74 SyscallExceptionImpl(std::string const& reason, int err);
75
76 virtual char const* what() const noexcept override;
77 int error() const noexcept;
78
79private:
80 int const errno_;
81};
82
83class ResourceExceptionImpl : public ExceptionImpl
84{
85public:
86 ResourceExceptionImpl(std::string const& reason);
87
88 virtual char const* what() const noexcept override;
89};
90
91} // namespace internal
92
93} // namespace unity
94
95#endif
960
=== removed directory 'include/unity/scopes'
=== removed file 'include/unity/scopes/CMakeLists.txt'
--- include/unity/scopes/CMakeLists.txt 2013-04-22 18:14:52 +0000
+++ include/unity/scopes/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
2file(GLOB internal_headers "${CMAKE_CURRENT_SOURCE_DIR}/internal/*.h")
3
4install(FILES ${headers} DESTINATION include/unity/scopes)
5
6set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
70
=== removed directory 'include/unity/scopes/internal'
=== removed directory 'include/unity/util'
=== removed file 'include/unity/util/CMakeLists.txt'
--- include/unity/util/CMakeLists.txt 2013-04-22 18:14:52 +0000
+++ include/unity/util/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
2file(GLOB internal_headers "${CMAKE_CURRENT_SOURCE_DIR}/internal/*.h")
3
4install(FILES ${headers} DESTINATION ${HDR_INSTALL_DIR}/unity/util)
5
6set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
70
=== removed file 'include/unity/util/Daemon.h'
--- include/unity/util/Daemon.h 2013-04-08 03:05:05 +0000
+++ include/unity/util/Daemon.h 1970-01-01 00:00:00 +0000
@@ -1,129 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_UTIL_DAEMON_H
20#define UNITY_UTIL_DAEMON_H
21
22#include <unity/util/DefinesPtrs.h>
23#include <unity/util/NonCopyable.h>
24
25#include <sys/types.h>
26
27namespace unity
28{
29
30namespace util
31{
32
33namespace internal
34{
35class DaemonImpl;
36}
37
38/**
39\class Daemon
40\brief Helper class to turn a process into a daemon.
41
42To turn a process into a daemon, instantiate this class and call daemonize_me().
43
44The new process becomes a session leader without a control terminal. The standard
45file descriptors (<code>stdin</code>, <code>stdout</code>, and stderr) are closed
46and re-opened to <code>/dev/null</code>.
47
48By default, any file descriptors (other than the standard three) that are open in the process
49remain open to the same destinations in the daemon. If you want to have other descriptors closed, call
50close_fds() before calling daemonize_me(). This will close all file descriptors > 2.
51
52By default, the signal disposition of the daemon is unchanged. To reset all signals to their
53default disposition, call reset_signals() before calling daemonize_me().
54
55By default, the umask of the daemon is unchanged. To set a different umask, call set_umask()
56before calling daemonize_me().
57
58By default, the working directory of the daemon is unchanged. To run the daemon with a different
59working directory, call set_working_dir() before calling daemonize_me(). Note that the working
60directory should be set to a path that is in the root file system. If the working directory
61is in any other file system, that file system cannot be unmounted while the daemon is running.
62
63Note: This class is not async signal-safe. Do not call daemonize_me() from a a signal handler.
64*/
65
66class UNITY_API Daemon final : public util::DefinesPtrs<Daemon>, private NonCopyable
67{
68public:
69 /**
70 \brief Create a Daemon instance.
71 \return A <code>unique_ptr</code> to the instance.
72 */
73 static UPtr create();
74
75 /**
76 \brief Causes daemonize_me() to close all open file descriptors other than the standard file
77 descriptors (which are connected <code>/dev/null</code>).
78 */
79 void close_fds() noexcept;
80
81 /**
82 \brief Causes daemonize_me() to reset all signals to their default behavior.
83 */
84 void reset_signals() noexcept;
85
86 /**
87 \brief Causes daemonize_me() to set the umask.
88 \param mask The umask for the daemon process.
89 */
90 void set_umask(mode_t mask) noexcept;
91
92 /**
93 \brief Causes daemonize_me() to set the working directory.
94 \param working_directory The working directory for the daemon process.
95 \throws SyscallException The process could not change the working directory to the specified directory.
96 \note Daemon processes should set their working to "/" or to a directory that is part of the root file system.
97 Otherwise, the file system containing the daemon's working directory cannot be unmounted without first
98 killing the daemon process.
99 */
100 void set_working_directory(std::string const& working_directory);
101
102 /**
103 \brief Turns the calling process into a daemon.
104
105 By default, daemonize_me() leaves open file descriptors, signal disposition, umask, and working
106 directory unchanged. Call the corresponding member function before calling daemonize_me() to
107 change this behavior as appropriate.
108
109 \note Calling daemonize_me() more than once is safe; any changes to file descriptors, signal disposition,
110 umask, or working directory as requested by calling the other member functions will be correctly set
111 for the calling process. However, daemonize_me() is not a cheap call because it calls <code>fork()</code>;
112 the normal use pattern is to create a Daemon instance, select the desired settings, call daemonize_me(),
113 and let the instance go out of scope.
114 */
115 void daemonize_me();
116
117 ~Daemon() noexcept;
118
119private:
120 Daemon(); // Class is final, instantiation only via create()
121
122 std::unique_ptr<internal::DaemonImpl> p_;
123};
124
125} // namespace util
126
127} // namespace unity
128
129#endif
1300
=== removed file 'include/unity/util/DefinesPtrs.h'
--- include/unity/util/DefinesPtrs.h 2013-04-09 02:00:18 +0000
+++ include/unity/util/DefinesPtrs.h 1970-01-01 00:00:00 +0000
@@ -1,89 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_UTIL_DEFINESPTRS_H
20#define UNITY_UTIL_DEFINESPTRS_H
21
22#include <memory>
23
24namespace unity
25{
26
27namespace util
28{
29
30/**
31\brief Helper template to inject smart pointer definitions into a class.
32
33This template injects type definitions for smart pointer types into a class. It is useful to
34establish a common naming convention for smart pointers across a project.
35
36You can use the template as follows. Note that the template parameter is the name of the class
37being defined ("curiously recurring template pattern").
38
39~~~
40* class MyClass : public util::DefinesPtrs<MyClass>
41* {
42* public:
43* // MyClass now provides public typedefs for SPtr, SCPtr, UPtr, and UCPtr.
44* // ...
45* };
46~~~
47
48Callers of <code>MyClass</code> can now, for example, write
49
50~~~
51* MyClass::UPtr p(new MyClass);
52~~~
53
54*/
55
56template <typename T>
57class DefinesPtrs
58{
59public:
60 /**
61 A <code>std::shared_ptr</code> to a non-constant instance.
62 */
63 typedef std::shared_ptr<T> SPtr;
64
65 /**
66 A <code>std::shared_ptr</code> to a constant instance.
67 */
68 typedef std::shared_ptr<T const> SCPtr;
69
70 /**
71 A <code>std::unique_ptr</code> to a non-constant instance.
72 */
73 typedef std::unique_ptr<T> UPtr;
74
75 /**
76 A <code>std::unique_ptr</code> to a constant instance.
77 */
78 typedef std::unique_ptr<T const> UCPtr;
79
80protected: // Not meant to be instantiated stand-alone
81 DefinesPtrs() = default;
82 virtual ~DefinesPtrs() = default;
83};
84
85} // namespace util
86
87} // namespace unity
88
89#endif
900
=== removed file 'include/unity/util/FileIO.h'
--- include/unity/util/FileIO.h 2013-04-08 03:05:05 +0000
+++ include/unity/util/FileIO.h 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_UTIL_FILEIO_H
20#define UNITY_UTIL_FILEIO_H
21
22#include <unity/config.h>
23
24#include <string>
25#include <vector>
26
27namespace unity
28{
29
30namespace util
31{
32
33UNITY_API std::string read_text_file(std::string const& filename);
34UNITY_API std::vector<uint8_t> read_binary_file(std::string const& filename);
35
36} // namespace util
37
38} // namespace unity
39
40#endif
410
=== removed file 'include/unity/util/NonCopyable.h'
--- include/unity/util/NonCopyable.h 2013-04-08 03:05:05 +0000
+++ include/unity/util/NonCopyable.h 1970-01-01 00:00:00 +0000
@@ -1,89 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19//
20// Simple class to disable copy and assignment. (Provided here to avoid having to use
21// the equivalent boost version.)
22//
23// Use like this:
24//
25// class MyClass : private util::NonCopyable
26// {
27// // ...
28// };
29//
30
31#ifndef UNITY_UTIL_NONCOPYABLE_H
32#define UNITY_UTIL_NONCOPYABLE_H
33
34#include <unity/config.h>
35
36namespace unity
37{
38
39namespace util
40{
41
42namespace NonCopyable_ // Prevent unintended ADL
43{
44
45/**
46\brief Helper class to prevent a class from being copied.
47
48This class disables the copy constructor and assignment operator of a class to prevent it from being copied.
49This makes the fact that a class is not copyable immediately visible on reading the class definition,
50rather than having to read through the entire class to look for a copy constructor and assignment operator
51in the private section, or having to look for <code> = delete;</code> on the corresponding definitions.
52
53To use the class, use private inheritance:
54~~~
55* class MyClass : private unity::util::NonCopyable
56* {
57* public:
58* // MyClass cannot be copied now
59* // ...
60* };
61~~~
62
63\note Do not use public or protected inheritance for this class. Private inheritance prevents accidental polymorphism, such as
64~~~
65* void some_method(NonCopyable& param); // Bad, permits unrelated classes to be passed
66~~~
67
68*/
69
70class UNITY_API NonCopyable
71{
72protected:
73 NonCopyable() = default;
74 ~NonCopyable() = default;
75
76private:
77 NonCopyable(NonCopyable const&) = delete;
78 NonCopyable& operator=(NonCopyable const&) = delete;
79};
80
81} // namespace NonCopyable_
82
83typedef NonCopyable_::NonCopyable NonCopyable;
84
85} // namespace util
86
87} // namespace unity
88
89#endif
900
=== removed directory 'include/unity/util/internal'
=== removed file 'include/unity/util/internal/DaemonImpl.h'
--- include/unity/util/internal/DaemonImpl.h 2013-04-04 02:16:16 +0000
+++ include/unity/util/internal/DaemonImpl.h 1970-01-01 00:00:00 +0000
@@ -1,67 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_UTIL_DAEMONIMPL_H
20#define UNITY_UTIL_DAEMONIMPL_H
21
22#include <unity/UnityExceptions.h>
23#include <unity/util/NonCopyable.h>
24
25#include <sys/types.h>
26
27#include <string>
28
29namespace unity
30{
31
32namespace util
33{
34
35namespace internal
36{
37
38class DaemonImpl final : private NonCopyable
39{
40public:
41 DaemonImpl();
42 ~DaemonImpl() = default;
43
44 void close_fds() noexcept;
45 void reset_signals() noexcept;
46 void set_umask(mode_t mask) noexcept;
47 void set_working_directory(std::string const& working_directory);
48
49 void daemonize_me();
50
51private:
52 bool close_fds_;
53 bool reset_signals_;
54 bool set_umask_;
55 mode_t umask_;
56 std::string working_directory_;
57
58 void close_open_files() noexcept;
59};
60
61} // namespace internal
62
63} // namespace util
64
65} // namespace unity
66
67#endif
680
=== removed file 'include/unity/util/internal/ResourcePtr.h'
--- include/unity/util/internal/ResourcePtr.h 2013-04-10 03:39:55 +0000
+++ include/unity/util/internal/ResourcePtr.h 1970-01-01 00:00:00 +0000
@@ -1,793 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#ifndef UNITY_UTIL_INTERNAL_RESOURCEPTR_H
20#define UNITY_UTIL_INTERNAL_RESOURCEPTR_H
21
22#include <unity/util/NonCopyable.h>
23
24#include <boost/type_traits.hpp>
25
26#include <mutex>
27
28namespace unity
29{
30
31namespace util
32{
33
34namespace internal
35{
36
37namespace
38{
39
40// Simple helper class so we can adopt a lock without inconvenient syntax.
41
42template<typename T>
43class LockAdopter
44{
45public:
46 LockAdopter(T& mutex) noexcept
47 : m_(mutex, std::adopt_lock)
48 {
49 assert(!mutex.try_lock()); // Mutex must be locked to be adoptable.
50 }
51
52private:
53 std::unique_lock<T> m_;
54};
55
56} // namespace
57
58/**
59\brief Class to guarantee deallocation of arbitrary resources.
60
61ResourcePtr is a generalized resource pointer that guarantees deallocation.
62It is intended for arbitrary pairs of allocate/deallocate functions, such
63as <code>XCreateDisplay</code>/<code>XDestroyDisplay</code>.
64
65The resource managed by this class must be default-constructible, copy-constructible, and assignable.
66
67ResourcePtr essentially does what <code>std::unique_ptr</code> does, but it works with opaque types
68and resource allocation functions that do not return a pointer type, such as <code>open()</code>.
69
70ResourcePtr is thread-safe.
71
72\note Do not use reset() to set the resource to the "no resource allocated" state.
73 Instead, call dealloc() to do this. ResourcePtr has no idea
74 what a "not allocated" resource value looks like and therefore cannot test
75 for it. If you use reset() to install a "no resource allocated" value for
76 for the resource, the deleter will eventually be called with this value
77 as its argument. Whether this is benign or not depends on the deleter. For
78 example, <code>XFree()</code> must not be called with a <code>nullptr</code> argument.
79
80\note Do not call get() or release() if no resource is currently allocated.
81 Doing so throws <code>std::logic_error</code>.
82
83Here is an example that shows how to use this for a <code>glXCreateContext</code>/<code>GLXDestroyContext</code> pair.
84The returned <code>GLXContext</code> is a pointer to an opaque type; <code>std::unique_ptr</code> cannot be used
85for this, even with a custom deleter, because the signatures of the allocator and deallocator
86do not match <code>unique_ptr</code>'s expectations.
87
88~~~
89ResourcePtr<GLXContext, std::function<void(GLXContext)>> context =
90 std::bind(&glXDestroyContext, display_, std::placeholders::_1);
91~~~
92
93display_ is declared as
94
95~~~
96 Display* display_;
97~~~
98
99in this case.
100
101The deleter for the resource can return any type (including int, such as returned by <code>XDestroyWindow()</code>),
102and it must accept a single argument of the resource type (<code>GLXContext</code> in this example).
103
104<code>glXDestroyContext()</code> expects the display pointer as the first argument so, for this example,
105<code>std::bind</code> converts the binary <code>glXDestroyContext()</code> function into a
106unary function suitable as the deleter.
107
108Rather than mucking around with <code>std::bind</code>, it is often easier to use a lambda. For example:
109
110~~~
111ResourcePtr<GLXContext, std::function<void(GLXContext)>> context =
112 [this](GLXContext c) { this->dealloc_GLXContext(c); };
113~~~
114
115This calls a member function <code>dealloc_GLXContext()</code> that, in turn calls <code>glXDestroyContext()</code>
116and supplies the display parameter.
117
118\note Even though you can use ResourcePtr to deallocate dynamic memory, doing so is discouraged.
119Use <code>std::unique_ptr</code> instead, which is better suited to the task.
120*/
121
122// TODO: Discuss throwing deleters and requirements (copy constructible, etc.) on deleter.
123
124template<typename R, typename D>
125class ResourcePtr final : private NonCopyable
126{
127public:
128 /**
129 \typedef element_type
130 The type of resource managed by this ResourcePtr.
131 */
132 typedef R element_type;
133
134 /**
135 \typedef deleter_type
136 A function object or lvalue reference to a function or function object. The ResourcePtr
137 calls this to deallocate the resource.
138 */
139 typedef D deleter_type;
140
141 explicit ResourcePtr(D d);
142 ResourcePtr(R r, D d);
143 ResourcePtr(ResourcePtr&& r);
144 ResourcePtr& operator=(ResourcePtr&& r);
145 ~ResourcePtr() noexcept;
146
147 void swap(ResourcePtr& other);
148
149 void reset(R r);
150 R release();
151 void dealloc();
152
153 R get() const;
154 bool has_resource() const noexcept;
155 explicit operator bool() const noexcept;
156 D& get_deleter() noexcept;
157 D const& get_deleter() const noexcept;
158
159 typename std::enable_if<boost::has_equal_to<R>::value, bool>::type
160 operator==(ResourcePtr const& rhs) const;
161
162 typename std::enable_if<boost::has_equal_to<R>::value, bool>::type
163 operator!=(ResourcePtr const& rhs) const;
164
165 typename std::enable_if<boost::has_less<R>::value, bool>::type
166 operator<(ResourcePtr const& rhs) const;
167
168 typename std::enable_if<boost::has_less<R>::value &&
169 boost::has_equal_to<R>::value, bool>::type
170 operator<=(ResourcePtr const& rhs) const;
171
172 typename std::enable_if<boost::has_less<R>::value &&
173 boost::has_equal_to<R>::value, bool>::type
174 operator>(ResourcePtr const& rhs) const;
175
176 typename std::enable_if<boost::has_less<R>::value, bool>::type
177 operator>=(ResourcePtr const& rhs) const;
178
179private:
180 R resource_; // The managed resource.
181 D delete_; // The deleter to call.
182 bool initialized_; // True while we have a resource assigned.
183 mutable std::mutex m_; // Protects this instance.
184
185 typedef std::lock_guard<decltype(m_)> AutoLock;
186 typedef LockAdopter<decltype(m_)> AdoptLock;
187};
188
189/**
190Constructs a ResourcePtr with the specified deleter. No resource is held, so a call to has_resource()
191after constructing a ResourcePtr this way returns <code>false</code>.
192*/
193
194template<typename R, typename D>
195ResourcePtr<R, D>::
196ResourcePtr(D d)
197 : delete_(d), initialized_(false)
198{
199}
200
201/**
202Constructs a ResourcePtr with the specified resource and deleter. has_resource() returns <code>true</code> after
203calling this constructor.
204
205\note It is legal to pass a resource that represents the "not allocated" state. For example, the
206 following code passes the value <code>-1</code> to <code>close()</code> if the call to <code>open()</code> fails:
207
208~~~
209ResourcePtr<int, decltype(&::close)> fd(::open("/somefile", O_RDONLY), ::close);
210~~~
211 When the ResourcePtr goes out of scope, this results in a call to <code>close(-1)</code>. In this case,
212 the call with an invalid file descriptor is harmless (but causes noise from diagnostic tools, such as
213 <code>valgrind</code>). However, depending on the specific deleter, passing an invalid value to the deleter may
214 have more serious consequences.
215
216 To avoid the problem, you can delay initialization of the ResourcePtr until you know that the
217 resource was successfully allocated, for example:
218~~~
219 int tmp_fd = ::open(filename.c_str(), O_RDONLY);
220 if (tmp_fd == -1)
221 {
222 throw FileException(filename.c_str());
223 }
224 util::internal::ResourcePtr<int, decltype(&::close)> fd(tmp_fd, ::close(fd));
225~~~
226 Alternatively, you can use a deleter function that tests the resource value
227 for validity and avoids calling the deleter with an invalid value:
228~~~
229 util::internal::ResourcePtr<int, std::function<void(int)>> fd(
230 ::open(filename.c_str(), O_RDONLY),
231 [](int fd) { if (fd != -1) ::close(fd); }
232 );
233~~~
234 Note that, with the second approach, a call to get() will succeed and return -1 rather than throwing an
235 exception, so the first approach is the recommended one.
236*/
237
238template<typename R, typename D>
239ResourcePtr<R, D>::
240ResourcePtr(R r, D d)
241 : resource_(r), delete_(d), initialized_(true)
242{
243}
244
245/**
246Constructs a ResourcePtr by transferring ownership from <code>r</code> to <code>this</code>.
247
248If the resource's move or copy constructor throws, the exception is propagated to the caller.
249The strong exception guarantee is preserved if it is provided by the resource.
250*/
251// TODO: Mark as nothrow if the resource has a nothrow move constructor or nothrow copy constructor
252
253template<typename R, typename D>
254ResourcePtr<R, D>::
255ResourcePtr(ResourcePtr<R, D>&& r)
256 : resource_(std::move(r.resource_)), delete_(r.delete_), initialized_(r.initialized_)
257{
258 r.initialized_ = false; // Stop r from deleting its resource, if it held any. No need to lock: r is a temporary.
259}
260
261/**
262Assigns the resource held by <code>r</code>, transferring ownership. After the transfer,
263<code>r.has_resource()</code> returns <code>false</code>, and <code>this.has_resource()</code> returns
264the value of <code>r.has_resource()</code> prior to the assignment.
265*/
266// TODO: document exception safety behavior
267
268template<typename R, typename D>
269ResourcePtr<R, D>&
270ResourcePtr<R, D>::
271operator=(ResourcePtr&& r)
272{
273 AutoLock lock(m_);
274
275 if (initialized_) // If we hold a resource, deallocate it first.
276 {
277 initialized_ = false; // If the deleter throws, we will not try it again for the same resource.
278 delete_(resource_); // Delete our own resource.
279 }
280
281 // r is a temporary, so we don't need to lock it.
282
283 resource_ = std::move(r.resource_);
284 initialized_ = r.initialized_;
285 r.initialized_ = false; // Stop r from deleting its resource, if it held any.
286 delete_ = r.delete_;
287
288 return *this;
289}
290
291/**
292Destroys the ResourcePtr. If a resource is held, it calls the deleter for the current resource (if any).
293*/
294
295template<typename R, typename D>
296ResourcePtr<R, D>::
297~ResourcePtr() noexcept
298{
299 try
300 {
301 dealloc();
302 }
303 catch (...)
304 {
305 }
306}
307
308/**
309Swaps the resource and deleter of <code>this</code> with the resource and deleter of <code>other</code>
310using argument dependent lookup (ADL).
311
312If the underlying swap throws an exception, that exception is propagated to the caller, and the resource
313held by the ResourcePtr is unchanged.
314*/
315// TODO Split this into throw and no-throw versions depending on the underlying swap?
316
317template<typename R, typename D>
318void
319ResourcePtr<R, D>::
320swap(ResourcePtr& other)
321{
322 if (this == &other) // This is necessary to avoid deadlock for self-swap
323 {
324 return;
325 }
326
327 std::lock(m_, other.m_);
328 AdoptLock left(m_);
329 AdoptLock right(other.m_);
330
331 using std::swap; // Enable ADL
332 swap(resource_, other.resource_);
333 swap(delete_, other.delete_);
334 swap(initialized_, other.initialized_);
335}
336
337// The non-member swap() must be in the same namespace as ResourcePtr, so it will work with ADL. And, once it is
338// defined here, there is no point in adding a specialization to namespace std any longer, because ADL
339// will find it here anyway.
340
341/**
342Swaps the resource and deleter of <code>lhs</code> with the resource and deleter of <code>rhs</code>
343by calling <code>lhs.swap(rhs)</code>.
344
345If the underlying swap throws an exception, that exception is propagated to the caller, and the resource
346held by the ResourcePtr is unchanged.
347*/
348// TODO Split this into throw and no-throw versions depending on the underlying swap?
349
350template<typename R, typename D>
351void
352swap(unity::util::internal::ResourcePtr<R, D>& lhs, unity::util::internal::ResourcePtr<R, D>& rhs)
353{
354 lhs.swap(rhs);
355}
356
357/**
358Assigns a new resource to <code>this</code>, first deallocating the current resource (if any).
359
360If the deleter for the current resource throws an exception, the exception is propagated to the caller. In this
361case, the transfer of <code>r</code> to <code>this</code> is still carried out so, after the call to reset(),
362<code>this</code> manages <code>r</code>, whether the deleter throws or not. (If the deleter <i>does</i> throw,
363no attempt is made to call the deleter again for the same resource.)
364*/
365
366template<typename R, typename D>
367void
368ResourcePtr<R, D>::
369reset(R r)
370{
371 AutoLock lock(m_);
372
373 bool has_old = initialized_;
374 R old_resource;
375
376 if (has_old)
377 {
378 old_resource = resource_;
379 }
380 resource_ = r;
381 initialized_ = true; // If the deleter throws, we still satisfy the postcondition: resource_ == r.
382 if (has_old)
383 {
384 delete_(old_resource);
385 }
386}
387
388/**
389Releases ownership of the current resource without calling the deleter.
390\return The current resource.
391\throw std::logic_error if has_resource() is false.
392*/
393
394template<typename R, typename D>
395inline
396R
397ResourcePtr<R, D>::
398release()
399{
400 AutoLock lock(m_);
401
402 if (!initialized_)
403 {
404 throw std::logic_error("release() called on ResourcePtr without resource");
405 }
406 initialized_ = false;
407 return resource_;
408}
409
410/**
411Calls the deleter for the current resource.
412
413If the deleter throws, the resource is considered in the "not allocated" state,
414that is, no attempt is made to call the deleter again for this resource.
415*/
416
417template<typename R, typename D>
418void
419ResourcePtr<R, D>::
420dealloc()
421{
422 AutoLock lock(m_);
423
424 if (!initialized_)
425 {
426 return;
427 }
428 initialized_ = false; // If the deleter throws, we will not try it again for the same resource.
429 delete_(resource_);
430}
431
432/**
433Returns the current resource. If no resource is currently held, get() throws <code>std::logic_error</code>.
434\return The current resource (if any).
435
436If the resource's copy constructor throws an exception, that exception is propagated to the caller.
437
438\throw std::logic_error if has_resource() is false.
439*/
440
441template<typename R, typename D>
442inline
443R
444ResourcePtr<R, D>::
445get() const
446{
447 AutoLock lock(m_);
448
449 if (!initialized_)
450 {
451 throw std::logic_error("get() called on ResourcePtr without resource");
452 }
453 return resource_;
454}
455
456/**
457\return <code>true</code> if <code>this</code> currently manages a resource; <code>false</code>, otherwise.
458*/
459
460template<typename R, typename D>
461inline
462bool
463ResourcePtr<R, D>::
464has_resource() const noexcept
465{
466 AutoLock lock(m_);
467 return initialized_;
468}
469
470/**
471Synonym for has_resource().
472*/
473
474template<typename R, typename D>
475inline
476ResourcePtr<R, D>::
477operator bool() const noexcept
478{
479 return has_resource();
480}
481
482/**
483\return The deleter for the resource.
484*/
485
486template<typename R, typename D>
487inline
488D&
489ResourcePtr<R, D>::
490get_deleter() noexcept
491{
492 AutoLock lock(m_);
493 return delete_;
494}
495
496/**
497\return The deleter for the resource.
498*/
499
500template<typename R, typename D>
501inline
502D const&
503ResourcePtr<R, D>::
504get_deleter() const noexcept
505{
506 AutoLock lock(m_);
507 return delete_;
508}
509
510/**
511\brief Compares two instances for equality by calling the corresponding operator on the resource.
512
513Two instances that do not hold a resource are equal. An instance that does not hold a resource is not equal
514to any instance that holds a resource.
515
516If the underlying operator throws an exception, that exception is propagated to the caller.
517
518\note This operator is available only if the underlying resource provides <code>operator==</code>.
519*/
520
521template<typename R, typename D>
522typename std::enable_if<boost::has_equal_to<R>::value, bool>::type
523ResourcePtr<R, D>::
524operator==(ResourcePtr<R, D> const& rhs) const
525{
526 if (this == &rhs) // This is necessary to avoid deadlock for self-comparison
527 {
528 return true;
529 }
530
531 std::lock(m_, rhs.m_);
532 AdoptLock left(m_);
533 AdoptLock right(rhs.m_);
534
535 if (!initialized_)
536 {
537 return !rhs.initialized_; // Equal if both are not initialized
538 }
539 else if (!rhs.initialized_)
540 {
541 return false; // Not equal if lhs initialized, but rhs not initialized
542 }
543 else
544 {
545 return resource_ == rhs.resource_;
546 }
547}
548
549/**
550\brief Compares two instances for inequality by calling the corresponding operator on the resource.
551
552If the underlying operator throws an exception, that exception is propagated to the caller.
553
554\note This operator is available only if the underlying resource provides <code>operator!=</code>.
555*/
556
557template<typename R, typename D>
558inline
559typename std::enable_if<boost::has_equal_to<R>::value, bool>::type
560ResourcePtr<R, D>::
561operator!=(ResourcePtr<R, D> const& rhs) const
562{
563 return !(*this == rhs);
564}
565
566/**
567\brief Returns <code>true</code> if <code>this</code> is less than <code>rhs</code> by calling the
568corresponding operator on the resource.
569
570An instance that does not hold a resource is less than any instance that holds a resource.
571
572If the underlying operator throws an exception, that exception is propagated to the caller.
573
574\note This operator is available only if the underlying resource provides <code>operator\<</code>.
575*/
576
577template<typename R, typename D>
578typename std::enable_if<boost::has_less<R>::value, bool>::type
579ResourcePtr<R, D>::
580operator<(ResourcePtr<R, D> const& rhs) const
581{
582 if (this == &rhs) // This is necessary to avoid deadlock for self-comparison
583 {
584 return false;
585 }
586
587 std::lock(m_, rhs.m_);
588 AdoptLock left(m_);
589 AdoptLock right(rhs.m_);
590
591 if (!initialized_)
592 {
593 return rhs.initialized_; // Not initialized is less than initialized
594 }
595 else if (!rhs.initialized_) // Initialized is not less than not initialized
596 {
597 return false;
598 }
599 else
600 {
601 return resource_ < rhs.resource_;
602 }
603}
604
605/**
606\brief Returns <code>true</code> if <code>this</code> is less than or equal to <code>rhs</code> by calling the
607corresponding operator on the resource.
608
609An instance that does not hold a resource is less than any instance that holds a resource.
610Two instances that do not hold a resource are equal.
611
612If the underlying operator throws an exception, that exception is propagated to the caller.
613
614\note This operator is available only if the underlying resource provides <code>operator\<=</code>.
615*/
616
617template<typename R, typename D>
618typename std::enable_if<boost::has_less<R>::value && boost::has_equal_to<R>::value, bool>::type
619ResourcePtr<R, D>::
620operator<=(ResourcePtr<R, D> const& rhs) const
621{
622 if (this == &rhs) // This is necessary to avoid deadlock for self-comparison
623 {
624 return true;
625 }
626
627 // We can't just write:
628 //
629 // return *this < rhs || *this == rhs;
630 //
631 // because that creates a race condition: the locks would be released and
632 // re-aquired in between the two comparisons.
633
634 std::lock(m_, rhs.m_);
635 AdoptLock left(m_);
636 AdoptLock right(rhs.m_);
637
638 return resource_ < rhs.resource_ || resource_ == rhs.resource_;
639}
640
641/**
642\brief Returns <code>true</code> if <code>this</code> is greater than <code>rhs</code> by calling the
643corresponding operator on the resource.
644
645An instance that holds a resource is greater than any instance that does not hold a resource.
646
647If the underlying operator throws an exception, that exception is propagated to the caller.
648
649\note This operator is available only if the underlying resource provides <code>operator\></code>.
650*/
651
652template<typename R, typename D>
653inline
654typename std::enable_if<boost::has_less<R>::value && boost::has_equal_to<R>::value, bool>::type
655ResourcePtr<R, D>::
656operator>(ResourcePtr<R, D> const& rhs) const
657{
658 return !(*this <= rhs);
659}
660
661/**
662\brief Returns <code>true</code> if <code>this</code> is greater than or equal to <code>rhs</code> by calling the
663corresponding operator on the resource.
664
665An instance that holds a resource is greater than any instance that does not hold a resource.
666Two instances that do not hold a resource are equal.
667
668If the underlying operator throws an exception, that exception is propagated to the caller.
669
670\note This operator is available only if the underlying resource provides <code>operator\>=</code>.
671*/
672
673template<typename R, typename D>
674inline
675typename std::enable_if<boost::has_less<R>::value, bool>::type
676ResourcePtr<R, D>::
677operator>=(ResourcePtr<R, D> const& rhs) const
678{
679 return !(*this < rhs);
680}
681
682} // namespace internal
683
684} // namespace util
685
686} // namespace unity
687
688// Specializations in namespace std, so we play nicely with STL and metaprogramming.
689
690namespace std
691{
692
693/**
694\brief Function object for equality comparison.
695*/
696
697template<typename R, typename D>
698struct equal_to<unity::util::internal::ResourcePtr<R, D>>
699{
700 /**
701 Invokes <code>operator==</code> on <code>lhs</code>.
702 */
703 bool operator()(unity::util::internal::ResourcePtr<R, D> const& lhs, unity::util::internal::ResourcePtr<R, D> const& rhs) const
704 {
705 return lhs == rhs;
706 }
707};
708
709/**
710\brief Function object for inequality comparison.
711*/
712
713template<typename R, typename D>
714struct not_equal_to<unity::util::internal::ResourcePtr<R, D>>
715{
716 /**
717 Invokes <code>operator!=</code> on <code>lhs</code>.
718 */
719 bool operator()(unity::util::internal::ResourcePtr<R, D> const& lhs, unity::util::internal::ResourcePtr<R, D> const& rhs) const
720 {
721 return lhs != rhs;
722 }
723};
724
725/**
726\brief Function object for less than comparison.
727*/
728
729template<typename R, typename D>
730struct less<unity::util::internal::ResourcePtr<R, D>>
731{
732 /**
733 Invokes <code>operator\<</code> on <code>lhs</code>.
734 */
735 bool operator()(unity::util::internal::ResourcePtr<R, D> const& lhs, unity::util::internal::ResourcePtr<R, D> const& rhs) const
736 {
737 return lhs < rhs;
738 }
739};
740
741/**
742\brief Function object for less than or equal comparison.
743*/
744
745template<typename R, typename D>
746struct less_equal<unity::util::internal::ResourcePtr<R, D>>
747{
748 /**
749 Invokes <code>operator\<=</code> on <code>lhs</code>.
750 */
751 bool operator()(unity::util::internal::ResourcePtr<R, D> const& lhs, unity::util::internal::ResourcePtr<R, D> const& rhs) const
752 {
753 return lhs <= rhs;
754 }
755};
756
757/**
758\brief Function object for greater than comparison.
759*/
760
761template<typename R, typename D>
762struct greater<unity::util::internal::ResourcePtr<R, D>>
763{
764 /**
765 Invokes <code>operator\></code> on <code>lhs</code>.
766 */
767 bool operator()(unity::util::internal::ResourcePtr<R, D> const& lhs, unity::util::internal::ResourcePtr<R, D> const& rhs) const
768 {
769 return lhs > rhs;
770 }
771};
772
773/**
774\brief Function object for less than or equal comparison.
775*/
776
777template<typename R, typename D>
778struct greater_equal<unity::util::internal::ResourcePtr<R, D>>
779{
780 /**
781 Invokes <code>operator\>=</code> on <code>lhs</code>.
782 */
783 bool operator()(unity::util::internal::ResourcePtr<R, D> const& lhs, unity::util::internal::ResourcePtr<R, D> const& rhs) const
784 {
785 return lhs >= rhs;
786 }
787};
788
789// TODO: provide hash if std::hash<R> exists.
790
791} // namespace std
792
793#endif
7940
=== removed directory 'src'
=== removed file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2013-04-22 18:14:52 +0000
+++ src/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
1add_subdirectory(unity)
2
3add_library(${UNITY_API_LIB} SHARED ${UNITY_API_LIB_SRC})
4set_target_properties(${UNITY_API_LIB} PROPERTIES
5 VERSION "${UNITY_API_MAJOR}.${UNITY_API_MINOR}"
6 SOVERSION "${UNITY_API_MAJOR}.${UNITY_API_MINOR}"
7)
8
9install(TARGETS ${UNITY_API_LIB} LIBRARY DESTINATION lib)
10
11configure_file(lib${UNITY_API_LIB}.pc.in lib${UNITY_API_LIB}.pc @ONLY)
12install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${UNITY_API_LIB}.pc DESTINATION lib/pkgconfig)
13
14set(UNITY_API_LIB_SRC ${UNITY_API_LIB_SRC} ${UNITY_SRC} PARENT_SCOPE)
150
=== removed file 'src/libunity-api.pc.in'
--- src/libunity-api.pc.in 2013-04-09 03:34:17 +0000
+++ src/libunity-api.pc.in 1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
1#
2# Copyright (C) 2013 Canonical Ltd
3#
4# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License version 3 as
6# published by the Free Software Foundation.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15#
16# Authored by: Michi Henning <michi.henning@canonical.com>
17#
18
19Name: lib@UNITY_API_LIB@
20Description: Unity API library
21Version: @UNITY_API_MAJOR@.@UNITY_API_MINOR@
22Libs: -L@CMAKE_INSTALL_PREFIX@/lib -lunity-api
23Cflags: -I@CMAKE_INSTALL_PREFIX@/include
240
=== removed directory 'src/unity'
=== removed file 'src/unity/CMakeLists.txt'
--- src/unity/CMakeLists.txt 2013-04-16 00:25:34 +0000
+++ src/unity/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1add_subdirectory(api)
2add_subdirectory(internal)
3add_subdirectory(util)
4
5set(UNITY_SRC
6 ${CMAKE_CURRENT_SOURCE_DIR}/Exception.cpp
7 ${CMAKE_CURRENT_SOURCE_DIR}/UnityExceptions.cpp
8)
9
10set(UNITY_API_LIB_SRC ${UNITY_API_LIB_SRC} ${UNITY_SRC} PARENT_SCOPE)
110
=== removed file 'src/unity/Exception.cpp'
--- src/unity/Exception.cpp 2013-04-17 02:18:48 +0000
+++ src/unity/Exception.cpp 1970-01-01 00:00:00 +0000
@@ -1,145 +0,0 @@
1/*
2 * Copyright (C) 2012 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/Exception.h>
20#include <unity/internal/ExceptionImpl.h>
21
22using namespace std;
23
24namespace unity
25{
26
27//! @cond
28
29Exception::
30Exception(shared_ptr<internal::ExceptionImpl> const& derived)
31 : p_(derived)
32{
33}
34
35Exception::
36Exception(Exception const&) = default;
37
38Exception&
39Exception::
40operator=(Exception const&) = default;
41
42Exception::
43~Exception() noexcept = default;
44
45//! @endcond
46
47/**
48\brief Returns the reason set by the derived class's constructor (empty string if none).
49
50Derived classes should include any other state information, such as the value of data members or
51other relevant detail in the <code>reason</code> string they pass to the protected constructor.
52*/
53
54string
55Exception::
56reason() const
57{
58 return p_->reason();
59}
60
61/**
62Returns a string describing the exception, including any exceptions that were nested or chained.
63
64Nested exceptions are indented according to their nesting level. If the exception contains chained
65exceptions, these are shown in oldest-to-newest order.
66
67\param indent This controls the amount of indenting per level. The default indent is four spaces.
68\return The string describing the exception.
69
70\note The default implementation of this member function calls <code>to_string(0, indent)</code>.
71*/
72
73string
74Exception::
75to_string(std::string const& indent) const
76{
77 return p_->to_string(*this, 0, indent);
78}
79
80/**
81Returns a string describing the exception, including any exceptions that were nested or chained.
82
83Nested exceptions are indented according to their nesting level. If the exception contains chained
84exceptions, these are shown in oldest-to-newest order.
85
86\param indent_level This controls the indent level. The value <code>0</code> indicates
87 the outermost level (no indent).
88\param indent This controls the amount of indenting per level. The passed string is prependended
89 <i><code>indent_level</code></i> times to each line.
90\return The string describing the exception.
91
92\note This member function has a default implementation, so derived classes do not need to override it
93 unless they want to change the formatting of the returned string.
94*/
95
96string
97Exception::
98to_string(int indent_level, std::string const& indent) const
99{
100 return p_->to_string(*this, indent_level, indent);
101}
102
103/**
104Adds an exception to the exception history chain.
105
106\param earlier_exception The parameter must be a <code>nullptr</code> or a <code>std::exception_ptr</code>
107to an exception that was remembered earlier. This allows a sequence of exceptions to be remembered without
108having to throw them and is useful for example, in shutdown scenarios where any one of a sequence of steps
109can fail, but we want to continue and try all the following steps and only throw after all of them have been
110tried. In this case, each step that fails can add itself to the sequence of remembered exceptions, and finally
111throw something like <code>ShutdownException</code>.
112\return A <code>std::exception_ptr</code> to <code>this</code>.
113*/
114
115exception_ptr
116Exception::
117remember(exception_ptr earlier_exception)
118{
119 return p_->remember(this, earlier_exception);
120}
121
122/**
123Returns the previous exception.
124\return Returns the next-older remembered exception, or <code>nullptr</code>, if none.
125*/
126
127exception_ptr
128Exception::
129get_earlier() const noexcept
130{
131 return p_->get_earlier();
132}
133
134//! @cond
135
136internal::ExceptionImpl*
137Exception::
138pimpl() const noexcept
139{
140 return p_.get();
141}
142
143//! @endcond
144
145} // namespace unity
1460
=== removed file 'src/unity/UnityExceptions.cpp'
--- src/unity/UnityExceptions.cpp 2013-04-04 02:16:16 +0000
+++ src/unity/UnityExceptions.cpp 1970-01-01 00:00:00 +0000
@@ -1,246 +0,0 @@
1/*
2 * Copyright (C) 2012 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/UnityExceptions.h>
20#include <unity/internal/UnityExceptionsImpl.h>
21
22using namespace std;
23
24namespace unity
25{
26
27InvalidArgumentException::
28InvalidArgumentException(string const& reason)
29 : Exception(make_shared<internal::InvalidArgumentExceptionImpl>(reason))
30{
31}
32
33InvalidArgumentException::
34InvalidArgumentException(InvalidArgumentException const&) = default;
35
36//! @cond
37
38InvalidArgumentException&
39InvalidArgumentException::
40operator=(InvalidArgumentException const&) = default;
41
42
43InvalidArgumentException::
44~InvalidArgumentException() noexcept = default;
45
46//! @endcond
47
48char const*
49InvalidArgumentException::
50what() const noexcept
51{
52 return dynamic_cast<internal::InvalidArgumentExceptionImpl*>(pimpl())->what();
53}
54
55exception_ptr
56InvalidArgumentException::
57self() const
58{
59 return make_exception_ptr(*this);
60}
61
62LogicException::
63LogicException(string const& reason)
64 : Exception(make_shared<internal::LogicExceptionImpl>(reason))
65{
66}
67
68LogicException::
69LogicException(LogicException const&) = default;
70
71//! @cond
72
73LogicException&
74LogicException::
75operator=(LogicException const&) = default;
76
77LogicException::
78~LogicException() noexcept = default;
79
80//! @endcond
81
82char const*
83LogicException::
84what() const noexcept
85{
86 return dynamic_cast<internal::LogicExceptionImpl*>(pimpl())->what();
87}
88
89exception_ptr
90LogicException::
91self() const
92{
93 return make_exception_ptr(*this);
94}
95
96ShutdownException::
97ShutdownException(string const& reason)
98 : Exception(make_shared<internal::ShutdownExceptionImpl>(reason))
99{
100}
101
102ShutdownException::
103ShutdownException(ShutdownException const&) = default;
104
105//! @cond
106
107ShutdownException&
108ShutdownException::
109operator=(ShutdownException const&) = default;
110
111ShutdownException::
112~ShutdownException() noexcept = default;
113
114//! @endcond
115
116char const*
117ShutdownException::
118what() const noexcept
119{
120 return dynamic_cast<internal::ShutdownExceptionImpl*>(pimpl())->what();
121}
122
123exception_ptr
124ShutdownException::
125self() const
126{
127 return make_exception_ptr(*this);
128}
129
130FileException::
131FileException(string const& reason, int err)
132 : Exception(make_shared<internal::FileExceptionImpl>(reason, err))
133{
134}
135
136FileException::
137FileException(FileException const&) = default;
138
139//! @cond
140
141FileException&
142FileException::
143operator=(FileException const&) = default;
144
145FileException::
146~FileException() noexcept = default;
147
148//! @endcond
149
150char const*
151FileException::
152what() const noexcept
153{
154 return dynamic_cast<internal::FileExceptionImpl*>(pimpl())->what();
155}
156
157int
158FileException::
159error() const noexcept
160{
161 return dynamic_cast<internal::FileExceptionImpl*>(pimpl())->error();
162}
163
164exception_ptr
165FileException::
166self() const
167{
168 return make_exception_ptr(*this);
169}
170
171SyscallException::
172SyscallException(string const& reason, int err)
173 : Exception(make_shared<internal::SyscallExceptionImpl>(reason, err))
174{
175}
176
177SyscallException::
178SyscallException(SyscallException const&) = default;
179
180//! @cond
181
182SyscallException&
183SyscallException::
184operator=(SyscallException const&) = default;
185
186SyscallException::
187~SyscallException() noexcept = default;
188
189//! @endcond
190
191char const*
192SyscallException::
193what() const noexcept
194{
195 return dynamic_cast<internal::SyscallExceptionImpl*>(pimpl())->what();
196}
197
198int
199SyscallException::
200error() const noexcept
201{
202 return dynamic_cast<internal::SyscallExceptionImpl*>(pimpl())->error();
203}
204
205exception_ptr
206SyscallException::
207self() const
208{
209 return make_exception_ptr(*this);
210}
211
212ResourceException::
213ResourceException(string const& reason)
214 : Exception(make_shared<internal::ResourceExceptionImpl>(reason))
215{
216}
217
218ResourceException::
219ResourceException(ResourceException const&) = default;
220
221//! @cond
222
223ResourceException&
224ResourceException::
225operator=(ResourceException const&) = default;
226
227ResourceException::
228~ResourceException() noexcept = default;
229
230//! @endcond
231
232char const*
233ResourceException::
234what() const noexcept
235{
236 return dynamic_cast<internal::ResourceExceptionImpl*>(pimpl())->what();
237}
238
239exception_ptr
240ResourceException::
241self() const
242{
243 return make_exception_ptr(*this);
244}
245
246} // namespace unity
2470
=== removed directory 'src/unity/api'
=== removed file 'src/unity/api/CMakeLists.txt'
--- src/unity/api/CMakeLists.txt 2013-04-16 00:25:34 +0000
+++ src/unity/api/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1add_subdirectory(internal)
2add_subdirectory(scopes)
3
4set(API_SRC
5 ${CMAKE_CURRENT_SOURCE_DIR}/Version.cpp
6)
7
8set(UNITY_API_LIB_SRC ${UNITY_API_LIB_SRC} ${API_SRC} PARENT_SCOPE)
90
=== removed file 'src/unity/api/Version.cpp'
--- src/unity/api/Version.cpp 2013-04-04 02:16:16 +0000
+++ src/unity/api/Version.cpp 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/api/Version.h>
20
21using namespace std;
22
23namespace unity
24{
25
26namespace api
27{
28
29int
30Version::
31major_version()
32{
33 return UNITY_API_VERSION_MAJOR;
34}
35
36int
37Version::
38minor_version()
39{
40 return UNITY_API_VERSION_MINOR;
41}
42
43int
44Version::
45micro_version()
46{
47 return UNITY_API_VERSION_MICRO;
48}
49
50char const*
51Version::
52str()
53{
54 return UNITY_API_VERSION_STRING;
55}
56
57} // namespace api
58
59} // namespace unity
600
=== removed directory 'src/unity/api/internal'
=== removed file 'src/unity/api/internal/CMakeLists.txt'
--- src/unity/api/internal/CMakeLists.txt 2013-04-16 00:25:34 +0000
+++ src/unity/api/internal/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1set(API_INTERNAL_SRC
2)
3
4set(UNITY_API_LIB_SRC ${UNITY_API_LIB_SRC} ${API_INTERNAL_SRC} PARENT_SCOPE)
50
=== removed directory 'src/unity/api/scopes'
=== removed file 'src/unity/api/scopes/CMakeLists.txt'
--- src/unity/api/scopes/CMakeLists.txt 2013-04-16 00:25:34 +0000
+++ src/unity/api/scopes/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1add_subdirectory(internal)
2
3set(SCOPES_SRC
4)
5
6set(UNITY_API_LIB_SRC ${UNITY_API_LIB_SRC} ${SCOPES_SRC} PARENT_SCOPE)
70
=== removed directory 'src/unity/api/scopes/internal'
=== removed file 'src/unity/api/scopes/internal/CMakeLists.txt'
--- src/unity/api/scopes/internal/CMakeLists.txt 2013-04-22 18:14:52 +0000
+++ src/unity/api/scopes/internal/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1set(SCOPES_INTERNAL_SRC
2)
3
4set(UNITY_API_LIB_SRC ${UNITY_API_LIB_SRC} ${SCOPES_INTERNAL_SRC} PARENT_SCOPE)
50
=== removed directory 'src/unity/internal'
=== removed file 'src/unity/internal/CMakeLists.txt'
--- src/unity/internal/CMakeLists.txt 2013-04-16 00:25:34 +0000
+++ src/unity/internal/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1set(UNITY_INTERNAL_SRC
2 ${CMAKE_CURRENT_SOURCE_DIR}/ExceptionImpl.cpp
3 ${CMAKE_CURRENT_SOURCE_DIR}/UnityExceptionsImpl.cpp
4)
5
6set(UNITY_API_LIB_SRC ${UNITY_API_LIB_SRC} ${UNITY_INTERNAL_SRC} PARENT_SCOPE)
70
=== removed file 'src/unity/internal/ExceptionImpl.cpp'
--- src/unity/internal/ExceptionImpl.cpp 2013-04-04 02:16:16 +0000
+++ src/unity/internal/ExceptionImpl.cpp 1970-01-01 00:00:00 +0000
@@ -1,244 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/internal/ExceptionImpl.h>
20#include <unity/Exception.h>
21
22using namespace std;
23
24namespace unity
25{
26
27namespace internal
28{
29
30ExceptionImpl::
31ExceptionImpl(string const& reason)
32 : reason_(reason)
33{
34}
35
36ExceptionImpl::
37~ExceptionImpl() noexcept = default;
38
39string
40ExceptionImpl::
41reason() const
42{
43 return reason_;
44}
45
46namespace
47{
48
49//
50// Return the margin string for the indent level and indent.
51//
52
53string
54get_margin(int indent_level, string const& indent)
55{
56 string margin;
57 for (int i = 0; i < indent_level; ++i)
58 {
59 margin += indent;
60 }
61 return margin;
62}
63
64//
65// Follow the nested exceptions that were rethrown along the call stack, printing them into s.
66//
67
68void
69print_name_and_reason(string& s, nested_exception const& nested)
70{
71 // Add the what() string if this is a std::exception.
72
73 std::exception const* std_exception = dynamic_cast<std::exception const*>(&nested);
74 if (std_exception)
75 {
76 s += std_exception->what();
77 }
78
79 // Add the reason if this is a unity::Exception.
80
81 unity::Exception const* unity_exception = dynamic_cast<unity::Exception const*>(&nested);
82 if (unity_exception)
83 {
84 string reason = unity_exception->reason();
85 if (!reason.empty())
86 {
87 s += ": " + reason;
88 }
89 }
90
91 // Append info about unknown std::exception and std::nested_exception.
92
93 if (!unity_exception)
94 {
95 if (std_exception)
96 {
97 s += " (derived from std::exception and std::nested_exception)";
98 }
99 else
100 {
101 s += "std::nested_exception";
102 }
103 }
104}
105
106void
107follow_nested(string& s, nested_exception const& nested, int indent_level, std::string const& indent)
108{
109 if (nested.nested_ptr())
110 {
111 string margin = get_margin(indent_level, indent);
112
113 s += ":\n";
114 try
115 {
116 nested.rethrow_nested();
117 }
118 catch (std::nested_exception const& e)
119 {
120 unity::Exception const* ge = dynamic_cast<unity::Exception const*>(&e);
121 if (ge)
122 {
123 s += ge->to_string(indent_level + 1, indent);
124 }
125 else
126 {
127 s += margin + indent;
128 print_name_and_reason(s, e);
129 follow_nested(s, e, indent_level + 1, indent);
130 }
131 }
132 catch (std::exception const& e)
133 {
134 s += margin + indent;
135 s += e.what(); // Can show only what() for std::exception.
136 }
137 catch (...)
138 {
139 s += margin + indent;
140 s += "unknown exception"; // Best we can do for an exception whose type we don't know.
141 }
142 }
143}
144
145//
146// Follow the history chain and print each exception in the chain.
147//
148
149void
150follow_history(string& s, int& count, unity::Exception const& e, int indent_level, std::string const& indent)
151{
152 if (!e.get_earlier())
153 {
154 count = 1; // We have reached the oldest exception; set exception generation count and terminate recursion.
155 }
156 else
157 {
158 try
159 {
160 rethrow_exception(e.get_earlier());
161 }
162 catch (unity::Exception const& e)
163 {
164 // Recurse along the chain until we hit the end, then, as we pop back up the levels, we increment the
165 // count and print it as a generation number for the exception information.
166 // A bit like the "kicks" in "Inception", except that the deepest level is level 1...
167
168 follow_history(s, count, e, indent_level, indent);
169 }
170 ++count;
171 }
172
173 // Show info for this exception.
174
175 s += "\n" + get_margin(indent_level, indent) + "Exception #";
176 s += to_string(count) + ":\n";
177 s += get_margin(indent_level, indent) + indent;
178 print_name_and_reason(s, e);
179 follow_nested(s, e, indent_level + 1, indent);
180}
181
182} // namespace
183
184string
185ExceptionImpl::
186to_string(nested_exception const& nested, int indent_level, string const& indent) const
187{
188 string margin = get_margin(indent_level, indent);
189 string s = margin;
190 s += what();
191
192 string r = reason();
193 if (!r.empty())
194 {
195 s += ": " + r;
196 }
197
198 // Check whether there is an exception history and print each exception in the history.
199
200 unity::Exception const* unity_exception(dynamic_cast<unity::Exception const*>(&nested));
201 if (unity_exception && unity_exception->get_earlier())
202 {
203 s += "\n" + margin + indent + "Exception history:";
204 try
205 {
206 rethrow_exception(unity_exception->get_earlier());
207 }
208 catch (unity::Exception const& e)
209 {
210 int count;
211 follow_history(s, count, e, indent_level + 2, indent);
212 }
213 }
214
215 // Print this and any nested exceptions.
216
217 follow_nested(s, nested, indent_level, indent);
218
219 return s;
220}
221
222exception_ptr
223ExceptionImpl::
224remember(Exception const* env, exception_ptr earlier_exception)
225{
226 // Doesn't prevent loops, but protects against accidental self-assignment.
227
228 if (previous_ != earlier_exception)
229 {
230 previous_ = earlier_exception;
231 }
232 return env->self();
233}
234
235exception_ptr
236ExceptionImpl::
237get_earlier() const noexcept
238{
239 return previous_;
240}
241
242} // namespace internal
243
244} // namespace unity
2450
=== removed file 'src/unity/internal/UnityExceptionsImpl.cpp'
--- src/unity/internal/UnityExceptionsImpl.cpp 2013-04-04 02:16:16 +0000
+++ src/unity/internal/UnityExceptionsImpl.cpp 1970-01-01 00:00:00 +0000
@@ -1,126 +0,0 @@
1/*
2 * Copyright (C) 2012 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/internal/UnityExceptionsImpl.h>
20
21using namespace std;
22
23namespace unity
24{
25
26namespace internal
27{
28
29InvalidArgumentExceptionImpl::
30InvalidArgumentExceptionImpl(string const& reason)
31 : ExceptionImpl(reason)
32{
33}
34
35char const*
36InvalidArgumentExceptionImpl::
37what() const noexcept
38{
39 return "unity::InvalidArgumentException";
40}
41
42LogicExceptionImpl::
43LogicExceptionImpl(string const& reason)
44 : ExceptionImpl(reason)
45{
46}
47
48char const*
49LogicExceptionImpl::
50what() const noexcept
51{
52 return "unity::LogicException";
53}
54
55ShutdownExceptionImpl::
56ShutdownExceptionImpl(string const& reason)
57 : ExceptionImpl(reason)
58{
59}
60
61char const*
62ShutdownExceptionImpl::
63what() const noexcept
64{
65 return "unity::ShutdownException";
66}
67
68FileExceptionImpl::
69FileExceptionImpl(string const& reason, int err)
70 : ExceptionImpl(reason + (err == 0 ? "" : " (errno = " + std::to_string(err) + ")"))
71 , errno_(err)
72{
73}
74
75char const*
76FileExceptionImpl::
77what() const noexcept
78{
79 return "unity::FileException";
80}
81
82int
83FileExceptionImpl::
84error() const noexcept
85{
86 return errno_;
87}
88
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches