[
  {
    "path": ".dep.inc",
    "content": "# This code depends on make tool being used\nDEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES}))\nifneq (${DEPFILES},)\ninclude ${DEPFILES}\nendif\n"
  },
  {
    "path": ".gitignore",
    "content": "**/*.memsafe\nmemsafe_unittest\nTEMP\ndoxygen/*\noutput/*\n**/*.pt\ncontrib/*\n**/.obsidian\n**/CMakeFiles\n**/CMakeCache.txt\n**/*.cmake\n**/newlang-unit-tests\n**/newlang-unit-tests.exe\n**/nlc.exe\n**/**tar.xz\n**/DartConfiguration.tcl\nTAG\n\n**/*.bc\n**/*.data\n**/*.s\n\n**/*.i\n**/*.vcxproj.filters\n**/*.vcxproj.user\n\n**/syntax_help*.cpp\n**/newlang_doc.txt\n**/version.*\ndocs/syntax.txt\noutput\n**/*temp*\n**/tmp\n**/.vs\n.history\n\n\n# Binaries\n*.7z\n*.dmg\n*.gz\n*.iso\n*.jar\n*.rar\n*.tar\n*.zip\n*.war\n*.ear\n*.sar\n*.class\n\n# NetBeans specific\n**/nbproject/private/\n**/build/\n**/nbbuild/\n**/dist/\n**/nbdist/\n**/nbactions.xml\n**/nb-configuration.xml\n**/Debug*\n**/Release*\n\n# Misc\n*.swp\nrelease.properties\npom.xml.releaseBackup\npom.xml.tag\n\n\n\n\n# Precompiled Headers\n*.gch\n*.pch\n\n# autotools\n**/.deps\n*.log\n*.status\n\n\n# Executables\n*.exe\n*.out\n*.app\n\n\n# Autogenerate\ndoxydoc\n**/version.c\n**/version.h\n**/version.pri\n**/moc_*.h\n**/moc_*.cpp\n**/ui_*.h\n**/ui_*.cpp\n**/qrc_resource.cpp\n**/parsetab.py\n**/parser.py\n\n# temp files\n*.o\n*.d\n*.axf\n*.crf\n**/*temp.*\n**/*.out\n**/.*_history\n**/*.save\n**/*.img-graph\n**/*.pb\n\n\n*.htm\n*.hex\n*.lnp\n*.lst\n*.map\n*.sct\n*.dep\n*.TMP\n*.tmp\n*.bak\n*._*\n*.iex\n\n*.log\n.metadata\n\n\n_output/\n\n# C++ objects and libs\n\n*.slo\n*.lo\n*.o\n*.a\n*.la\n*.lai\n*.so\n*.lib\n*.dll\n*.dylib\n\n\n\n# Qt-es\n\n**/.qmake.cache\n**/.qmake.stash\n*.pro.user\n*.pro.user.*\n*.moc\nmoc_*.cpp\nmoc_*.h\nqrc_*.cpp\nui_*.h\n*-build-*\n\n# QtCreator\n*.autosave\n\n#QtCtreator Qml\n*.qmlproject.user\n*.qmlproject.user.*\n\n\n\n# Windows image file caches\nThumbs.db\nehthumbs.db\n\n# Folder config file\nDesktop.ini\n\n# Recycle Bin used on file shares\n$RECYCLE.BIN/\n\n# Windows Installer files\n*.cab\n*.msi\n*.msm\n*.msp\n\n# Windows shortcuts\n*.lnk\n\n# =========================\n# Operating System Files\n# =========================\n\n# OSX\n# =========================\n\n.DS_Store\n.AppleDouble\n.LSOverride\n\n# Thumbnails\n._*\n\n# Files that might appear in the root of a volume\n.DocumentRevisions-V100\n.fseventsd\n.Spotlight-V100\n.TemporaryItems\n.Trashes\n.VolumeIcon.icns\n\n# Directories potentially created on remote AFP share\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n\n\n\n# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n*.pyc\n.idea\n\n# Distribution / packaging\n.Python\nbuild/\ndist/\ndownloads/\neggs/\n.eggs/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\nshare/python-wheels/\n*.egg-info/\n.installed.cfg\n*.egg\nMANIFEST\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.nox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n*.py,cover\n.hypothesis/\n.pytest_cache/\ncover/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\ndb.sqlite3\ndb.sqlite3-journal\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\n.pybuilder/\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# IPython\nprofile_default/\nipython_config.py\n\n# pyenv\n#   For a library or package, you might want to ignore these files since the code is\n#   intended to run in multiple environments; otherwise, check them in:\n# .python-version\n\n# pipenv\n#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.\n#   However, in case of collaboration, if having platform-specific dependencies or dependencies\n#   having no cross-platform support, pipenv may install dependencies that don't work, or not\n#   install all needed dependencies.\n#Pipfile.lock\n\n# PEP 582; used by e.g. github.com/David-OConnor/pyflow\n__pypackages__/\n\n# Celery stuff\ncelerybeat-schedule\ncelerybeat.pid\n\n# SageMath parsed files\n*.sage.py\n\n# Environments\n.env\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mypy\n.mypy_cache/\n.dmypy.json\ndmypy.json\n\n# Pyre type checker\n.pyre/\n\n# pytype static type analyzer\n.pytype/\n\n# Cython debug symbols\ncython_debug/\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Version history\n\n## Release v0.4 (??.04.2025)\n- The theses that guarantee safe memory management are formulated.\n- The plugin now supports analysis of cyclic references between classes.\n- The name of the automatic variable class has been renamed to Locker to match the logic of the functionality it performs.\n- Disabled ownership checks and strong reference borrowing as it is no longer required.\n\n------\n\n\n## Release v0.3 (17.03.2025)\n- Refactor the library interface to simplify inheritance:    \n    - Сombined *shared* and *guard* variables into one template class\n    - Pointer data types with invalidation control are merged with automatic data types\n- Add restriction on using reference types as the data type of variables has been added to templates.\n- The plugin has new checks for reference types of class fields\n- Fixed checking for use of unwanted (warning) and forbidden (error) classes\n- Added control of reference types (pointers)\n- New tests added and project description reworked\n\n------\n\n\n## Release v0.2 (02.03.2025)\n- Added invalidation analysis of reference data types\n- Memory safety library adapted for C++\n\n## Miscellaneous\n- Switched to clang-20 (added support for custom attributes in expressions)\n- Add expanded diagnostics and plugin development methods (MEMSAFE_PRINT_DUMP and MEMSAFE_PRINT_AST macros)\n- Removed automated testing with FixIt and reorganized plugin log output to indicate where the message was created for use in tests.\n\n------\n\n## First prototype (19.01.2025)\n\nThe first prototype of safe memory library from the [NewLang](https://newlang.net/), \nadapted for C++ and a clang plugin for analyzing source code when compiling a C++ program.\n\nThe method of marking objects in C++ program code using attributes is very similar to the one proposed in the security profiles\n[p3038](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p3038r0.pdf) by Bjarne Stroustrup\nand [P3081](https://isocpp.org/files/papers/P3081R0.pdf) by Herb Sutter,\nbut does not require the development of a new C++ standard (it is enough to use the existing C++20)."
  },
  {
    "path": "Doxyfile",
    "content": "# Doxyfile 1.10.0\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project.\n#\n# All text after a double hash (##) is considered a comment and is placed in\n# front of the TAG it is preceding.\n#\n# All text after a single hash (#) is considered a comment and will be ignored.\n# The format is:\n# TAG = value [value, ...]\n# For lists, items can also be appended using:\n# TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\\\" \\\").\n#\n# Note:\n#\n# Use doxygen to compare the used configuration file with the template\n# configuration file:\n# doxygen -x [configFile]\n# Use doxygen to compare the used configuration file with the template\n# configuration file without replacing the environment variables or CMake type\n# replacement variables:\n# doxygen -x_noenv [configFile]\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the configuration\n# file that follow. The default is UTF-8 which is also the encoding used for all\n# text before the first occurrence of this tag. Doxygen uses libiconv (or the\n# iconv built into libc) for the transcoding. See\n# https://www.gnu.org/software/libiconv/ for the list of possible encodings.\n# The default value is: UTF-8.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\n# double-quotes, unless you are using Doxywizard) that should identify the\n# project for which the documentation is generated. This name is used in the\n# title of most generated pages and in a few other places.\n# The default value is: My Project.\n\nPROJECT_NAME           = \"Memory safety Project\"\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\n# could be handy for archiving the generated documentation or if some version\n# control system is used.\n\nPROJECT_NUMBER         =\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"Single-header C++ memory safety library with a compiler plugin\"\n\n# With the PROJECT_LOGO tag one can specify a logo or an icon that is included\n# in the documentation. The maximum height of the logo should not exceed 55\n# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy\n# the logo to the output directory.\n\nPROJECT_LOGO           =\n\n# With the PROJECT_ICON tag one can specify an icon that is included in the tabs\n# when the HTML document is shown. Doxygen will copy the logo to the output\n# directory.\n\nPROJECT_ICON           =\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\n# into which the generated documentation will be written. If a relative path is\n# entered, it will be relative to the location where doxygen was started. If\n# left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = doxygen\n\n# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096\n# sub-directories (in 2 levels) under the output directory of each output format\n# and will distribute the generated files over these directories. Enabling this\n# option can be useful when feeding doxygen a huge amount of source files, where\n# putting all generated files in the same directory would otherwise causes\n# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to\n# control the number of sub-directories.\n# The default value is: NO.\n\nCREATE_SUBDIRS         = NO\n\n# Controls the number of sub-directories that will be created when\n# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every\n# level increment doubles the number of directories, resulting in 4096\n# directories at level 8 which is the default and also the maximum value. The\n# sub-directories are organized in 2 levels, the first level always has a fixed\n# number of 16 directories.\n# Minimum value: 0, maximum value: 8, default value: 8.\n# This tag requires that the tag CREATE_SUBDIRS is set to YES.\n\nCREATE_SUBDIRS_LEVEL   = 8\n\n# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII\n# characters to appear in the names of generated files. If set to NO, non-ASCII\n# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode\n# U+3044.\n# The default value is: NO.\n\nALLOW_UNICODE_NAMES    = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all constant output in the proper language.\n# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian,\n# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English\n# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek,\n# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with\n# English messages), Korean, Korean-en (Korean with English messages), Latvian,\n# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese,\n# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish,\n# Swedish, Turkish, Ukrainian and Vietnamese.\n# The default value is: English.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member\n# descriptions after the members that are listed in the file and class\n# documentation (similar to Javadoc). Set to NO to disable this.\n# The default value is: YES.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief\n# description of a member or function before the detailed description\n#\n# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\n# brief descriptions will be completely suppressed.\n# The default value is: YES.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator that is\n# used to form the text in various listings. Each string in this list, if found\n# as the leading text of the brief description, will be stripped from the text\n# and the result, after processing the whole list, is used as the annotated\n# text. Otherwise, the brief description is used as-is. If left blank, the\n# following values are used ($name is automatically replaced with the name of\n# the entity):The $name class, The $name widget, The $name file, is, provides,\n# specifies, contains, represents, a, an and the.\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\n# doxygen will generate a detailed section even if there is only a brief\n# description.\n# The default value is: NO.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\n# inherited members of a class in the documentation of that class as if those\n# members were ordinary class members. Constructors, destructors and assignment\n# operators of the base classes will not be shown.\n# The default value is: NO.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path\n# before files name in the file list and in the header files. If set to NO the\n# shortest path that makes the file name unique will be used\n# The default value is: YES.\n\nFULL_PATH_NAMES        = YES\n\n# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\n# Stripping is only done if one of the specified strings matches the left-hand\n# part of the path. The tag can be used to show relative paths in the file list.\n# If left blank the directory from which doxygen is run is used as the path to\n# strip.\n#\n# Note that you can specify absolute paths here, but also relative paths, which\n# will be relative from the directory where doxygen is started.\n# This tag requires that the tag FULL_PATH_NAMES is set to YES.\n\nSTRIP_FROM_PATH        =\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\n# path mentioned in the documentation of a class, which tells the reader which\n# header file to include in order to use a class. If left blank only the name of\n# the header file containing the class definition is used. Otherwise one should\n# specify the list of include paths that are normally passed to the compiler\n# using the -I flag.\n\nSTRIP_FROM_INC_PATH    =\n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\n# less readable) file names. This can be useful is your file systems doesn't\n# support long names like on DOS, Mac, or CD-ROM.\n# The default value is: NO.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\n# first line (until the first dot) of a Javadoc-style comment as the brief\n# description. If set to NO, the Javadoc-style will behave just like regular Qt-\n# style comments (thus requiring an explicit @brief command for a brief\n# description.)\n# The default value is: NO.\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line\n# such as\n# /***************\n# as being the beginning of a Javadoc-style comment \"banner\". If set to NO, the\n# Javadoc-style will behave just like regular comments and it will not be\n# interpreted by doxygen.\n# The default value is: NO.\n\nJAVADOC_BANNER         = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\n# line (until the first dot) of a Qt-style comment as the brief description. If\n# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\n# requiring an explicit \\brief command for a brief description.)\n# The default value is: NO.\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\n# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\n# a brief description. This used to be the default behavior. The new default is\n# to treat a multi-line C++ comment block as a detailed description. Set this\n# tag to YES if you prefer the old behavior instead.\n#\n# Note that setting this tag to YES also means that rational rose comments are\n# not recognized any more.\n# The default value is: NO.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# By default Python docstrings are displayed as preformatted text and doxygen's\n# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the\n# doxygen's special commands can be used and the contents of the docstring\n# documentation blocks is shown as doxygen documentation.\n# The default value is: YES.\n\nPYTHON_DOCSTRING       = YES\n\n# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\n# documentation from any documented member that it re-implements.\n# The default value is: YES.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new\n# page for each member. If set to NO, the documentation of a member will be part\n# of the file/class/namespace that contains it.\n# The default value is: NO.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\n# uses this value to replace tabs by spaces in code fragments.\n# Minimum value: 1, maximum value: 16, default value: 4.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that act as commands in\n# the documentation. An alias has the form:\n# name=value\n# For example adding\n# \"sideeffect=@par Side Effects:^^\"\n# will allow you to put the command \\sideeffect (or @sideeffect) in the\n# documentation, which will result in a user-defined paragraph with heading\n# \"Side Effects:\". Note that you cannot put \\n's in the value part of an alias\n# to insert newlines (in the resulting output). You can put ^^ in the value part\n# of an alias to insert a newline as if a physical newline was in the original\n# file. When you need a literal { or } or , in the value part of an alias you\n# have to escape them by means of a backslash (\\), this can lead to conflicts\n# with the commands \\{ and \\} for these it is advised to use the version @{ and\n# @} or use a double escape (\\\\{ and \\\\})\n\nALIASES                =\n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\n# only. Doxygen will then generate output that is more tailored for C. For\n# instance, some of the names that are used will be different. The list of all\n# members will be omitted, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\n# Python sources only. Doxygen will then generate output that is more tailored\n# for that language. For instance, namespaces will be presented as packages,\n# qualified scopes will look different, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_JAVA   = NO\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\n# sources. Doxygen will then generate output that is tailored for Fortran.\n# The default value is: NO.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\n# sources. Doxygen will then generate output that is tailored for VHDL.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice\n# sources only. Doxygen will then generate output that is more tailored for that\n# language. For instance, namespaces will be presented as modules, types will be\n# separated into more groups, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_SLICE  = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it\n# parses. With this tag you can assign which parser to use for a given\n# extension. Doxygen has a built-in mapping, but you can override or extend it\n# using this tag. The format is ext=language, where ext is a file extension, and\n# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,\n# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,\n# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:\n# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser\n# tries to guess whether the code is fixed or free formatted code, this is the\n# default for Fortran type files). For instance to make doxygen treat .inc files\n# as Fortran files (default is PHP), and .f files as C (default is Fortran),\n# use: inc=Fortran f=C.\n#\n# Note: For files without extension you can use no_extension as a placeholder.\n#\n# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\n# the files are not read by doxygen. When specifying no_extension you should add\n# * to the FILE_PATTERNS.\n#\n# Note see also the list of default file extension mappings.\n\nEXTENSION_MAPPING      =\n\n# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\n# according to the Markdown format, which allows for more readable\n# documentation. See https://daringfireball.net/projects/markdown/ for details.\n# The output of markdown processing is further processed by doxygen, so you can\n# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\n# case of backward compatibilities issues.\n# The default value is: YES.\n\nMARKDOWN_SUPPORT       = YES\n\n# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up\n# to that level are automatically included in the table of contents, even if\n# they do not have an id attribute.\n# Note: This feature currently applies only to Markdown headings.\n# Minimum value: 0, maximum value: 99, default value: 5.\n# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.\n\nTOC_INCLUDE_HEADINGS   = 5\n\n# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to\n# generate identifiers for the Markdown headings. Note: Every identifier is\n# unique.\n# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a\n# sequence number starting at 0 and GITHUB use the lower case version of title\n# with any whitespace replaced by '-' and punctuation characters removed.\n# The default value is: DOXYGEN.\n# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.\n\nMARKDOWN_ID_STYLE      = DOXYGEN\n\n# When enabled doxygen tries to link words that correspond to documented\n# classes, or namespaces to their corresponding documentation. Such a link can\n# be prevented in individual cases by putting a % sign in front of the word or\n# globally by setting AUTOLINK_SUPPORT to NO.\n# The default value is: YES.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\n# to include (a tag file for) the STL sources as input, then you should set this\n# tag to YES in order to let doxygen match functions declarations and\n# definitions whose arguments contain STL classes (e.g. func(std::string);\n# versus func(std::string) {}). This also make the inheritance and collaboration\n# diagrams that involve STL classes more complete and accurate.\n# The default value is: NO.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n# The default value is: NO.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\n# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen\n# will parse them like normal C++ but will assume all classes use public instead\n# of private inheritance when no explicit protection keyword is present.\n# The default value is: NO.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate\n# getter and setter methods for a property. Setting this option to YES will make\n# doxygen to replace the get and set methods by a property in the documentation.\n# This will only work if the methods are indeed getting or setting a simple\n# type. If this is not the case, or you want to show the methods anyway, you\n# should set this option to NO.\n# The default value is: YES.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\n# tag is set to YES then doxygen will reuse the documentation of the first\n# member in the group (if any) for the other members of the group. By default\n# all members of a group must be documented explicitly.\n# The default value is: NO.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# If one adds a struct or class to a group and this option is enabled, then also\n# any nested class or struct is added to the same group. By default this option\n# is disabled and one has to add nested compounds explicitly via \\ingroup.\n# The default value is: NO.\n\nGROUP_NESTED_COMPOUNDS = NO\n\n# Set the SUBGROUPING tag to YES to allow class member groups of the same type\n# (for instance a group of public functions) to be put as a subgroup of that\n# type (e.g. under the Public Functions section). Set it to NO to prevent\n# subgrouping. Alternatively, this can be done per class using the\n# \\nosubgrouping command.\n# The default value is: YES.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\n# are shown inside the group in which they are included (e.g. using \\ingroup)\n# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\n# and RTF).\n#\n# Note that this feature does not work in combination with\n# SEPARATE_MEMBER_PAGES.\n# The default value is: NO.\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\n# with only public data fields or simple typedef fields will be shown inline in\n# the documentation of the scope in which they are defined (i.e. file,\n# namespace, or group documentation), provided this scope is documented. If set\n# to NO, structs, classes, and unions are shown on a separate page (for HTML and\n# Man pages) or section (for LaTeX and RTF).\n# The default value is: NO.\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\n# enum is documented as struct, union, or enum with the name of the typedef. So\n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\n# with name TypeT. When disabled the typedef will appear as a member of a file,\n# namespace, or class. And the struct will be named TypeS. This can typically be\n# useful for C code in case the coding convention dictates that all compound\n# types are typedef'ed and only the typedef is referenced, never the tag name.\n# The default value is: NO.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\n# cache is used to resolve symbols given their name and scope. Since this can be\n# an expensive process and often the same symbol appears multiple times in the\n# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\n# doxygen will become slower. If the cache is too large, memory is wasted. The\n# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\n# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\n# symbols. At the end of a run doxygen will report the cache usage and suggest\n# the optimal cache size from a speed point of view.\n# Minimum value: 0, maximum value: 9, default value: 0.\n\nLOOKUP_CACHE_SIZE      = 0\n\n# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use\n# during processing. When set to 0 doxygen will based this on the number of\n# cores available in the system. You can set it explicitly to a value larger\n# than 0 to get more control over the balance between CPU load and processing\n# speed. At this moment only the input processing can be done using multiple\n# threads. Since this is still an experimental feature the default is set to 1,\n# which effectively disables parallel processing. Please report any issues you\n# encounter. Generating dot graphs in parallel is controlled by the\n# DOT_NUM_THREADS setting.\n# Minimum value: 0, maximum value: 32, default value: 1.\n\nNUM_PROC_THREADS       = 12\n\n# If the TIMESTAMP tag is set different from NO then each generated page will\n# contain the date or date and time when the page was generated. Setting this to\n# NO can help when comparing the output of multiple runs.\n# Possible values are: YES, NO, DATETIME and DATE.\n# The default value is: NO.\n\nTIMESTAMP              = NO\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in\n# documentation are documented, even if no documentation was available. Private\n# class members and static file members will be hidden unless the\n# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\n# Note: This will also disable the warnings about undocumented members that are\n# normally produced when WARNINGS is set to YES.\n# The default value is: NO.\n\nEXTRACT_ALL            = YES\n\n# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will\n# be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual\n# methods of a class will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIV_VIRTUAL   = YES\n\n# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal\n# scope will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PACKAGE        = NO\n\n# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be\n# included in the documentation.\n# The default value is: NO.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined\n# locally in source files will be included in the documentation. If set to NO,\n# only classes defined in header files are included. Does not have any effect\n# for Java sources.\n# The default value is: YES.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. If set to YES, local methods,\n# which are defined in the implementation section but not in the interface are\n# included in the documentation. If set to NO, only methods in the interface are\n# included.\n# The default value is: NO.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be\n# extracted and appear in the documentation as a namespace called\n# 'anonymous_namespace{file}', where file will be replaced with the base name of\n# the file that contains the anonymous namespace. By default anonymous namespace\n# are hidden.\n# The default value is: NO.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If this flag is set to YES, the name of an unnamed parameter in a declaration\n# will be determined by the corresponding definition. By default unnamed\n# parameters remain unnamed in the output.\n# The default value is: YES.\n\nRESOLVE_UNNAMED_PARAMS = YES\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\n# undocumented members inside documented classes or files. If set to NO these\n# members will be included in the various overviews, but no documentation\n# section is generated. This option has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\n# undocumented classes that are normally visible in the class hierarchy. If set\n# to NO, these classes will be included in the various overviews. This option\n# will also hide undocumented C++ concepts if enabled. This option has no effect\n# if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_CLASSES     = NO\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\n# declarations. If set to NO, these declarations will be included in the\n# documentation.\n# The default value is: NO.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\n# documentation blocks found inside the body of a function. If set to NO, these\n# blocks will be appended to the function's detailed documentation block.\n# The default value is: NO.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation that is typed after a\n# \\internal command is included. If the tag is set to NO then the documentation\n# will be excluded. Set it to YES to include the internal documentation.\n# The default value is: NO.\n\nINTERNAL_DOCS          = NO\n\n# With the correct setting of option CASE_SENSE_NAMES doxygen will better be\n# able to match the capabilities of the underlying filesystem. In case the\n# filesystem is case sensitive (i.e. it supports files in the same directory\n# whose names only differ in casing), the option must be set to YES to properly\n# deal with such files in case they appear in the input. For filesystems that\n# are not case sensitive the option should be set to NO to properly deal with\n# output files written for symbols that only differ in casing, such as for two\n# classes, one named CLASS and the other named Class, and to also support\n# references to files without having to specify the exact matching casing. On\n# Windows (including Cygwin) and MacOS, users should typically set this option\n# to NO, whereas on Linux or other Unix flavors it should typically be set to\n# YES.\n# Possible values are: SYSTEM, NO and YES.\n# The default value is: SYSTEM.\n\nCASE_SENSE_NAMES       = SYSTEM\n\n# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\n# their full class and namespace scopes in the documentation. If set to YES, the\n# scope will be hidden.\n# The default value is: NO.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will\n# append additional text to a page's title, such as Class Reference. If set to\n# YES the compound reference will be hidden.\n# The default value is: NO.\n\nHIDE_COMPOUND_REFERENCE= NO\n\n# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class\n# will show which file needs to be included to use the class.\n# The default value is: YES.\n\nSHOW_HEADERFILE        = YES\n\n# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\n# the files that are included by a file in the documentation of that file.\n# The default value is: YES.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each\n# grouped member an include statement to the documentation, telling the reader\n# which file to include in order to use the member.\n# The default value is: NO.\n\nSHOW_GROUPED_MEMB_INC  = NO\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\n# files with double quotes in the documentation rather than with sharp brackets.\n# The default value is: NO.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\n# documentation for inline members.\n# The default value is: YES.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\n# (detailed) documentation of file and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order.\n# The default value is: YES.\n\nSORT_MEMBER_DOCS       = NO\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\n# descriptions of file, namespace and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order. Note that\n# this will also influence the order of the classes in the class list.\n# The default value is: NO.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\n# (brief and detailed) documentation of class members so that constructors and\n# destructors are listed first. If set to NO the constructors will appear in the\n# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\n# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\n# member documentation.\n# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\n# detailed member documentation.\n# The default value is: NO.\n\nSORT_MEMBERS_CTORS_1ST = NO\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\n# of group names into alphabetical order. If set to NO the group names will\n# appear in their defined order.\n# The default value is: NO.\n\nSORT_GROUP_NAMES       = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\n# fully-qualified names, including namespaces. If set to NO, the class list will\n# be sorted only by class name, not including the namespace part.\n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the alphabetical\n# list.\n# The default value is: NO.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\n# type resolution of all parameters of a function it will reject a match between\n# the prototype and the implementation of a member function even if there is\n# only one candidate or it is obvious which candidate to choose by doing a\n# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\n# accept a match between prototype and implementation in such cases.\n# The default value is: NO.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo\n# list. This list is created by putting \\todo commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test\n# list. This list is created by putting \\test commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug\n# list. This list is created by putting \\bug commands in the documentation.\n# The default value is: YES.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)\n# the deprecated list. This list is created by putting \\deprecated commands in\n# the documentation.\n# The default value is: YES.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional documentation\n# sections, marked by \\if <section_label> ... \\endif and \\cond <section_label>\n# ... \\endcond blocks.\n\nENABLED_SECTIONS       =\n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\n# initial value of a variable or macro / define can have for it to appear in the\n# documentation. If the initializer consists of more lines than specified here\n# it will be hidden. Use a value of 0 to hide initializers completely. The\n# appearance of the value of individual variables and macros / defines can be\n# controlled using \\showinitializer or \\hideinitializer command in the\n# documentation regardless of this setting.\n# Minimum value: 0, maximum value: 10000, default value: 30.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\n# the bottom of the documentation of classes and structs. If set to YES, the\n# list will mention the files that were used to generate the documentation.\n# The default value is: YES.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\n# will remove the Files entry from the Quick Index and from the Folder Tree View\n# (if specified).\n# The default value is: YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\n# page. This will remove the Namespaces entry from the Quick Index and from the\n# Folder Tree View (if specified).\n# The default value is: YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that\n# doxygen should invoke to get the current version for each file (typically from\n# the version control system). Doxygen will invoke the program by executing (via\n# popen()) the command command input-file, where command is the value of the\n# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\n# by doxygen. Whatever the program writes to standard output is used as the file\n# version. For an example see the documentation.\n\nFILE_VERSION_FILTER    =\n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\n# by doxygen. The layout file controls the global structure of the generated\n# output files in an output format independent way. To create the layout file\n# that represents doxygen's defaults, run doxygen with the -l option. You can\n# optionally specify a file name after the option, if omitted DoxygenLayout.xml\n# will be used as the name of the layout file. See also section \"Changing the\n# layout of pages\" for information.\n#\n# Note that if you run doxygen from a directory containing a file called\n# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\n# tag is left empty.\n\nLAYOUT_FILE            =\n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\n# the reference definitions. This must be a list of .bib files. The .bib\n# extension is automatically appended if omitted. This requires the bibtex tool\n# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.\n# For LaTeX the style of the bibliography can be controlled using\n# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\n# search path. See also \\cite for info how to create references.\n\nCITE_BIB_FILES         =\n\n#---------------------------------------------------------------------------\n# Configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated to\n# standard output by doxygen. If QUIET is set to YES this implies that the\n# messages are off.\n# The default value is: NO.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are\n# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES\n# this implies that the warnings are on.\n#\n# Tip: Turn warnings on while writing the documentation.\n# The default value is: YES.\n\nWARNINGS               = YES\n\n# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate\n# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: YES.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\n# potential errors in the documentation, such as documenting some parameters in\n# a documented function twice, or documenting parameters that don't exist or\n# using markup commands wrongly.\n# The default value is: YES.\n\nWARN_IF_DOC_ERROR      = YES\n\n# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete\n# function parameter documentation. If set to NO, doxygen will accept that some\n# parameters have no documentation without warning.\n# The default value is: YES.\n\nWARN_IF_INCOMPLETE_DOC = YES\n\n# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\n# are documented, but have no documentation for their parameters or return\n# value. If set to NO, doxygen will only warn about wrong parameter\n# documentation, but not about the absence of documentation. If EXTRACT_ALL is\n# set to YES then this flag will automatically be disabled. See also\n# WARN_IF_INCOMPLETE_DOC\n# The default value is: NO.\n\nWARN_NO_PARAMDOC       = NO\n\n# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about\n# undocumented enumeration values. If set to NO, doxygen will accept\n# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: NO.\n\nWARN_IF_UNDOC_ENUM_VAL = NO\n\n# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when\n# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS\n# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but\n# at the end of the doxygen process doxygen will return with a non-zero status.\n# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves\n# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not\n# write the warning messages in between other messages but write them at the end\n# of a run, in case a WARN_LOGFILE is defined the warning messages will be\n# besides being in the defined file also be shown at the end of a run, unless\n# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case\n# the behavior will remain as with the setting FAIL_ON_WARNINGS.\n# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT.\n# The default value is: NO.\n\nWARN_AS_ERROR          = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that doxygen\n# can produce. The string should contain the $file, $line, and $text tags, which\n# will be replaced by the file and line number from which the warning originated\n# and the warning text. Optionally the format may contain $version, which will\n# be replaced by the version of the file (if it could be obtained via\n# FILE_VERSION_FILTER)\n# See also: WARN_LINE_FORMAT\n# The default value is: $file:$line: $text.\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# In the $text part of the WARN_FORMAT command it is possible that a reference\n# to a more specific place is given. To make it easier to jump to this place\n# (outside of doxygen) the user can define a custom \"cut\" / \"paste\" string.\n# Example:\n# WARN_LINE_FORMAT = \"'vi $file +$line'\"\n# See also: WARN_FORMAT\n# The default value is: at line $line of file $file.\n\nWARN_LINE_FORMAT       = \"at line $line of file $file\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning and error\n# messages should be written. If left blank the output is written to standard\n# error (stderr). In case the file specified cannot be opened for writing the\n# warning and error messages are written to standard error. When as file - is\n# specified the warning and error messages are written to standard output\n# (stdout).\n\nWARN_LOGFILE           =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag is used to specify the files and/or directories that contain\n# documented source files. You may enter file names like myfile.cpp or\n# directories like /usr/src/myproject. Separate the files or directories with\n# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING\n# Note: If this tag is empty the current directory is searched.\n\nINPUT                  = memsafe.h\n\n\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\n# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\n# documentation (see:\n# https://www.gnu.org/software/libiconv/) for the list of possible encodings.\n# See also: INPUT_FILE_ENCODING\n# The default value is: UTF-8.\n\nINPUT_ENCODING         = UTF-8\n\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify\n# character encoding on a per file pattern basis. Doxygen will compare the file\n# name with each pattern and apply the encoding instead of the default\n# INPUT_ENCODING) if there is a match. The character encodings are a list of the\n# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding\n# \"INPUT_ENCODING\" for further information on supported encodings.\n\nINPUT_FILE_ENCODING    =\n\n# If the value of the INPUT tag contains directories, you can use the\n# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\n# *.h) to filter out the source-files in the directories.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# read by doxygen.\n#\n# Note the list of default checked file patterns might differ from the list of\n# default file extension mappings.\n#\n# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm,\n# *.cpp, *.cppm, *.ccm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl,\n# *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d,\n# *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to\n# be provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,\n# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.idl \\\n                         *.ddl \\\n                         *.odl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.l \\\n                         *.cs \\\n                         *.d \\\n                         *.php \\\n                         *.php4 \\\n                         *.php5 \\\n                         *.phtml \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.pyw \\\n                         *.f90 \\\n                         *.f95 \\\n                         *.f03 \\\n                         *.f08 \\\n                         *.f18 \\\n                         *.f \\\n                         *.for \\\n                         *.vhd \\\n                         *.vhdl \\\n                         *.ucf \\\n                         *.qsf \\\n                         *.ice\n\n# The RECURSIVE tag can be used to specify whether or not subdirectories should\n# be searched for input files as well.\n# The default value is: NO.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be\n# excluded from the INPUT source files. This way you can easily exclude a\n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n#\n# Note that relative paths are relative to the directory from which doxygen is\n# run.\n\nEXCLUDE                = lib/build \\\n                         lib/nbproject \\\n\t\t\t nlc/build \\\n                         nlc/nbproject \\\n\t\t\t examples \\\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\n# directories that are symbolic links (a Unix file system feature) are excluded\n# from the input.\n# The default value is: NO.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the\n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\n# certain files from those directories.\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = .* \\\n\t\t\t *.temp \\\n\t\t\t *.data \\\n\t\t\t *.yy.* \\\n\t\t\t location.hh \\\n\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\n# (namespaces, classes, functions, etc.) that should be excluded from the\n# output. The symbol name can be a fully qualified name, a word, or if the\n# wildcard * is used, a substring. Examples: ANamespace, AClass,\n# ANamespace::AClass, ANamespace::*Test\n\nEXCLUDE_SYMBOLS        =\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or directories\n# that contain example code fragments that are included (see the \\include\n# command).\n\nEXAMPLE_PATH           =\n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the\n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank all\n# files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\n# searched for input files to be used with the \\include or \\dontinclude commands\n# irrespective of the value of the RECURSIVE tag.\n# The default value is: NO.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or directories\n# that contain images that are to be included in the documentation (see the\n# \\image command).\n\nIMAGE_PATH             =\n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should\n# invoke to filter for each input file. Doxygen will invoke the filter program\n# by executing (via popen()) the command:\n#\n# <filter> <input-file>\n#\n# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\n# name of an input file. Doxygen will then use the output that the filter\n# program writes to standard output. If FILTER_PATTERNS is specified, this tag\n# will be ignored.\n#\n# Note that the filter must not add or remove lines; it is applied before the\n# code is scanned, but not when the output code is generated. If lines are added\n# or removed, the anchors will not be placed correctly.\n#\n# Note that doxygen will use the data processed and written to standard output\n# for further processing, therefore nothing else, like debug statements or used\n# commands (so in case of a Windows batch file always use @echo OFF), should be\n# written to standard output.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nINPUT_FILTER           =\n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\n# basis. Doxygen will compare the file name with each pattern and apply the\n# filter if there is a match. The filters are a list of the form: pattern=filter\n# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\n# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\n# patterns match the file name, INPUT_FILTER is applied.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nFILTER_PATTERNS        =\n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\n# INPUT_FILTER) will also be used to filter the input files that are used for\n# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\n# The default value is: NO.\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\n# it is also possible to disable source filtering for a specific pattern using\n# *.ext= (so without naming a filter).\n# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\n\nFILTER_SOURCE_PATTERNS =\n\n# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\n# is part of the input, its contents will be placed on the main page\n# (index.html). This can be useful if you have a project on for instance GitHub\n# and want to reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE = \n# docs/index.md\n\n# The Fortran standard specifies that for fixed formatted Fortran code all\n# characters from position 72 are to be considered as comment. A common\n# extension is to allow longer lines before the automatic comment starts. The\n# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can\n# be processed before the automatic comment starts.\n# Minimum value: 7, maximum value: 10000, default value: 72.\n\nFORTRAN_COMMENT_AFTER  = 72\n\n#---------------------------------------------------------------------------\n# Configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\n# generated. Documented entities will be cross-referenced with these sources.\n#\n# Note: To get rid of all source code in the generated output, make sure that\n# also VERBATIM_HEADERS is set to NO.\n# The default value is: NO.\n\nSOURCE_BROWSER         = YES\n\n# Setting the INLINE_SOURCES tag to YES will include the body of functions,\n# multi-line macros, enums or list initialized variables directly into the\n# documentation.\n# The default value is: NO.\n\nINLINE_SOURCES         = YES\n\n# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\n# special comment blocks from generated source code fragments. Normal C, C++ and\n# Fortran comments will always remain visible.\n# The default value is: YES.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\n# entity all documented functions referencing it will be listed.\n# The default value is: NO.\n\nREFERENCED_BY_RELATION = YES\n\n# If the REFERENCES_RELATION tag is set to YES then for each documented function\n# all documented entities called/used by that function will be listed.\n# The default value is: NO.\n\nREFERENCES_RELATION    = YES\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\n# to YES then the hyperlinks from functions in REFERENCES_RELATION and\n# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\n# link to the documentation.\n# The default value is: YES.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\n# source code will show a tooltip with additional information such as prototype,\n# brief description and links to the definition and documentation. Since this\n# will make the HTML file larger and loading of large files a bit slower, you\n# can opt to disable this feature.\n# The default value is: YES.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nSOURCE_TOOLTIPS        = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code will\n# point to the HTML generated by the htags(1) tool instead of doxygen built-in\n# source browser. The htags tool is part of GNU's global source tagging system\n# (see https://www.gnu.org/software/global/global.html). You will need version\n# 4.8.6 or higher.\n#\n# To use it do the following:\n# - Install the latest version of global\n# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file\n# - Make sure the INPUT points to the root of the source tree\n# - Run doxygen as normal\n#\n# Doxygen will invoke htags (and that will in turn invoke gtags), so these\n# tools must be available from the command line (i.e. in the search path).\n#\n# The result: instead of the source browser generated by doxygen, the links to\n# source code will now point to the output of htags.\n# The default value is: NO.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\n# verbatim copy of the header file for each class for which an include is\n# specified. Set to NO to disable this.\n# See also: Section \\class.\n# The default value is: YES.\n\nVERBATIM_HEADERS       = YES\n\n# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the\n# clang parser (see:\n# http://clang.llvm.org/) for more accurate parsing at the cost of reduced\n# performance. This can be particularly helpful with template rich C++ code for\n# which doxygen's built-in parser lacks the necessary type information.\n# Note: The availability of this option depends on whether or not doxygen was\n# generated with the -Duse_libclang=ON option for CMake.\n# The default value is: NO.\n\nCLANG_ASSISTED_PARSING = NO\n\n# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS\n# tag is set to YES then doxygen will add the directory of each input to the\n# include path.\n# The default value is: YES.\n# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.\n\nCLANG_ADD_INC_PATHS    = YES\n\n# If clang assisted parsing is enabled you can provide the compiler with command\n# line options that you would normally use when invoking the compiler. Note that\n# the include paths will already be set by doxygen for the files and directories\n# specified with INPUT and INCLUDE_PATH.\n# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.\n\nCLANG_OPTIONS          =\n\n# If clang assisted parsing is enabled you can provide the clang parser with the\n# path to the directory containing a file called compile_commands.json. This\n# file is the compilation database (see:\n# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the\n# options used when the source files were built. This is equivalent to\n# specifying the -p option to a clang tool, such as clang-check. These options\n# will then be passed to the parser. Any options specified with CLANG_OPTIONS\n# will be added as well.\n# Note: The availability of this option depends on whether or not doxygen was\n# generated with the -Duse_libclang=ON option for CMake.\n\nCLANG_DATABASE_PATH    =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\n# compounds will be generated. Enable this if the project contains a lot of\n# classes, structs, unions or interfaces.\n# The default value is: YES.\n\nALPHABETICAL_INDEX     = YES\n\n# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes)\n# that should be ignored while generating the index headers. The IGNORE_PREFIX\n# tag works for classes, function and member names. The entity will be placed in\n# the alphabetical list under the first letter of the entity name that remains\n# after removing the prefix.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nIGNORE_PREFIX          = DEFINE_ENUM\n\n#---------------------------------------------------------------------------\n# Configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output\n# The default value is: YES.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_OUTPUT            = .\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\n# generated HTML page (for example: .htm, .php, .asp).\n# The default value is: .html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\n# each generated HTML page. If the tag is left blank doxygen will generate a\n# standard header.\n#\n# To get valid HTML the header file that includes any scripts and style sheets\n# that doxygen needs, which is dependent on the configuration options used (e.g.\n# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\n# default header using\n# doxygen -w html new_header.html new_footer.html new_stylesheet.css\n# YourConfigFile\n# and then modify the file new_header.html. See also section \"Doxygen usage\"\n# for information on how to generate the default header that doxygen normally\n# uses.\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. For a description\n# of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_HEADER            =\n\n# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\n# generated HTML page. If the tag is left blank doxygen will generate a standard\n# footer. See HTML_HEADER for more information on how to generate a default\n# footer and what special commands can be used inside the footer. See also\n# section \"Doxygen usage\" for information on how to generate the default footer\n# that doxygen normally uses.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FOOTER            =\n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\n# sheet that is used by each HTML page. It can be used to fine-tune the look of\n# the HTML output. If left blank doxygen will generate a default style sheet.\n# See also section \"Doxygen usage\" for information on how to generate the style\n# sheet that doxygen normally uses.\n# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\n# it is more robust and this tag (HTML_STYLESHEET) will in the future become\n# obsolete.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_STYLESHEET        =\n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# cascading style sheets that are included after the standard style sheets\n# created by doxygen. Using this option one can overrule certain style aspects.\n# This is preferred over using HTML_STYLESHEET since it does not replace the\n# standard style sheet and is therefore more robust against future updates.\n# Doxygen will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list).\n# Note: Since the styling of scrollbars can currently not be overruled in\n# Webkit/Chromium, the styling will be left out of the default doxygen.css if\n# one or more extra stylesheets have been specified. So if scrollbar\n# customization is desired it has to be added explicitly. For an example see the\n# documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_STYLESHEET  =\n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the HTML output directory. Note\n# that these files will be copied to the base HTML output directory. Use the\n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\n# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\n# files will be copied as-is; there are no commands or markers available.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_FILES       =\n\n# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output\n# should be rendered with a dark or light theme.\n# Possible values are: LIGHT always generate light mode output, DARK always\n# generate dark mode output, AUTO_LIGHT automatically set the mode according to\n# the user preference, use light mode if no preference is set (the default),\n# AUTO_DARK automatically set the mode according to the user preference, use\n# dark mode if no preference is set and TOGGLE allow to user to switch between\n# light and dark mode via a button.\n# The default value is: AUTO_LIGHT.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE        = AUTO_LIGHT\n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\n# will adjust the colors in the style sheet and background images according to\n# this color. Hue is specified as an angle on a color-wheel, see\n# https://en.wikipedia.org/wiki/Hue for more information. For instance the value\n# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\n# purple, and 360 is red again.\n# Minimum value: 0, maximum value: 359, default value: 220.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\n# in the HTML output. For a value of 0 the output will use gray-scales only. A\n# value of 255 will produce the most vivid colors.\n# Minimum value: 0, maximum value: 255, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\n# luminance component of the colors in the HTML output. Values below 100\n# gradually make the output lighter, whereas values above 100 make the output\n# darker. The value divided by 100 is the actual gamma applied, so 80 represents\n# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\n# change the gamma.\n# Minimum value: 40, maximum value: 240, default value: 80.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML\n# documentation will contain a main index with vertical navigation menus that\n# are dynamically created via JavaScript. If disabled, the navigation index will\n# consists of multiple levels of tabs that are statically embedded in every HTML\n# page. Disable this option to support browsers that do not have JavaScript,\n# like the Qt help browser.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_MENUS     = NO\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\n# documentation will contain sections that can be hidden and shown after the\n# page has loaded.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_SECTIONS  = NO\n\n# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be\n# dynamically folded and expanded in the generated HTML source code.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_CODE_FOLDING      = YES\n\n# If the HTML_COPY_CLIPBOARD tag is set to YES then doxygen will show an icon in\n# the top right corner of code and text fragments that allows the user to copy\n# its content to the clipboard. Note this only works if supported by the browser\n# and the web page is served via a secure context (see:\n# https://www.w3.org/TR/secure-contexts/), i.e. using the https: or file:\n# protocol.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COPY_CLIPBOARD    = YES\n\n# Doxygen stores a couple of settings persistently in the browser (via e.g.\n# cookies). By default these settings apply to all HTML pages generated by\n# doxygen across all projects. The HTML_PROJECT_COOKIE tag can be used to store\n# the settings under a project specific key, such that the user preferences will\n# be stored separately.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_PROJECT_COOKIE    =\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\n# shown in the various tree structured indices initially; the user can expand\n# and collapse entries dynamically later on. Doxygen will expand the tree to\n# such a level that at most the specified number of entries are visible (unless\n# a fully collapsed tree already exceeds this amount). So setting the number of\n# entries 1 will produce a full collapsed tree by default. 0 is a special value\n# representing an infinite number of entries and will result in a full expanded\n# tree by default.\n# Minimum value: 0, maximum value: 9999, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files will be\n# generated that can be used as input for Apple's Xcode 3 integrated development\n# environment (see:\n# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To\n# create a documentation set, doxygen will generate a Makefile in the HTML\n# output directory. Running make will produce the docset in that directory and\n# running make install will install the docset in\n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\n# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy\n# genXcode/_index.html for more information.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_DOCSET        = NO\n\n# This tag determines the name of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# The default value is: Doxygen generated docs.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# This tag determines the URL of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDURL         =\n\n# This tag specifies a string that should uniquely identify the documentation\n# set bundle. This should be a reverse domain-name style string, e.g.\n# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\n# the documentation publisher. This should be a reverse domain-name style\n# string, e.g. com.mycompany.MyDocSet.documentation.\n# The default value is: org.doxygen.Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\n# The default value is: Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\n# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\n# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\n# on Windows. In the beginning of 2021 Microsoft took the original page, with\n# a.o. the download links, offline the HTML help workshop was already many years\n# in maintenance mode). You can download the HTML help workshop from the web\n# archives at Installation executable (see:\n# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo\n# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).\n#\n# The HTML Help Workshop contains a compiler that can convert all HTML output\n# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\n# files are now used as the Windows 98 help format, and will replace the old\n# Windows help format (.hlp) on all Windows platforms in the future. Compressed\n# HTML files also contain an index, a table of contents, and you can search for\n# words in the documentation. The HTML workshop also contains a viewer for\n# compressed HTML files.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_HTMLHELP      = NO\n\n# The CHM_FILE tag can be used to specify the file name of the resulting .chm\n# file. You can add a path in front of the file if the result should not be\n# written to the html output directory.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_FILE               =\n\n# The HHC_LOCATION tag can be used to specify the location (absolute path\n# including file name) of the HTML help compiler (hhc.exe). If non-empty,\n# doxygen will try to run the HTML help compiler on the generated index.hhp.\n# The file has to be specified with full path.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nHHC_LOCATION           =\n\n# The GENERATE_CHI flag controls if a separate .chi index file is generated\n# (YES) or that it should be included in the main .chm file (NO).\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nGENERATE_CHI           = NO\n\n# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)\n# and project file content.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_INDEX_ENCODING     =\n\n# The BINARY_TOC flag controls whether a binary table of contents is generated\n# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it\n# enables the Previous and Next buttons.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members to\n# the table of contents of the HTML help documentation and to the tree view.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nTOC_EXPAND             = NO\n\n# The SITEMAP_URL tag is used to specify the full URL of the place where the\n# generated documentation will be placed on the server by the user during the\n# deployment of the documentation. The generated sitemap is called sitemap.xml\n# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL\n# is specified no sitemap is generated. For information about the sitemap\n# protocol see https://www.sitemaps.org\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSITEMAP_URL            =\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\n# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\n# (.qch) of the generated HTML documentation.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_QHP           = YES\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\n# the file name of the resulting .qch file. The path specified is relative to\n# the HTML output folder.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQCH_FILE               =\n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\n# Project output. For more information please see Qt Help Project / Namespace\n# (see:\n# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\n# Help Project output. For more information please see Qt Help Project / Virtual\n# Folders (see:\n# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).\n# The default value is: doc.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\n# filter to add. For more information please see Qt Help Project / Custom\n# Filters (see:\n# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_NAME   =\n\n# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\n# custom filter to add. For more information please see Qt Help Project / Custom\n# Filters (see:\n# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_ATTRS  =\n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\n# project's filter section matches. Qt Help Project / Filter Attributes (see:\n# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_SECT_FILTER_ATTRS  =\n\n# The QHG_LOCATION tag can be used to specify the location (absolute path\n# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to\n# run qhelpgenerator on the generated .qhp file.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHG_LOCATION           =\n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\n# generated, together with the HTML files, they form an Eclipse help plugin. To\n# install this plugin and make it available under the help contents menu in\n# Eclipse, the contents of the directory containing the HTML and XML files needs\n# to be copied into the plugins directory of eclipse. The name of the directory\n# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\n# After copying Eclipse needs to be restarted before the help appears.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the Eclipse help plugin. When installing the plugin\n# the directory name containing the HTML and XML files should also have this\n# name. Each documentation set should have its own identifier.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# If you want full control over the layout of the generated HTML pages it might\n# be necessary to disable the index and replace it with your own. The\n# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\n# of each HTML page. A value of NO enables the index and the value YES disables\n# it. Since the tabs in the index contain the same information as the navigation\n# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n# structure should be generated to display hierarchical information. If the tag\n# value is set to YES, a side panel will be generated containing a tree-like\n# index structure (just like the one that is generated for HTML Help). For this\n# to work a browser that supports JavaScript, DHTML, CSS and frames is required\n# (i.e. any modern browser). Windows users are probably better off using the\n# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can\n# further fine tune the look of the index (see \"Fine-tuning the output\"). As an\n# example, the default style sheet generated by doxygen has an example that\n# shows how to put an image at the root of the tree instead of the PROJECT_NAME.\n# Since the tree basically has the same information as the tab index, you could\n# consider setting DISABLE_INDEX to YES when enabling this option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_TREEVIEW      = NO\n\n# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the\n# FULL_SIDEBAR option determines if the side bar is limited to only the treeview\n# area (value NO) or if it should extend to the full height of the window (value\n# YES). Setting this to YES gives a layout similar to\n# https://docs.readthedocs.io with more room for contents, but less room for the\n# project logo, title, and description. If either GENERATE_TREEVIEW or\n# DISABLE_INDEX is set to NO, this option has no effect.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFULL_SIDEBAR           = NO\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\n# doxygen will group on one line in the generated HTML documentation.\n#\n# Note that a value of 0 will completely suppress the enum values from appearing\n# in the overview section.\n# Minimum value: 0, maximum value: 20, default value: 4.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\n# to set the initial width (in pixels) of the frame in which the tree is shown.\n# Minimum value: 0, maximum value: 1500, default value: 250.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nTREEVIEW_WIDTH         = 250\n\n# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to\n# external symbols imported via tag files in a separate window.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nEXT_LINKS_IN_WINDOW    = NO\n\n# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email\n# addresses.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nOBFUSCATE_EMAILS       = YES\n\n# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg\n# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see\n# https://inkscape.org) to generate formulas as SVG images instead of PNGs for\n# the HTML output. These images will generally look nicer at scaled resolutions.\n# Possible values are: png (the default) and svg (looks nicer but requires the\n# pdf2svg or inkscape tool).\n# The default value is: png.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FORMULA_FORMAT    = png\n\n# Use this tag to change the font size of LaTeX formulas included as images in\n# the HTML documentation. When you change the font size after a successful\n# doxygen run you need to manually remove any form_*.png images from the HTML\n# output directory to force them to be regenerated.\n# Minimum value: 8, maximum value: 50, default value: 10.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_FONTSIZE       = 10\n\n# The FORMULA_MACROFILE can contain LaTeX \\newcommand and \\renewcommand commands\n# to create new LaTeX commands to be used in formulas as building blocks. See\n# the section \"Including formulas\" for details.\n\nFORMULA_MACROFILE      =\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\n# https://www.mathjax.org) which uses client side JavaScript for the rendering\n# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX\n# installed or if you want to formulas look prettier in the HTML output. When\n# enabled you may also need to install MathJax separately and configure the path\n# to it using the MATHJAX_RELPATH option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nUSE_MATHJAX            = NO\n\n# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.\n# Note that the different versions of MathJax have different requirements with\n# regards to the different settings, so it is possible that also other MathJax\n# settings have to be changed when switching between the different MathJax\n# versions.\n# Possible values are: MathJax_2 and MathJax_3.\n# The default value is: MathJax_2.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_VERSION        = MathJax_2\n\n# When MathJax is enabled you can set the default output format to be used for\n# the MathJax output. For more details about the output format see MathJax\n# version 2 (see:\n# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3\n# (see:\n# http://docs.mathjax.org/en/latest/web/components/output.html).\n# Possible values are: HTML-CSS (which is slower, but has the best\n# compatibility. This is the name for Mathjax version 2, for MathJax version 3\n# this will be translated into chtml), NativeMML (i.e. MathML. Only supported\n# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This\n# is the name for Mathjax version 3, for MathJax version 2 this will be\n# translated into HTML-CSS) and SVG.\n# The default value is: HTML-CSS.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the HTML\n# output directory using the MATHJAX_RELPATH option. The destination directory\n# should contain the MathJax.js script. For instance, if the mathjax directory\n# is located at the same level as the HTML output directory, then\n# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\n# Content Delivery Network so you can quickly see the result without installing\n# MathJax. However, it is strongly recommended to install a local copy of\n# MathJax from https://www.mathjax.org before deployment. The default value is:\n# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2\n# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_RELPATH        =\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\n# extension names that should be enabled during MathJax rendering. For example\n# for MathJax version 2 (see\n# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):\n# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\n# For example for MathJax version 3 (see\n# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):\n# MATHJAX_EXTENSIONS = ams\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_EXTENSIONS     =\n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\n# of code that will be used on startup of the MathJax code. See the MathJax site\n# (see:\n# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an\n# example see the documentation.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_CODEFILE       =\n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\n# the HTML output. The underlying search engine uses javascript and DHTML and\n# should work on any modern browser. Note that when using HTML help\n# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\n# there is already a search function so this one should typically be disabled.\n# For large projects the javascript based search engine can be slow, then\n# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\n# search using the keyboard; to jump to the search box use <access key> + S\n# (what the <access key> is depends on the OS and browser, but it is typically\n# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\n# key> to jump into the search results window, the results can be navigated\n# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\n# the search. The filter options can be selected when the cursor is inside the\n# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\n# to select a filter and <Enter> or <escape> to activate or cancel the filter\n# option.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\n# implemented using a web server instead of a web client using JavaScript. There\n# are two flavors of web server based searching depending on the EXTERNAL_SEARCH\n# setting. When disabled, doxygen will generate a PHP script for searching and\n# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing\n# and searching needs to be provided by external tools. See the section\n# \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\n# script for searching. Instead the search results are written to an XML file\n# which needs to be processed by an external indexer. Doxygen will invoke an\n# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\n# search results.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see:\n# https://xapian.org/).\n#\n# See the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server\n# which will return the search results when EXTERNAL_SEARCH is enabled.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see:\n# https://xapian.org/). See the section \"External Indexing and Searching\" for\n# details.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHENGINE_URL       =\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\n# search data is written to a file for indexing by an external tool. With the\n# SEARCHDATA_FILE tag the name of this file can be specified.\n# The default file is: searchdata.xml.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\n# projects and redirect the results back to the right project.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH_ID     =\n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\n# projects other than the one defined by this configuration file, but that are\n# all added to the same external search index. Each project needs to have a\n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\n# to a relative location where the documentation can be found. The format is:\n# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTRA_SEARCH_MAPPINGS  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.\n# The default value is: YES.\n\nGENERATE_LATEX         = YES\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\n# invoked.\n#\n# Note that when not enabling USE_PDFLATEX the default is latex when enabling\n# USE_PDFLATEX the default is pdflatex and when in the later case latex is\n# chosen this is overwritten by pdflatex. For specific output languages the\n# default can have been set differently, this depends on the implementation of\n# the output language.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_CMD_NAME         =\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\n# index for LaTeX.\n# Note: This tag is used in the Makefile / make.bat.\n# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file\n# (.tex).\n# The default file is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to\n# generate index for LaTeX. In case there is no backslash (\\) as first character\n# it will be automatically added in the LaTeX code.\n# Note: This tag is used in the generated output file (.tex).\n# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.\n# The default value is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_MAKEINDEX_CMD    = makeindex\n\n# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used by the\n# printer.\n# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\n# 14 inches) and executive (7.25 x 10.5 inches).\n# The default value is: a4.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPAPER_TYPE             = a4\n\n# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\n# that should be included in the LaTeX output. The package can be specified just\n# by its name or with the correct syntax as to be used with the LaTeX\n# \\usepackage command. To get the times font for instance you can specify :\n# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}\n# To use the option intlimits with the amsmath package you can specify:\n# EXTRA_PACKAGES=[intlimits]{amsmath}\n# If left blank no extra packages will be included.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nEXTRA_PACKAGES         =\n\n# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for\n# the generated LaTeX document. The header should contain everything until the\n# first chapter. If it is left blank doxygen will generate a standard header. It\n# is highly recommended to start with a default header using\n# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty\n# and then modify the file new_header.tex. See also section \"Doxygen usage\" for\n# information on how to generate the default header that doxygen normally uses.\n#\n# Note: Only use a user-defined header if you know what you are doing!\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. The following\n# commands have a special meaning inside the header (and footer): For a\n# description of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HEADER           =\n\n# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for\n# the generated LaTeX document. The footer should contain everything after the\n# last chapter. If it is left blank doxygen will generate a standard footer. See\n# LATEX_HEADER for more information on how to generate a default footer and what\n# special commands can be used inside the footer. See also section \"Doxygen\n# usage\" for information on how to generate the default footer that doxygen\n# normally uses. Note: Only use a user-defined footer if you know what you are\n# doing!\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_FOOTER           =\n\n# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# LaTeX style sheets that are included after the standard style sheets created\n# by doxygen. Using this option one can overrule certain style aspects. Doxygen\n# will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list).\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_STYLESHEET =\n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the LATEX_OUTPUT output\n# directory. Note that the files will be copied as-is; there are no commands or\n# markers available.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_FILES      =\n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\n# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\n# contain links (just like the HTML output) instead of page references. This\n# makes the output suitable for online browsing using a PDF viewer.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as\n# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX\n# files. Set this option to YES, to get a higher quality PDF documentation.\n#\n# See also section LATEX_CMD_NAME for selecting the engine.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nUSE_PDFLATEX           = YES\n\n# The LATEX_BATCHMODE tag signals the behavior of LaTeX in case of an error.\n# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch\n# mode nothing is printed on the terminal, errors are scrolled as if <return> is\n# hit at every error; missing files that TeX tries to input or request from\n# keyboard input (\\read on a not open input stream) cause the job to abort,\n# NON_STOP In nonstop mode the diagnostic message will appear on the terminal,\n# but there is no possibility of user interaction just like in batch mode,\n# SCROLL In scroll mode, TeX will stop only for missing files to input or if\n# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at\n# each error, asking for user intervention.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BATCHMODE        = NO\n\n# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\n# index chapters (such as File Index, Compound Index, etc.) in the output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HIDE_INDICES     = NO\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\n# bibliography, e.g. plainnat, or ieeetr. See\n# https://en.wikipedia.org/wiki/BibTeX and \\cite for more info.\n# The default value is: plain.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BIB_STYLE        = plain\n\n# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)\n# path from which the emoji images will be read. If a relative path is entered,\n# it will be relative to the LATEX_OUTPUT directory. If left blank the\n# LATEX_OUTPUT directory will be used.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EMOJI_DIRECTORY  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The\n# RTF output is optimized for Word 97 and may not look too pretty with other RTF\n# readers/editors.\n# The default value is: NO.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: rtf.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\n# contain hyperlink fields. The RTF file will contain links (just like the HTML\n# output) instead of page references. This makes the output suitable for online\n# browsing using Word or some other Word compatible readers that support those\n# fields.\n#\n# Note: WordPad (write) and others do not support links.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's\n# configuration file, i.e. a series of assignments. You only have to provide\n# replacements, missing definitions are set to their default value.\n#\n# See also section \"Doxygen usage\" for information on how to generate the\n# default style sheet that doxygen normally uses.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_STYLESHEET_FILE    =\n\n# Set optional variables used in the generation of an RTF document. Syntax is\n# similar to doxygen's configuration file. A template extensions file can be\n# generated using doxygen -e rtf extensionFile.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_EXTENSIONS_FILE    =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for\n# classes and files.\n# The default value is: NO.\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it. A directory man3 will be created inside the directory specified by\n# MAN_OUTPUT.\n# The default directory is: man.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to the generated\n# man pages. In case the manual section does not start with a number, the number\n# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\n# optional.\n# The default value is: .3.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_EXTENSION          = .3\n\n# The MAN_SUBDIR tag determines the name of the directory created within\n# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by\n# MAN_EXTENSION with the initial . removed.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_SUBDIR             =\n\n# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\n# will generate one additional man file for each entity documented in the real\n# man page(s). These additional files only source the real man page, but without\n# them the man command would be unable to find the correct page.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that\n# captures the structure of the code including all documentation.\n# The default value is: NO.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: xml.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_OUTPUT             = xml\n\n# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program\n# listings (including syntax highlighting and cross-referencing information) to\n# the XML output. Note that enabling this will significantly increase the size\n# of the XML output.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_PROGRAMLISTING     = YES\n\n# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include\n# namespace members in file scope as well, matching the HTML output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_NS_MEMB_FILE_SCOPE = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files\n# that can be used to generate PDF.\n# The default value is: NO.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\n# front of it.\n# The default directory is: docbook.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_OUTPUT         = docbook\n\n#---------------------------------------------------------------------------\n# Configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an\n# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures\n# the structure of the code including all documentation. Note that this feature\n# is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to Sqlite3 output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_SQLITE3 tag is set to YES doxygen will generate a Sqlite3\n# database with symbols found by doxygen stored in tables.\n# The default value is: NO.\n\nGENERATE_SQLITE3       = NO\n\n# The SQLITE3_OUTPUT tag is used to specify where the Sqlite3 database will be\n# put. If a relative path is entered the value of OUTPUT_DIRECTORY will be put\n# in front of it.\n# The default directory is: sqlite3.\n# This tag requires that the tag GENERATE_SQLITE3 is set to YES.\n\nSQLITE3_OUTPUT         = sqlite3\n\n# The SQLITE3_RECREATE_DB tag is set to YES, the existing doxygen_sqlite3.db\n# database file will be recreated with each doxygen run. If set to NO, doxygen\n# will warn if a database file is already found and not modify it.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_SQLITE3 is set to YES.\n\nSQLITE3_RECREATE_DB    = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module\n# file that captures the structure of the code including all documentation.\n#\n# Note that this feature is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary\n# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\n# output from the Perl module output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely\n# formatted so it can be parsed by a human reader. This is useful if you want to\n# understand what is going on. On the other hand, if this tag is set to NO, the\n# size of the Perl module output will be much smaller and Perl will parse it\n# just the same.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file are\n# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\n# so different doxyrules.make files included by the same Makefile don't\n# overwrite each other's variables.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_MAKEVAR_PREFIX =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all\n# C-preprocessor directives found in the sources and include files.\n# The default value is: YES.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names\n# in the source code. If set to NO, only conditional compilation will be\n# performed. Macro expansion can be done in a controlled way by setting\n# EXPAND_ONLY_PREDEF to YES.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nMACRO_EXPANSION        = YES\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n# the macro expansion is limited to the macros specified with the PREDEFINED and\n# EXPAND_AS_DEFINED tags.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES, the include files in the\n# INCLUDE_PATH will be searched if a #include is found.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that\n# contain include files that are not input files but should be processed by the\n# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of\n# RECURSIVE has no effect here.\n# This tag requires that the tag SEARCH_INCLUDES is set to YES.\n\nINCLUDE_PATH           =\n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\n# patterns (like *.h and *.hpp) to filter out the header-files in the\n# directories. If left blank, the patterns specified with FILE_PATTERNS will be\n# used.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nINCLUDE_FILE_PATTERNS  =\n\n# The PREDEFINED tag can be used to specify one or more macro names that are\n# defined before the preprocessor is started (similar to the -D option of e.g.\n# gcc). The argument of the tag is a list of macros of the form: name or\n# name=definition (no spaces). If the definition and the \"=\" are omitted, \"=1\"\n# is assumed. To prevent a macro definition from being undefined via #undef or\n# recursively expanded use the := operator instead of the = operator.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nPREDEFINED             = DOXYGEN_SHOULD_SKIP_THIS  BUILD_DEBUG\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n# tag can be used to specify a list of macro names that should be expanded. The\n# macro definition that is found in the sources will be used. Use the PREDEFINED\n# tag if you want to use a different macro definition that overrules the\n# definition found in the source code.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_AS_DEFINED      =\n\n# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\n# remove all references to function-like macros that are alone on a line, have\n# an all uppercase name, and do not end with a semicolon. Such function macros\n# are typically used for boiler-plate code, and will confuse the parser if not\n# removed.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSKIP_FUNCTION_MACROS   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES tag can be used to specify one or more tag files. For each tag\n# file the location of the external documentation should be added. The format of\n# a tag file without this location is as follows:\n# TAGFILES = file1 file2 ...\n# Adding location for the tag files is done as follows:\n# TAGFILES = file1=loc1 \"file2 = loc2\" ...\n# where loc1 and loc2 can be relative or absolute paths or URLs. See the\n# section \"Linking to external documentation\" for more information about the use\n# of tag files.\n# Note: Each tag file must have a unique name (where the name does NOT include\n# the path). If a tag file is not located in the directory in which doxygen is\n# run, you must also specify the path to the tagfile here.\n\nTAGFILES               =\n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\n# tag file that is based on the input files it reads. See section \"Linking to\n# external documentation\" for more information about the usage of tag files.\n\nGENERATE_TAGFILE       =\n\n# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces\n# will be listed in the class and namespace index. If set to NO, only the\n# inherited external classes will be listed.\n# The default value is: NO.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed\n# in the topic index. If set to NO, only the current project's groups will be\n# listed.\n# The default value is: YES.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in\n# the related pages index. If set to NO, only the current project's pages will\n# be listed.\n# The default value is: YES.\n\nEXTERNAL_PAGES         = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to diagram generator tools\n#---------------------------------------------------------------------------\n\n# If set to YES the inheritance and collaboration graphs will hide inheritance\n# and usage relations if the target is undocumented or is not a class.\n# The default value is: YES.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\n# available from the path. This tool is part of Graphviz (see:\n# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\n# Bell Labs. The other options in this section have no effect if this option is\n# set to NO\n# The default value is: NO.\n\nHAVE_DOT               = YES\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\n# to run in parallel. When set to 0 doxygen will base this on the number of\n# processors available in the system. You can set it explicitly to a value\n# larger than 0 to get control over the balance between CPU load and processing\n# speed.\n# Minimum value: 0, maximum value: 32, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NUM_THREADS        = 0\n\n# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of\n# subgraphs. When you want a differently looking font in the dot files that\n# doxygen generates you can specify fontname, fontcolor and fontsize attributes.\n# For details please see <a href=https://graphviz.org/doc/info/attrs.html>Node,\n# Edge and Graph Attributes specification</a> You need to make sure dot is able\n# to find the font, which can be done by putting it in a standard location or by\n# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the\n# directory containing the font. Default graphviz fontsize is 14.\n# The default value is: fontname=Helvetica,fontsize=10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_COMMON_ATTR        = \"fontname=Helvetica,fontsize=10\"\n\n# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can\n# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. <a\n# href=https://graphviz.org/doc/info/arrows.html>Complete documentation about\n# arrows shapes.</a>\n# The default value is: labelfontname=Helvetica,labelfontsize=10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_EDGE_ATTR          = \"labelfontname=Helvetica,labelfontsize=10\"\n\n# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes\n# around nodes set 'shape=plain' or 'shape=plaintext' <a\n# href=https://www.graphviz.org/doc/info/shapes.html>Shapes specification</a>\n# The default value is: shape=box,height=0.2,width=0.4.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NODE_ATTR          = \"shape=box,height=0.2,width=0.4\"\n\n# You can set the path where dot can find font specified with fontname in\n# DOT_COMMON_ATTR and others dot attributes.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTPATH           =\n\n# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will\n# generate a graph for each documented class showing the direct and indirect\n# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and\n# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case\n# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the\n# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used.\n# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance\n# relations will be shown as texts / links. Explicit enabling an inheritance\n# graph or choosing a different representation for an inheritance graph of a\n# specific class, can be accomplished by means of the command \\inheritancegraph.\n# Disabling an inheritance graph can be accomplished by means of the command\n# \\hideinheritancegraph.\n# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN.\n# The default value is: YES.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\n# graph for each documented class showing the direct and indirect implementation\n# dependencies (inheritance, containment, and class references variables) of the\n# class with other documented classes. Explicit enabling a collaboration graph,\n# when COLLABORATION_GRAPH is set to NO, can be accomplished by means of the\n# command \\collaborationgraph. Disabling a collaboration graph can be\n# accomplished by means of the command \\hidecollaborationgraph.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCOLLABORATION_GRAPH    = NO\n\n# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\n# groups, showing the direct groups dependencies. Explicit enabling a group\n# dependency graph, when GROUP_GRAPHS is set to NO, can be accomplished by means\n# of the command \\groupgraph. Disabling a directory graph can be accomplished by\n# means of the command \\hidegroupgraph. See also the chapter Grouping in the\n# manual.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and\n# collaboration diagrams in a style similar to the OMG's Unified Modeling\n# Language.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LOOK               = NO\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\n# class node. If there are many fields or methods and many nodes the graph may\n# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\n# number of items for each type to make the size more manageable. Set this to 0\n# for no limit. Note that the threshold may be exceeded by 50% before the limit\n# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\n# but if the number exceeds 15, the total amount of fields shown is limited to\n# 10.\n# Minimum value: 0, maximum value: 100, default value: 10.\n# This tag requires that the tag UML_LOOK is set to YES.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and\n# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS\n# tag is set to YES, doxygen will add type and arguments for attributes and\n# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen\n# will not generate fields with class member information in the UML graphs. The\n# class diagrams will look similar to the default class diagrams but using UML\n# notation for the relationships.\n# Possible values are: NO, YES and NONE.\n# The default value is: NO.\n# This tag requires that the tag UML_LOOK is set to YES.\n\nDOT_UML_DETAILS        = NO\n\n# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters\n# to display on a single line. If the actual line length exceeds this threshold\n# significantly it will be wrapped across multiple lines. Some heuristics are\n# applied to avoid ugly line breaks.\n# Minimum value: 0, maximum value: 1000, default value: 17.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_WRAP_THRESHOLD     = 17\n\n# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\n# collaboration graphs will show the relations between templates and their\n# instances.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nTEMPLATE_RELATIONS     = YES\n\n# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\n# YES then doxygen will generate a graph for each documented file showing the\n# direct and indirect include dependencies of the file with other documented\n# files. Explicit enabling an include graph, when INCLUDE_GRAPH is is set to NO,\n# can be accomplished by means of the command \\includegraph. Disabling an\n# include graph can be accomplished by means of the command \\hideincludegraph.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDE_GRAPH          = YES\n\n# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\n# set to YES then doxygen will generate a graph for each documented file showing\n# the direct and indirect include dependencies of the file with other documented\n# files. Explicit enabling an included by graph, when INCLUDED_BY_GRAPH is set\n# to NO, can be accomplished by means of the command \\includedbygraph. Disabling\n# an included by graph can be accomplished by means of the command\n# \\hideincludedbygraph.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable call graphs for selected\n# functions only using the \\callgraph command. Disabling a call graph can be\n# accomplished by means of the command \\hidecallgraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable caller graphs for selected\n# functions only using the \\callergraph command. Disabling a caller graph can be\n# accomplished by means of the command \\hidecallergraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\n# hierarchy of all classes instead of a textual one.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\n# dependencies a directory has on other directories in a graphical way. The\n# dependency relations are determined by the #include relations between the\n# files in the directories. Explicit enabling a directory graph, when\n# DIRECTORY_GRAPH is set to NO, can be accomplished by means of the command\n# \\directorygraph. Disabling a directory graph can be accomplished by means of\n# the command \\hidedirectorygraph.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDIRECTORY_GRAPH        = YES\n\n# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels\n# of child directories generated in directory dependency graphs by dot.\n# Minimum value: 1, maximum value: 25, default value: 1.\n# This tag requires that the tag DIRECTORY_GRAPH is set to YES.\n\nDIR_GRAPH_MAX_DEPTH    = 1\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\n# generated by dot. For an explanation of the image formats see the section\n# output formats in the documentation of the dot tool (Graphviz (see:\n# https://www.graphviz.org/)).\n# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\n# to make the SVG files visible in IE 9+ (other browsers do not have this\n# requirement).\n# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,\n# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and\n# png:gdiplus:gdiplus.\n# The default value is: png.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_IMAGE_FORMAT       = png\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\n# enable generation of interactive SVG images that allow zooming and panning.\n#\n# Note that this requires a modern browser other than Internet Explorer. Tested\n# and working are Firefox, Chrome, Safari, and Opera.\n# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\n# the SVG files visible. Older versions of IE do not have SVG support.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINTERACTIVE_SVG        = NO\n\n# The DOT_PATH tag can be used to specify the path where the dot tool can be\n# found. If left blank, it is assumed the dot tool can be found in the path.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_PATH               =\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that\n# contain dot files that are included in the documentation (see the \\dotfile\n# command).\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOTFILE_DIRS           =\n\n# You can include diagrams made with dia in doxygen documentation. Doxygen will\n# then run dia to produce the diagram and insert it in the documentation. The\n# DIA_PATH tag allows you to specify the directory where the dia binary resides.\n# If left empty dia is assumed to be found in the default search path.\n\nDIA_PATH               =\n\n# The DIAFILE_DIRS tag can be used to specify one or more directories that\n# contain dia files that are included in the documentation (see the \\diafile\n# command).\n\nDIAFILE_DIRS           =\n\n# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the\n# path where java can find the plantuml.jar file or to the filename of jar file\n# to be used. If left blank, it is assumed PlantUML is not used or called during\n# a preprocessing step. Doxygen will generate a warning when it encounters a\n# \\startuml command in this case and will not generate output for the diagram.\n\nPLANTUML_JAR_PATH      =\n\n# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a\n# configuration file for plantuml.\n\nPLANTUML_CFG_FILE      =\n\n# When using plantuml, the specified paths are searched for files specified by\n# the !include statement in a plantuml block.\n\nPLANTUML_INCLUDE_PATH  =\n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\n# that will be shown in the graph. If the number of nodes in a graph becomes\n# larger than this value, doxygen will truncate the graph, which is visualized\n# by representing a node as a red box. Note that doxygen if the number of direct\n# children of the root node in a graph is already larger than\n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\n# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n# Minimum value: 0, maximum value: 10000, default value: 50.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\n# generated by dot. A depth value of 3 means that only nodes reachable from the\n# root by following a path via at most 3 edges will be shown. Nodes that lay\n# further from the root node will be omitted. Note that setting this option to 1\n# or 2 may greatly reduce the computation time needed for large code bases. Also\n# note that the size of a graph can be further restricted by\n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n# Minimum value: 0, maximum value: 1000, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output\n# files in one run (i.e. multiple -o and -T options on the command line). This\n# makes dot run faster, but since only newer versions of dot (>1.8.10) support\n# this, this feature is disabled by default.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\n# explaining the meaning of the various boxes and arrows in the dot generated\n# graphs.\n# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal\n# graphical representation for inheritance and collaboration diagrams is used.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate\n# files that are used to generate the various graphs.\n#\n# Note: This setting is not only used for dot files but also for msc temporary\n# files.\n# The default value is: YES.\n\nDOT_CLEANUP            = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc\n# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will\n# use a built-in version of mscgen tool to produce the charts. Alternatively,\n# the MSCGEN_TOOL tag can also specify the name an external tool. For instance,\n# specifying prog as the value, doxygen will call the tool as prog -T\n# <outfile_format> -o <outputfile> <inputfile>. The external tool should support\n# output file formats \"png\", \"eps\", \"svg\", and \"ismap\".\n\nMSCGEN_TOOL            =\n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that\n# contain msc files that are included in the documentation (see the \\mscfile\n# command).\n\nMSCFILE_DIRS           =\n"
  },
  {
    "path": "LICENSE",
    "content": "                  GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\n                  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n\n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n                            NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301\n    USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random\n  Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n"
  },
  {
    "path": "Makefile",
    "content": "#\n#  There exist several targets which are by default empty and which can be \n#  used for execution of your targets. These targets are usually executed \n#  before and after some main targets. They are: \n#\n#     .build-pre:              called before 'build' target\n#     .build-post:             called after 'build' target\n#     .clean-pre:              called before 'clean' target\n#     .clean-post:             called after 'clean' target\n#     .clobber-pre:            called before 'clobber' target\n#     .clobber-post:           called after 'clobber' target\n#     .all-pre:                called before 'all' target\n#     .all-post:               called after 'all' target\n#     .help-pre:               called before 'help' target\n#     .help-post:              called after 'help' target\n#\n#  Targets beginning with '.' are not intended to be called on their own.\n#\n#  Main targets can be executed directly, and they are:\n#  \n#     build                    build a specific configuration\n#     clean                    remove built files from a configuration\n#     clobber                  remove all built files\n#     all                      build all configurations\n#     help                     print help mesage\n#  \n#  Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and\n#  .help-impl are implemented in nbproject/makefile-impl.mk.\n#\n#  Available make variables:\n#\n#     CND_BASEDIR                base directory for relative paths\n#     CND_DISTDIR                default top distribution directory (build artifacts)\n#     CND_BUILDDIR               default top build directory (object files, ...)\n#     CONF                       name of current configuration\n#     CND_PLATFORM_${CONF}       platform name (current configuration)\n#     CND_ARTIFACT_DIR_${CONF}   directory of build artifact (current configuration)\n#     CND_ARTIFACT_NAME_${CONF}  name of build artifact (current configuration)\n#     CND_ARTIFACT_PATH_${CONF}  path to build artifact (current configuration)\n#     CND_PACKAGE_DIR_${CONF}    directory of package (current configuration)\n#     CND_PACKAGE_NAME_${CONF}   name of package (current configuration)\n#     CND_PACKAGE_PATH_${CONF}   path to package (current configuration)\n#\n# NOCDDL\n\n\n# Environment \nMKDIR=mkdir\nCP=cp\nCCADMIN=CCadmin\n\n\n# build\nbuild: .build-post\n\t\n\n.build-pre: \n# Add your pre 'build' code here...\n\n.build-post: .build-impl\n# Add your post 'build' code here...\n\n# clean\nclean: .clean-post\n\n.clean-pre:\n# Add your pre 'clean' code here...\n\n.clean-post: .clean-impl\n# Add your post 'clean' code here...\n\n\n# clobber\nclobber: .clobber-post\n\n.clobber-pre:\n# Add your pre 'clobber' code here...\n\n.clobber-post: .clobber-impl\n# Add your post 'clobber' code here...\n\n\n# all\nall: .all-post\n\n.all-pre:\n# Add your pre 'all' code here...\n\n.all-post: .all-impl\n# Add your post 'all' code here...\n\n\n# build tests\nbuild-tests: .build-tests-post\n\n.build-tests-pre:\n# Add your pre 'build-tests' code here...\n\n.build-tests-post: .build-tests-impl\n# Add your post 'build-tests' code here...\n\n\n# run tests\ntest: .test-post\n\n.test-pre: build-tests\n# Add your pre 'test' code here...\n\n.test-post: .test-impl\n# Add your post 'test' code here...\n\n\n# help\nhelp: .help-post\n\n.help-pre:\n# Add your pre 'help' code here...\n\n.help-post: .help-impl\n# Add your post 'help' code here...\n\n\n\n# include project implementation makefile\ninclude nbproject/Makefile-impl.mk\n\n# include project make variables\ninclude nbproject/Makefile-variables.mk\n"
  },
  {
    "path": "README.md",
    "content": "---\n\n# Project moved to https://github.com/afteri-ru/trusted-cpp\n\n---\n\n\n## Memory Safety for C++\n\nThere are many projects that want to make C++ a \"safer\" programming language.\nBut making changes to the language syntax usually breaks backward compatibility with older code written earlier.\n\nThis project contains code for a library header file and compiler plugin for *safe C++*, \nwhich fixes C++'s core problems with memory and reference data types without breaking backwards compatibility with old legacy code.\n\n### Motivation\n\n> The global problem of the C and C++ languages ​​is that the pointer to the allocated memory block in the heap is an ordinary address\n> in RAM and has no connection with variables - pointers that are in local variables on the stack,\n> and whose lifetime is controlled by the compiler.\n>\n> The second, no less serious problem, which often leads to undefined behavior (Undefined Behavior)\n> or data races (Data Races) is access to the same memory area from different threads at the same time.\n\nThere are many projects that want to make C++ a \"safer\" programming language.\nBut making changes to the language's syntax usually breaks backward compatibility with older code written earlier.\n\nThis project contains a header only library and a compiler plugin for *safe C++*,\nwhich fixes the main problems of C++ when working with memory and reference data types\nwithout breaking backward compatibility with old legacy code (it uses C++20, but can be downgraded to C++17 or C++11).\n\nThe method of marking objects in the source code and configuring the plugin's operation parameters\nis performed using C++ attributes, which is very similar to the security profiles\n[p3038](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p3038r0.pdf) by Bjarne Stroustrup\nand [P3081](https://isocpp.org/files/papers/P3081R0.pdf) by Herb Sutter,\nbut does not require the creation of a new standard (it is enough to use the existing C++20).\n\n\n### Concept\n\nThe concept of safe memory management consists of implementing the following principles:\n- If the program is guaranteed to have no strong cyclic references\n(references of an object to itself or cross-references between several objects),\nthen when implementing the [RAII](https://en.wikipedia.org/wiki/Resource_acquisition_is_initialization) principle\n*automatic memory release will be performed **always***.\n- The absence of cyclic references in the program code can only be guaranteed by prohibiting them at the level of *types* (class definitions).\n- The problem of data races when accessing memory from different threads is solved by using inter-thread synchronization objects,\nand to prevent errors in logic, only one operator (function call) should be used to capture\nthe synchronization object and dereference the reference at the same time in one place.\n\nThe concept of safe memory management is ported to C++ from the [NewLang](https://newlang.net/) language,\nbut is implemented using the standard C++ template classes *shared_ptr* and *weak_ptr*.\n\nThe main difference when working with reference variables, compared to shared_ptr and weak_ptr, \nis the method of dereferencing references (getting the address of an object), \nand the method of accessing the object, which can be done not only by dereferencing the reference \"*\", \nbut also by capturing (locking) the reference and storing it in a temporary variable, \nthe lifetime of which is limited and automatically controlled by the compiler, \nand through it direct access to the data itself (the object) is carried out.\n\nSuch an automatic variable is a *temporary* strong reference holder and is similar to\n[std::lock_guard](https://en.cppreference.com/w/cpp/thread/lock_guard) - a synchronization object holder \nuntil the end of the current scope (lifetime), after which it is automatically deleted by the compiler.\n\n### Implementation\n\nThe implementation of the concept of safe work with memory for C++ consists of two parts: a plugin for Clang and a header file of the library.\n\nClang plugin performs static analysis of C++ code during its compilation. \nIt checks for invalidation of reference types (iterators, std::span, std::string_view, etc.) \nwhen data in the original variable is changed and controls strong **cyclic** references \nat the type level (class definitions) of any nesting **\\***).\n\nThe library file contains template classes that extend the standard *std::shared_ptr* and *std::weak_ptr* \nand add automatic data race protection to them when accessing shared variables from different threads \n(the access control method must be specified when defining the variable, after which the acquisition \nand release of the synchronization object will occur automatically when the reference is renamed).\n*By default, shared variables are created without multi-thread access control \nand have no additional overhead compared to the standard template classes `std::shared_ptr` and `std::weak_ptr`*.\n\nThe library header file also contains options for controlling the analyzer plugin \n(a list of classes that need to be monitored for invalid reference data types is defined).\n\n---\n\n**\\***) - since C++ compiles files separately, and the class (data structure) \ndefinition may be in a different translation unit due to forward declaration,\ntwo passes may be required for the circular reference analyzer to work correctly.\n*First run the plugin with the '--circleref-write -fsyntax-only' option to generate a list of classes with strong references, \nthen a second time with the '--circleref-read' option to perform the analysis. \nOr disable the circular reference analyzer completely with the '--circleref-disable' option.*\n\n\n## Examples\n\nCommand line for compiling a file with clang and using a plugin\n\n```bash\nclang++ -std=c++20 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang circleref-disable _example.cpp\n```\n\n### Output of the plugin with  pointer invalidation control:\n\n```cpp\n    std::vector<int> vec(100000, 0);\n    auto x = vec.begin();\n    vec = {};\n    vec.shrink_to_fit(); \n    std::sort(x, vec.end()); // malloc(): unaligned tcache chunk detected or Segmentation fault\n```\n\n**A fragment of the compiler plugin output with error messages related \nto invalidation of reference variables after changing data in the main variable:**\n\n```bash\n_example.cpp:29:17: warning: using main variable 'vect'\n   29 |                 vect = {};\n      |                 ^\n_example.cpp:30:17: warning: using main variable 'vect'\n   30 |                 vect.shrink_to_fit();\n      |                 ^\n_example.cpp:31:27: error: Using the dependent variable 'x' after changing the main variable 'vect'!\n   31 |                 std::sort(x, vect.end()); // malloc(): unaligned tcache chunk detected or Segmentation fault \n      |                           ^\n```\n\n\n### Example of analyzing classes with recursive references:\n\n```cpp\n\n    class SharedCross2;\n\n    class SharedCross {\n        SharedCross2 *cross2;\n    };\n\n    class SharedCross2 {\n        SharedCross *cross;\n    };\n```\n\nA fragment of the compiler plugin output with error messages when analyzing a class:\n\n```bash\n_cycles.cpp:53:23: error: The class 'cycles::SharedCross' has a circular reference through class 'cycles::SharedCross2'\n   53 |         SharedCross2 *cross2;\n      |                       ^\n_cycles.cpp:57:22: error: The class 'cycles::SharedCross2' has a circular reference through class 'cycles::SharedCross'\n   57 |         SharedCross *cross;\n      |                      ^\n_cycles.cpp:53:23: error: Field type raw pointer\n   53 |         SharedCross2 *cross2;\n      |                       ^\n_cycles.cpp:53:23: error: The class 'cycles::SharedCross' has a circular reference through class 'cycles::SharedCross2'\n_cycles.cpp:57:22: error: Field type raw pointer\n   57 |         SharedCross *cross;\n      |                      ^\n```\n\n\nThe plugin's message level can be limited using a macro or command line argument,\nor after checking the source code, the plugin can be omitted altogether,\nsince it only parses the AST, but does not make any corrections to it.\n\n\n### Full output of plugin messages when compiling the test file `_example.cpp`: \n\n<details>\n<summary> Show output: </summary>\n\n```bash\nclang++-20 -std=c++26 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang circleref-disable _example.cpp\n\n...\n\n```\n</details>\n\n\n## Feedback\nIf you have any suggestions for the development and improvement of the project, join or [write](https://github.com/rsashka/memsafe/discussions).\n\n\n---\n\n\n## Безопасная работа с памятью для С++\n\n### Мотивация\n\n> Глобальная проблема языка C++ в том, что указатель на выделенный блок памяти в куче является обычным адресом \n> оперативной памяти и у него отсутствует связь с локальными переменными - указателями, которые находятся на стеке,\n> и временем жизни которых управляет компилятор. \n> \n> Вторая, не менее серьезная проблема, которая часто приводить к неопределенному поведению (Undefined Behaviour) \n> или гонке данных (Data Races) - это доступ к одной и той же области памяти из разных потоков одновременно.\n\nЕсть много проектов, целью которых является превратить С++ более \"безопасный\" язык программирования.\nНо внесение изменений в синтаксис языка обычно нарушает обратную совместимость со старым кодом, который был написан до этого.\n\nДанный проект содержит заголовочный файл библиотеки и плагин компилятора для *безопасного С++*, \nкоторый устраняет основные проблемы С++ при работе с памятью и ссылочными типами данных \nбез нарушения обратной совместимости со старым легаси кодом (используется С++20, но можно понизить до С++17 или С++11).\n\nСпособ маркировки объектов в исходноом коде и настройка параметров работы плагина\nвыполняется с помощью  C++ атрибутов, что очень похоже на профили безопасности \n[p3038](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p3038r0.pdf) от Bjarne Stroustrup \nи [P3081](https://isocpp.org/files/papers/P3081R0.pdf) от Herb Sutter, \nно не требует принятия нового стандарта С++.\n\n### Концепция\n\nКонцепция безопасной работы с памятью заключается в реализации следующих принципов:   \n- Если в программе гарантированно отсутствуют сильные циклические ссылки \n(ссылка объекта на самого себя или перекрестные ссылки между несколькими объектами), \nтогда при реализации принципа [RAII](https://en.wikipedia.org/wiki/Resource_acquisition_is_initialization), \n*автоматическое освобождение памяти будет выполнятся **всегда***.\n- Гарантировать отсутствие циклических ссылок можно только путем их запрета на уровне *типов* (определений классов).\n- Проблема гонок данных при обращении к памяти из разных потоков решается за счет использования объектов межпотоковой синхронизации.\nЧтобы исключить ошибки в логике для захвата объекта синхронизации и разименования ссылки используются единый оператор (вызов функции).\n\nИзначальная идея безопасной работы с памятью  была взята из языка [NewLang](https://newlang.net/), \nно реализована на базе стандартных шаблонных классов С++ *shared_ptr* и *weak_ptr*.\n\nОсновное отличие новых шаблонов заключается в способе обращения к объекту, \nкоторый может выполняться не только с помощью разименования \"**\\***\", \nно и через захват (блокировку) ссылки с сохранением её во *временную переменную*\nи уже через неё получается доступ непосредственный к самим данным (объекту). \n\nТакая автоматическая переменная является *временным* владельцем сильной ссылки и выполняет функции удержания\nобъекта межпотоковой синхронизации в стиле [std::lock_guard](https://en.cppreference.com/w/cpp/thread/lock_guard),\nвремя жизни которого ограничено текущей областью видимости и управляется компилятором автоматически.\n\n### Реализация\n\nРеализация концепции безопасной работы с памятью для С++ состоит из двух частей: плагина для Clang и заголовочного файла библиотеки.\n\nС помощью плагина для Clang выполняется статический анализ С++ кода во время его компиляции.\nВ плагине реализованы проверка инвалидации ссылочных типов (итераторов, std::span, std::string_view и т.д.) при изменении данных в исходной переменной\nи контроль сильных **циклических** ссылок на уровне типов (определений классов) любой вложенности **\\***).\n\nВ файле библиотеки находятся шаблонные классы, расширяющие стандартные *std::shared_ptr* и *std::weak_ptr* \nс автоматической защитой от гонок данных при доступе к общим переменным из разных потоков\n(способ контроля доступа требуется указать при определении переменной, \nпосле чего захват и освобождение объекта синхронизации будут происходить автоматически при разименовании ссылки).\n*По умолчанию общие переменные создаются без контроля многопоточного доступа \nи не имеют дополнительных накладных расходов по стравнению с стандартными шаблонными классами `std::shared_ptr` и `std::weak_ptr`*.\n\nТак же в заголовочным файле библиотеки находятся опции для управления плагином анализатора \n(опредляется список классов, которые необходимо отслеживать для инвалидации ссылочных типов данных).\n\n---\n\n**\\***) - *поскольку C++ компилирует файлы по отдельности, а определение класса (структуры данных)\nможет находиться в другой единице трансляции из-за предварительного объявления,\nдля корректной работы анализатора циклических ссылок может потребоваться два прохода.* \n*Сначала запустить плагин с ключом '--circleref-write -fsyntax-only', чтобы сгенерировать список классов\nс сильными ссылками, затем второй раз с ключом '--circleref-read', чтобы выполнить анализ.\nИли полностью отключить анализатор циклических ссылок с помощью опции '--circleref-disable'.*\n\n## Примеры\n\nКомандная строка компиляции файла с помощью clang с загрузкой плагина\n\n```bash\nclang++ -std=c++20 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang circleref-disable _example.cpp\n```\n\n### Вывод плагина с контролем инвалидации ссылок:\n\n```cpp\n    std::vector<int> vec(100000, 0);\n    auto x = vec.begin();\n    vec = {};\n    vec.shrink_to_fit(); \n    std::sort(x, vec.end()); // malloc(): unaligned tcache chunk detected or Segmentation fault\n```\n\nФрагмент вывода плагина компилятора с сообщениями об ошибках, \nсвязанных с недействительностью ссылочных переменных после изменения данных в основной переменной:\n\n```bash\n_example.cpp:29:17: warning: using main variable 'vect'\n   29 |                 vect = {};\n      |                 ^\n_example.cpp:30:17: warning: using main variable 'vect'\n   30 |                 vect.shrink_to_fit();\n      |                 ^\n_example.cpp:31:27: error: Using the dependent variable 'x' after changing the main variable 'vect'!\n   31 |                 std::sort(x, vect.end()); // malloc(): unaligned tcache chunk detected or Segmentation fault \n      |                           ^\n```\n\n### Пример анализа классов с рекурсивными ссылками:\n\n```cpp\n\n    class SharedCross2;\n\n    class SharedCross {\n        SharedCross2 *cross2;\n    };\n\n    class SharedCross2 {\n        SharedCross *cross;\n    };\n```\n\nФрагмент вывода плагина компилятора с сообщениями об ошибках при анализе класса:\n```bash\n_cycles.cpp:53:23: error: The class 'cycles::SharedCross' has a circular reference through class 'cycles::SharedCross2'\n   53 |         SharedCross2 *cross2;\n      |                       ^\n_cycles.cpp:57:22: error: The class 'cycles::SharedCross2' has a circular reference through class 'cycles::SharedCross'\n   57 |         SharedCross *cross;\n      |                      ^\n_cycles.cpp:53:23: error: Field type raw pointer\n   53 |         SharedCross2 *cross2;\n      |                       ^\n_cycles.cpp:53:23: error: The class 'cycles::SharedCross' has a circular reference through class 'cycles::SharedCross2'\n_cycles.cpp:57:22: error: Field type raw pointer\n   57 |         SharedCross *cross;\n      |                      ^\n```\n\n\nУровень сообщений плагина можно ограничить с помощью макроса или аргумента командной строки, \nлибо после проверки исходного кода плагин можно вообще не использовать,  \nпоскольку он только анализирует AST, но не вносит в него никаких исправлений.\n\n\n### Полный вывод сообщений плагина при компиляции тестового файла `_example.cpp`:\n<details>\n<summary>Показать вывод</summary>\n\n```bash\nclang++-20 -std=c++20 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang circleref-disable _example.cpp\n\n\n...\n\n\n```\n</details>\n\n\n## Обратная связь\nЕсли у вас есть предложения по развитию и улучшению проекта, присоединяйтесь или [пишите](https://github.com/rsashka/memsafe/discussions)\n\n"
  },
  {
    "path": "_cycles.cpp",
    "content": "#include <map>\n#include <vector>\n#include <algorithm>\n#include \"memsafe.h\"\n\nusing namespace memsafe;\n\nnamespace ns {\n    struct A;\n\n    // cyclic cross-references between classes that are defined in other translation units\n    //    struct A {\n    //        Shared<Ext> ext;\n    //    };\n    MEMSAFE_BASELINE(100);\n\n    class Ext {\n        Shared<A> a;\n    };\n\n}\n\n// cyclic-analyzer\nnamespace cycles {\n\n    // simple circular self-references\n    MEMSAFE_BASELINE(1_000);\n\n    struct CircleSelf {\n        CircleSelf * self;\n    };\n\n    struct CircleShared {\n        Shared<CircleShared> shared;\n    };\n\n    struct CircleSelfUnsafe {\n        MEMSAFE_UNSAFE CircleSelf * self;\n    };\n\n    struct CircleSharedUnsafe {\n        MEMSAFE_UNSAFE Shared<CircleShared> shared;\n    };\n\n\n\n    // cyclic cross-references\n    MEMSAFE_BASELINE(2_000);\n\n    class SharedCross2;\n\n    class SharedCross {\n        SharedCross2 *cross2;\n    };\n\n    class SharedCross2 {\n        SharedCross *cross;\n    };\n\n    class SharedCrossUnsafe {\n        MEMSAFE_UNSAFE SharedCross2 *cross2;\n    };\n\n    class SharedCross2Unsafe {\n        MEMSAFE_UNSAFE SharedCross *cross;\n    };\n\n\n    // cyclic cross-references between classes that are defined in other translation units\n    MEMSAFE_BASELINE(3_000);\n\n    struct ExtExt : public ns::Ext {\n    };\n\n    class ExtExtExt : public ExtExt {\n    };\n\n\n\n    // Reference types in STD templates\n    MEMSAFE_BASELINE(4_000);\n\n    struct ArraySharedInt : public std::vector<Shared<int> > {\n    };\n\n    struct SharedArrayInt : public Shared<std::vector<int> > {\n    };\n\n\n\n    // Reference types when extending templates\n    MEMSAFE_BASELINE(5_000);\n\n    template <typename T>\n    class SharedSingle : public Shared<T, SyncSingleThread> {\n    };\n\n    class SharedSingleInt : public SharedSingle<int> {\n    };\n\n    class SharedSingleIntField {\n        SharedSingleInt shared_int;\n    };\n\n\n\n\n\n\n    // Non-reference types with weak references\n    MEMSAFE_BASELINE(10_000);\n\n    class NotShared1 {\n        int interger;\n        std::weak_ptr<NotShared1> weak;\n    };\n\n    struct NotShared2 : public NotShared1 {\n        NotShared1 not1;\n        std::weak_ptr<NotShared2> weak1;\n        Weak<Shared<int>> weak2;\n    };\n\n}\n\n"
  },
  {
    "path": "_example.cpp",
    "content": "#include <vector>\n#include <algorithm>\n#include \"memsafe.h\"\n\nusing namespace memsafe;\n\nnamespace ns {\n\n    MEMSAFE_BASELINE(100);\n\n    void * invalidate_test(int arg) {\n\n        std::vector<int> vect{1, 2, 3, 4};\n        {\n\n            MEMSAFE_BASELINE(200);\n            auto beg = vect.begin();\n            std::vector<int>::const_iterator beg_const = vect.cbegin();\n\n            auto pointer = &vect; // Error\n\n            auto str = std::string();\n            std::string_view view(str);\n            str.clear();\n            auto view_iter = view.begin(); // Error\n\n            {\n                MEMSAFE_BASELINE(300);\n                vect = {};\n                vect.shrink_to_fit();\n                std::sort(beg, vect.end()); // Error\n                const std::vector<int> vect_const;\n            }\n        }\n\n        {\n\n            MEMSAFE_BASELINE(400);\n            auto b = LazyCaller<decltype(vect), decltype(std::declval<decltype(vect)>().begin())>(vect, &decltype(vect)::begin);\n            auto e = LAZYCALL(vect, end);\n            {\n                MEMSAFE_BASELINE(500);\n                vect = {};\n                vect.clear();\n                std::sort(*b, *e);\n            }\n        }\n\n        MEMSAFE_BASELINE(900);\n        MEMSAFE_UNSAFE{\n            return nullptr;\n            MEMSAFE_UNSAFE return nullptr;}\n    }\n\n    namespace MEMSAFE_UNSAFE {\n\n        MEMSAFE_BASELINE(1000);\n        Shared<int> var_unsafe1(1);\n        memsafe::Shared<int> var_unsafe2(2);\n        memsafe::Shared<int> var_unsafe3(3);\n    }\n\n\n\n    MEMSAFE_BASELINE(2000);\n    memsafe::Value<int> var_value(1);\n    memsafe::Value<int> var_value2(2);\n    memsafe::Shared<int> var_share(1);\n    memsafe::Shared<int, memsafe::SyncTimedMutex> var_guard(1);\n\n    MEMSAFE_BASELINE(3000);\n    static memsafe::Value<int> var_static(1);\n    static auto static_fail1(var_static.lock()); // Error\n    static auto static_fail2 = var_static.lock(); // Error\n\n    MEMSAFE_BASELINE(4000);\n\n    memsafe::Shared<int> memory_test(memsafe::Shared<int> arg, memsafe::Value<int> arg_val) {\n\n        MEMSAFE_BASELINE(4100);\n        var_static = var_value;\n        {\n            var_static = var_value;\n            {\n                var_static = var_value;\n            }\n        }\n\n        MEMSAFE_BASELINE(4200);\n        memsafe::Shared<int> var_shared1(1);\n        memsafe::Shared<int> var_shared2(1);\n\n        MEMSAFE_BASELINE(4300);\n        var_shared1 = var_shared1; // Error\n        MEMSAFE_UNSAFE var_shared1 = var_shared2; // Unsafe\n\n        {\n            MEMSAFE_BASELINE(4400);\n            memsafe::Shared<int> var_shared3(3);\n            var_shared1 = var_shared1; // Error\n            var_shared2 = var_shared1; // Error\n            var_shared3 = var_shared1;\n\n            {\n                MEMSAFE_BASELINE(4500);\n                memsafe::Shared<int> var_shared4 = var_shared1;\n\n                var_shared1 = var_shared1; // Error\n                var_shared2 = var_shared1; // Error\n                var_shared3 = var_shared1;\n\n                var_shared4 = var_shared1;\n                var_shared4 = var_shared3;\n\n                var_shared4 = var_shared4; // Error\n\n                if (var_shared4) {\n                    MEMSAFE_UNSAFE return var_shared4;\n                }\n                return var_shared4; // Error\n            }\n\n            MEMSAFE_BASELINE(4600);\n            std::swap(var_shared1, var_shared2);\n            std::swap(var_shared1, var_shared3);\n            MEMSAFE_UNSAFE std::swap(var_shared1, var_shared3);\n\n            MEMSAFE_BASELINE(4700);\n            return arg; // Error\n        }\n\n        MEMSAFE_BASELINE(4800);\n        int temp = 3;\n        temp = 4;\n        var_value = 5;\n        *var_value += 6;\n\n\n        MEMSAFE_BASELINE(4900);\n        return 777;\n    }\n\n    MEMSAFE_BASELINE(7000);\n\n    void shared_example() {\n        std::shared_ptr<int> old_shared; // Error\n        Shared<int> var = 1;\n        Shared<int> copy;\n        copy = var; // Error\n        std::swap(var, copy);\n        {\n            Shared<int> inner = var;\n            std::swap(inner, copy); // Error\n            inner = copy;\n            copy = inner; // Error\n        }\n    }\n\n    MEMSAFE_BASELINE(8000);\n\n    memsafe::Shared<int> memory_test_8(memsafe::Shared<int> arg) {\n        MEMSAFE_BASELINE(8900);\n        return arg; // Error\n    }\n\n    MEMSAFE_BASELINE(9000);\n\n    memsafe::Shared<int> memory_test_9() {\n        MEMSAFE_BASELINE(9900);\n        return Shared<int>(999);\n    }\n\n\n    MEMSAFE_BASELINE(10_000);\n\n    struct Ext;\n\n    struct A {\n        Shared<Ext> ext;\n    };\n\n    void bugfix_11() { // https://github.com/rsashka/memsafe/issues/11\n        MEMSAFE_BASELINE(900_011_000);\n        std::vector vect(100000, 0);\n        auto x = (vect.begin());\n        vect = {};\n        std::sort(x, vect.end()); // Error\n    }\n\n    void bugfix_12() { // https://github.com/rsashka/memsafe/issues/12\n        MEMSAFE_BASELINE(900_012_000);\n        std::vector vect(100000, 0);\n        auto& y = vect[0];\n        vect = {};\n        y += 1; // Error\n    }\n}\n\n"
  },
  {
    "path": "memsafe.h",
    "content": "#pragma once\n#ifndef INCLUDED_MEMSAFE_H_\n#define INCLUDED_MEMSAFE_H_\n\n#ifndef DOXYGEN_SHOULD_SKIP_THIS\n\n#include <iostream>\n#include <stdint.h>\n#include <stdexcept>\n#include <memory>\n\n#include <mutex>\n#include <shared_mutex>\n#include <thread>\n#include <set>\n\n#include <format>\n\n#endif\n\n#ifdef BUILD_UNITTEST\n// Removing all restrictions on access to protected and private fields for testing cases\n#define SCOPE(scope)  public\n#else\n#define SCOPE(scope)  scope\n#endif   \n\n/**\n * @def SCOPE( scope )\n * \n * Removing all restrictions on access to protected and private fields for testing cases\n * \n */\n\n\n#define MEMSAFE_KEYWORD_ATTRIBUTE memsafe\n#define MEMSAFE_KEYWORD_PROFILE \"profile\"\n#define MEMSAFE_KEYWORD_STATUS \"status\"\n#define MEMSAFE_KEYWORD_UNSAFE \"unsafe\"\n#define MEMSAFE_KEYWORD_PRINT_AST \"print-ast\"\n#define MEMSAFE_KEYWORD_PRINT_DUMP \"print-dump\"\n#define MEMSAFE_KEYWORD_BASELINE \"baseline\"\n\n#define MEMSAFE_KEYWORD_START_LOG \"#memsafe-log\\n\"\n#define MEMSAFE_KEYWORD_START_DUMP \"#memsafe-dump\\n\"\n\n#define MEMSAFE_KEYWORD_ENABLE \"enable\"\n#define MEMSAFE_KEYWORD_DISABLE \"disable\"\n#define MEMSAFE_KEYWORD_PUSH \"push\"\n#define MEMSAFE_KEYWORD_POP \"pop\"\n\n// maximum diagnostic level of plugin message when error is detected in source code\n#define MEMSAFE_KEYWORD_LEVEL \"level\"\n#define MEMSAFE_KEYWORD_ERROR \"error\"\n#define MEMSAFE_KEYWORD_WARNING \"warning\"\n#define MEMSAFE_KEYWORD_NOTE \"note\"\n#define MEMSAFE_KEYWORD_REMARK \"remark\"\n#define MEMSAFE_KEYWORD_IGNORED \"ignored\"\n\n#define MEMSAFE_KEYWORD_AUTO_TYPE \"auto-type\"\n#define MEMSAFE_KEYWORD_SHARED_TYPE \"shared-type\"\n#define MEMSAFE_KEYWORD_INVALIDATE_FUNC  \"invalidate-func\"\n\n\n#if defined __has_attribute\n#if __has_attribute( MEMSAFE_KEYWORD_ATTRIBUTE )\n#define MEMSAFE_ATTR(...) [[ MEMSAFE_KEYWORD_ATTRIBUTE (__VA_ARGS__)]]\n#define MEMSAFE_BASELINE(number) MEMSAFE_ATTR( MEMSAFE_KEYWORD_BASELINE, #number) void memsafe_stub();\n#endif\n#endif\n\n// Disable memory safety plugin attributes \n#ifndef MEMSAFE_ATTR\n#define MEMSAFE_ATTR(...)\n#define MEMSAFE_BASELINE(number)\n#define MEMSAFE_DISABLE\n#endif\n\n#ifndef TO_STR\n#define TO_STR2(ARG) #ARG\n#define TO_STR(ARG) TO_STR2(ARG)\n#endif\n\n#define MEMSAFE_PROFILE(file) MEMSAFE_ATTR(MEMSAFE_KEYWORD_PROFILE, file)\n#define MEMSAFE_STATUS(status) MEMSAFE_ATTR(MEMSAFE_KEYWORD_STATUS, status)\n#define MEMSAFE_DIAG_LEVEL(level) MEMSAFE_ATTR(MEMSAFE_KEYWORD_LEVEL, level)\n#define MEMSAFE_UNSAFE MEMSAFE_ATTR(MEMSAFE_KEYWORD_UNSAFE, TO_STR(__LINE__))\n\n#define MEMSAFE_ERROR_TYPE(name) MEMSAFE_ATTR(MEMSAFE_KEYWORD_ERROR \"-type\", name)\n#define MEMSAFE_WARNING_TYPE(name) MEMSAFE_ATTR(MEMSAFE_KEYWORD_WARNING \"-type\", name)\n#define MEMSAFE_AUTO_TYPE(name) MEMSAFE_ATTR(MEMSAFE_KEYWORD_AUTO_TYPE, name)\n#define MEMSAFE_SHARED_TYPE(name) MEMSAFE_ATTR(MEMSAFE_KEYWORD_SHARED_TYPE, name)\n#define MEMSAFE_INVALIDATE_FUNC(name) MEMSAFE_ATTR(MEMSAFE_KEYWORD_INVALIDATE_FUNC, name)\n\n#define MEMSAFE_PRINT_AST(filter) MEMSAFE_ATTR(MEMSAFE_KEYWORD_PRINT_AST, filter) void memsafe_stub();\n#define MEMSAFE_PRINT_DUMP(filter) MEMSAFE_ATTR(MEMSAFE_KEYWORD_PRINT_DUMP, filter) void memsafe_stub();\n\n/**\n * @def MEMSAFE_ATTR(...)\n * \n * Inserts [[memsafe( ... )]] attributes into the С++ code \n * if they are supported by the compiler \n * and the library semantic analysis plugin is connected\n * \n */\n\n/**\n * @def MEMSAFE_BASELINE(number)\n * \n * Set the current base line number of [[memsafe( \"baseline\", \"num\" )]] \n * markers used when debugging the plugin.\n * \n * If you don't use this macro, the line numbers at the debug marker positions \n * will match the line numbers in the source file.\n * \n * Set base line number  is implemented as a set of custom attributes in the \n * stub function `void memsafe_stub()` forward declaration, as this can be done anywhere in C++ code.\n */\n\n/**\n * @def MEMSAFE_PRINT_AST(...)\n * \n * Enables or disables the output of expressions from the source file as AST nodes.\n * Expression filter is planned (not implemented yet).\n * \n * Control over AST dump output is implemented as a set of custom attributes \n * in the stub function `void memsafe_stub()` forward declaration, as this can be done anywhere in C++ code.\n */\n\n/**\n * @def MEMSAFE_PRINT_DUMP(...)\n * \n * Outputs the current state of the plugin and its main internal variables, \n * as well as a stack of code blocks (hierarchies of variable lifetimes) \n * for debugging and analysis.\n * \n */\n\n/**\n * @def MEMSAFE_DISABLE\n * \n * Defining a macro to disable the code analyzer plugin \n * (this header file is compiled as normal C++ code without additional analysis by the compiler plugin)\n */\n\n/**\n * @def MEMSAFE_PROFILE(\"file_name_profile\")\n * \n * Select safety profile *(load from file not implemented)*.\n * Empty mane - reset to default profile.\n */\n\n/**\n * @def MEMSAFE_ERROR_TYPE(\"full:class::name\")\n * \n * The fully qualified name of the class that will generate the error message \n * when used (or when using a class derived from the specified one).\n */\n\n/**\n * @def MEMSAFE_WARNING_TYPE(\"full:class::name\")\n * \n * The fully qualified name of the class that will generate the warning message \n * when used (or when using a class derived from the specified one).\n */\n\n/**\n * @def MEMSAFE_SHARED_TYPE(\"full:class::name\")\n * \n * The fully qualified name of a class that contains a strong pointer\n * to shared data whose ownership is to be controlled at the syntax level.\n */\n\n/**\n * @def MEMSAFE_AUTO_TYPE(\"full:class::name\")\n * \n * The fully qualified name of a class that contains a strong pointer \n * to an automatic (temporary) variable whose ownership must be controlled at the syntax level.\n */\n\n/**\n * @def MEMSAFE_INVALIDATE_FUNC(\"unsafe function name\")\n * The name of a function that, when passed as an argument to a base object, \n * always causes previously obtained references and iterators to be invalidated,\n * regardless of the default settings @ref MEMSAFE_NONCONST_ARG\n * such as std::swap, std::move  etc.\n */\n\n\nnamespace memsafe { // Begin define memory safety classes\n\n#ifndef DOXYGEN_SHOULD_SKIP_THIS\n\n    class memsafe_error : public std::runtime_error {\n    public:\n\n        memsafe_error(std::string_view msg) : std::runtime_error(msg.begin()) {\n        }\n\n    };\n\n#endif\n\n    // Pre-definition of template class for variable with weak reference\n    template <typename T> class Weak;\n\n    /*\n     * Base class for shared data with the ability to multi-thread synchronize access\n     */\n\n    typedef std::chrono::milliseconds SyncTimeoutType;\n    static constexpr SyncTimeoutType SyncTimeoutDeedlock = std::chrono::milliseconds(5000);\n\n    template <typename V>\n    class Sync {\n    public:\n\n        V data;\n\n        Sync(V v) : data(v), m_const_lock(false) {\n        }\n\n        [[nodiscard]]\n        bool TryLock(bool const_lock, const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            m_const_lock = const_lock;\n            return m_const_lock ? try_lock_const(timeout) : try_lock(timeout);\n        }\n\n        void UnLock() {\n            if (m_const_lock) {\n                unlock_const();\n            } else {\n                unlock();\n            }\n        }\n\n    protected:\n        bool m_const_lock;\n\n        static void timeout_set_error(const SyncTimeoutType &timeout) {\n            if (timeout != SyncTimeoutDeedlock) {\n                throw memsafe_error(\"Timeout is not applicable for this object type!\");\n            }\n        }\n\n        [[nodiscard]]\n        virtual bool try_lock(const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            timeout_set_error(timeout);\n            return true;\n        }\n\n        [[nodiscard]]\n        virtual bool try_lock_const(const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            timeout_set_error(timeout);\n            return true;\n        }\n\n        virtual void unlock() {\n        }\n\n        virtual void unlock_const() {\n        }\n\n    };\n\n    /**\n     * Temporary (auto) variable - owner of object reference (dereferences weak pointers \n     * and increments ownership count of strong references).\n     * \n     * Always contains only valid data (a valid reference and a captured synchronization object), \n     * otherwise an exception will be thrown when attempting to create the object.\n     * \n     * A helper template class wrapper for managing the lifetime \n     * of captured variables and releasing their ownership in the destructor.   \n     * Similar to class and performs same functions as https://en.cppreference.com/w/cpp/thread/lock_guard\n     * \n     * V - Variable value type\n     * T - The type of the specific captured variable\n     */\n\n    template <typename V, typename T>\n    class Locker {\n    public:\n\n        Locker(T val) : value(val) {\n        }\n\n        inline V& operator*() {\n            if constexpr (std::is_reference_v<T>) {\n                return value;\n            } else {\n                static_assert(std::is_convertible_v<T, std::shared_ptr<Sync < V>>>);\n                return value->data;\n            }\n        }\n\n        inline const V& operator*() const {\n            if constexpr (std::is_reference_v<T>) {\n                return value;\n            } else {\n                static_assert(std::is_convertible_v<T, std::shared_ptr<Sync < V>>>);\n                return value->data;\n            }\n        }\n\n        inline ~Locker() {\n            if constexpr (std::is_convertible_v<T, std::shared_ptr<Sync < V>>>) {\n                value->UnLock();\n            } else {\n                static_assert(std::is_reference_v<T>);\n            }\n        }\n\n    private:\n        T value; // Type T can be a reference to data i.e. V& or a shared_ptr<Sync<V>>\n\n        // Noncopyable\n        Locker(const Locker&) = delete;\n        Locker& operator=(const Locker&) = delete;\n        // Nonmovable\n        Locker(Locker&&) = delete;\n        Locker& operator=(Locker&&) = delete;\n    };\n\n    /**\n     * Variable by value without references.   \n     * A simple wrapper over data to unify access to it using class Auto\n     */\n    template <typename V>\n    class Value {\n    protected:\n        V value;\n    public:\n\n        Value(V val) : value(val) {\n        }\n\n        inline V& operator*() {\n            return value;\n        };\n\n        inline const V& operator*() const {\n            return value;\n        };\n\n        inline Locker<V, V&> lock() {\n            return Locker<V, V&> (value);\n        }\n\n        inline Locker<V, V&> lock() const {\n            return lock_const();\n        }\n\n        inline const Locker<V, V&> lock_const() const {\n            return Locker<V, V&> (value);\n        }\n    };\n\n    static_assert(std::is_standard_layout_v<Value<int>>);\n\n    /**\n     * Reference variable (shared pointer) with optional multi-threaded access control.\n     * \n     * By default using template @ref Sync without multithreaded access control.\n     * @see @ref SyncSingleThread, @ref SyncTimedMutex, @ref SyncTimedShared  )\n     * \n     */\n\n    template <typename V, template <typename> typename S = Sync>\n    class Shared : public std::shared_ptr< S<V> > {\n    public:\n\n        typedef V ValueType;\n        typedef S<V> DataType;\n        typedef std::weak_ptr<DataType> WeakType;\n        typedef std::shared_ptr<DataType> SharedType;\n\n        Shared() : SharedType(nullptr) {\n        }\n\n        Shared(const V & val) : SharedType(std::make_shared<DataType>(val)) {\n        }\n\n        Shared(Shared<V, S> &val) : SharedType(val) {\n        }\n\n        static Locker<V, SharedType> make_auto(SharedType * shared, bool read_only, const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            if constexpr (!std::is_same_v<Sync<V>, DataType>) { // The Sync class is virtual\n                if (!shared || !shared->get()) {\n                    throw memsafe_error(\"Object missing (null pointer exception)\");\n                }\n                if (!shared->get()->TryLock(read_only, timeout)) {\n                    throw memsafe_error(std::format(\"try_lock{} timeout\", read_only ? \" read only\" : \"\"));\n                }\n            }\n            return Locker<V, SharedType> (*shared);\n        }\n\n        Locker<V, SharedType> lock(const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            return make_auto(this, false, timeout);\n        }\n\n        Locker<V, SharedType> lock_const(const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            return make_auto(this, true, timeout);\n        }\n\n//        template < typename = std::enable_if<std::is_trivially_copyable_v < V >> >\n        inline V & operator*() const {\n            auto guard_lock = lock_const();\n            return *guard_lock;\n        }\n\n//        template < typename = std::enable_if<std::is_trivially_copyable_v < V >> >\n        inline SharedType & operator=(V && value) {\n            auto guard_lock = lock();\n            *guard_lock = value;\n            return *this;\n        }\n\n        inline SharedType & set(V && value, const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            auto guard_lock = lock(timeout);\n            *guard_lock = value;\n            return *this;\n        }\n        \n        //        template < typename = std::enable_if<std::is_trivially_copyable_v < V >> >\n        //        inline SharedType & operator=(SharedType & s) {\n        //            auto guard_lock = lock_const();\n        //            return this->memsafe::shared_ptr<S < V>>::operator*().data;\n        //        }\n        //\n\n        inline Weak<Shared < V, S >> weak() {\n            return Weak<Shared < V, S >> (*this);\n        }\n\n        inline explicit operator bool() const noexcept {\n            return this->get();\n        }\n    };\n\n    /**\n     * A wrapper template class for storing weak pointers to shared variables\n     */\n\n    template <typename T>\n    class Weak : public T::WeakType {\n    public:\n\n        Weak() : T::WeakType(nullptr) {\n        }\n\n        Weak(const T ptr) : T::WeakType(ptr) {\n        }\n\n        Weak(Weak & old) : T::WeakType(old) {\n        }\n\n        Locker<typename T::ValueType, typename T::SharedType> make_auto(bool read_only, const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            typename T::SharedType shared = this->T::WeakType::lock();\n            return T::make_auto(&shared, read_only, timeout);\n        }\n\n        inline Locker<typename T::ValueType, typename T::SharedType> lock(const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            return make_auto(false, timeout);\n        }\n\n        inline const Locker<typename T::ValueType, T> lock_const(const SyncTimeoutType &timeout = SyncTimeoutDeedlock) const {\n            return make_auto(true, timeout);\n        }\n\n//        template < typename = std::enable_if<std::is_trivially_copyable_v < V >> >\n        inline T::ValueType & operator*() const {\n            auto guard_lock = lock_const();\n            return *guard_lock;\n        }\n\n//        template < typename = std::enable_if<std::is_trivially_copyable_v < V >> >\n        inline Weak<T> & operator=(T::ValueType && value) {\n            auto guard_lock = lock();\n            *guard_lock = value;\n            return *this;\n        }\n\n        inline Weak<T> & set(T::ValueType && value, const SyncTimeoutType &timeout = SyncTimeoutDeedlock) {\n            auto guard_lock = lock(timeout);\n            *guard_lock = value;\n            return *this;\n        }\n\n        inline explicit operator bool() const noexcept {\n            return this->lock();\n        }\n    };\n\n    /**\n     * A class without a synchronization primitive and with the ability to work only in one application thread.   \n     * Used to control access to data from only one application thread without creating a synchronization object between threads.\n     */\n    template <typename V>\n    class SyncSingleThread : public Sync<V> {\n    public:\n\n        SyncSingleThread(V v) : Sync<V>(v), m_thread_id(std::this_thread::get_id()) {\n        }\n\n    protected:\n\n        const std::thread::id m_thread_id;\n\n        inline void check_thread() {\n            if (m_thread_id != std::this_thread::get_id()) {\n                throw memsafe_error(\"Using a single thread variable in another thread!\");\n            }\n        }\n\n        inline bool try_lock(const SyncTimeoutType &timeout) override final {\n            check_thread();\n            Sync<V>::timeout_set_error(timeout);\n            return true;\n        }\n\n        inline void unlock() override final {\n            check_thread();\n        }\n\n        inline bool try_lock_const(const SyncTimeoutType &timeout) override final {\n            check_thread();\n            Sync<V>::timeout_set_error(timeout);\n            return true;\n        }\n\n        inline void unlock_const() override final {\n            check_thread();\n        }\n    };\n\n    /**\n     * Class with timed mutex for simple multithreaded synchronization\n     */\n\n    template <typename V>\n    class SyncTimedMutex : public Sync<V>, protected std::timed_mutex {\n    public:\n\n        SyncTimedMutex(V v) : Sync<V>(v) {\n        }\n\n    protected:\n\n        inline bool try_lock(const SyncTimeoutType &timeout) override final {\n\n            return std::timed_mutex::try_lock_for(timeout);\n        }\n\n        inline void unlock() override final {\n\n            std::timed_mutex::unlock();\n        }\n\n        inline bool try_lock_const(const SyncTimeoutType &timeout) override final {\n\n            return std::timed_mutex::try_lock_for(timeout);\n        }\n\n        inline void unlock_const() override final {\n\n            std::timed_mutex::unlock();\n        }\n    };\n\n    /**\n     * Class with shared_timed_mutex for multi-thread synchronization for exclusive read/write lock or shared read-only lock\n     */\n\n    template <typename V>\n    class SyncTimedShared : public Sync<V>, protected std::shared_timed_mutex {\n    public:\n\n        SyncTimedShared<V>(V v) : Sync<V>(v) {\n        }\n\n    protected:\n\n        inline bool try_lock(const SyncTimeoutType &timeout) override final {\n            return std::shared_timed_mutex::try_lock_for(timeout);\n        }\n\n        inline void unlock() override final {\n            std::shared_timed_mutex::unlock();\n        }\n\n        inline bool try_lock_const(const SyncTimeoutType &timeout) override final {\n            return std::shared_timed_mutex::try_lock_shared_for(timeout);\n        }\n\n        inline void unlock_const() override final {\n            std::shared_timed_mutex::unlock_shared();\n        }\n    };\n\n    /**\n     * Class field reference variable (shared pointer) without multi-threaded access control\n     * to store an object of the same class with protection against recursive references at runtime.\n     * \n     * Should not be used at all, since the check is performed at runtime and \n     * its execution time depends on the total number of links being checked.\n     * \n     * When created, requires the address of the object and the address of the field \n     * in the object to calculate its position in the class field, which must be correct.\n     * \n     * To check std::is_standard_layout v the class cannot have virtual methods, \n     * including a destructor, be derived from another class and much more...\n     * \n     */\n\n    template <typename V>\n    class [[deprecated]] Class {\n        public:\n\n        std::shared_ptr<V> m_field; ///< Field data with a pointer to an instance of the class containing this field (to another instance of the same class)\n        V * m_instance; ///< A pointer to the object instance that contains this field.\n        size_t m_offset; ///< Offset of this field from the pointer to the class instance\n\n        typedef std::weak_ptr<V> WeakType;\n\n        inline bool checkFieldPosInOwner(const V & owner, size_t offset) const {\n\n            return ((size_t) & owner + offset) == (size_t)this;\n        }\n\n        inline bool checkCircularReference(const V * owner, const V * tested) const {\n            if (!owner || !tested) {\n                return true;\n            } else if (owner == tested) {\n                return false;\n            }\n            const Class<V> * filed = reinterpret_cast<const Class<V> *> (reinterpret_cast<size_t> (owner) + m_offset);\n\n            return checkCircularReference(filed->m_field.get(), tested);\n        }\n\n        Class(V & owner, Class<V> &filed, V *ptr = nullptr) : m_field(std::shared_ptr<V>(ptr)), m_instance(&owner) {\n\n            m_offset = reinterpret_cast<size_t> (& filed) - reinterpret_cast<size_t> (& owner);\n\n            if (!checkCircularReference(m_instance, ptr)) {\n\n                throw memsafe_error(\"Circular reference exception\");\n            }\n\n            assert(&owner != ptr);\n            assert(checkFieldPosInOwner(*m_instance, m_offset));\n        }\n\n        Class<V> & operator=(Class<V> & copy) {\n            // Check for a copy of another field in your own object\n            if (m_instance == copy.m_instance) {\n                throw memsafe_error(\"Copy of another field exception\");\n            }\n            *this = copy.m_field.get(); // Call Class<V> & operator=(V *cls)\n\n            return *this;\n        }\n\n        Class<V> & operator=(V * cls) {\n            if (!checkCircularReference(m_instance, cls)) {\n                throw memsafe_error(\"Circular reference exception\");\n            }\n            m_field = std::shared_ptr<V>(cls);\n\n            return *this;\n        }\n\n        inline V& operator*() {\n            if (V * temp = m_field.get()) {\n\n                return *temp;\n            }\n            throw memsafe_error(\"null pointer exception\");\n        }\n\n        inline const V& operator*() const {\n            if (const V * temp = m_field.get()) {\n\n                return *temp;\n            }\n            throw memsafe_error(\"null pointer exception\");\n        }\n\n        Weak<Class < V >> weak() {\n            return Weak<Class < V >> (*this, nullptr, nullptr);\n        }\n    };\n\n#pragma clang attribute push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n\n    static_assert(std::is_standard_layout_v<std::shared_ptr<int>>);\n    static_assert(std::is_standard_layout_v<Class<int>>);\n\n#pragma clang attribute pop\n\n    /**\n     * An example of a linked list template implemented using weak pointers \n     * (where strong references between the same data types are not allowed).\n     */\n\n    template <typename T>\n    struct LinkedWeakNode {\n        typedef std::weak_ptr<LinkedWeakNode<T>> WeakType;\n        WeakType next;\n        T data;\n\n        LinkedWeakNode(const T & value) : data(value) {\n        }\n    };\n\n    template <typename T>\n    class LinkedWeakList {\n    public:\n        typedef LinkedWeakNode<T> NodeType;\n        typedef std::shared_ptr<NodeType> SharedType;\n\n        SharedType m_head;\n        std::set<SharedType> m_data;\n\n        LinkedWeakList() : m_head(nullptr) {\n        }\n\n\n        // Function to Insert a new node at the beginning of the list\n\n        void push_front(T && data) {\n            SharedType node = std::make_shared<NodeType>(data);\n            m_data.insert(node);\n            node->next = m_head;\n            m_head = node;\n        }\n\n        void push_back(T && data) {\n            SharedType node = std::make_shared<NodeType>(data);\n\n            m_data.insert(node);\n\n            // If the linked list is empty, update the head to the new node\n            if (!m_head) {\n                m_head = node;\n                return;\n            }\n\n            // Traverse to the last node\n            SharedType temp = m_head;\n            while (temp->next.lock()) {\n                temp = temp->next.lock();\n            }\n\n            // Update the last node's next to the new node\n            temp->next = node;\n        }\n\n\n        // Function to Delete the first node of the list\n\n        void pop_front() {\n            if (!m_head) {\n                std::cerr << \"List is empty.\" << std::endl;\n                return;\n            }\n            SharedType temp = m_head;\n            m_head = m_head->next.lock();\n            m_data.erase(temp);\n        }\n\n        // Function to Delete the last node of the list\n\n        void pop_back() {\n            if (!m_head) {\n                std::cerr << \"List is empty.\" << std::endl;\n                return;\n            }\n\n            SharedType temp = m_head->next.lock();\n            if (!temp) {\n                m_data.erase(m_head);\n                m_head.reset();\n                return;\n            }\n\n            // Traverse to the second-to-last node\n            while (temp->next.lock()->next.lock()) {\n                temp = temp->next.lock();\n            }\n\n            //  Delete the last node\n            m_data.erase(temp->next.lock());\n        }\n\n        size_t size() {\n            return m_data.size();\n        }\n\n        size_t empty() {\n            return m_data.empty();\n        }\n\n        std::string to_string() {\n            if (!m_head) {\n                return \"nullptr\";\n            }\n\n            std::string result;\n\n            SharedType temp = m_head;\n            while (temp) {\n                result += std::to_string(temp->data);\n                result += \" -> \";\n                temp = temp->next.lock();\n            }\n            return result;\n        }\n    };\n\n\n#ifndef DOXYGEN_SHOULD_SKIP_THIS\n\n    /**\n     * Helper class for lazy invocation of iterator\n     */\n\n    class LazyCallerInterface {\n    public:\n        auto operator*();\n        auto operator*() const;\n    };\n\n    //std::tuple_element_t<N, std::tuple<InputPortTypes...>>\n\n    //    template <typename T, typename R, typename ... Args> class LazyCaller;\n\n    template<int...> struct index_tuple {\n    };\n\n    template<int I, typename IndexTuple, typename... Types>\n    struct make_indexes_impl;\n\n    template<int I, int... Indexes, typename T, typename ... Types>\n    struct make_indexes_impl<I, index_tuple<Indexes...>, T, Types...> {\n        typedef typename make_indexes_impl<I + 1, index_tuple<Indexes..., I>, Types...>::type type;\n    };\n\n    template<int I, int... Indexes>\n    struct make_indexes_impl<I, index_tuple<Indexes...> > {\n        typedef index_tuple<Indexes...> type;\n    };\n\n    template<typename ... Types>\n    struct make_indexes : make_indexes_impl<0, index_tuple<>, Types...> {\n    };\n\n    template<typename T, typename R, typename ... Args, int... Indexes >\n    R call_helper(T &obj, R(T::*method)(Args...), index_tuple< Indexes... >, std::tuple<Args...>&& tup) {\n        return (obj.*method)(std::forward<Args>(std::get<Indexes>(tup))...);\n    }\n\n    template<typename T, typename R, typename ... Args>\n    R call(T &obj, R(T::*method)(Args...), const std::tuple<Args...>& tup) {\n        return call_helper(obj, method, typename make_indexes<Args...>::type(), std::tuple<Args...>(tup));\n    }\n\n    template<typename T, typename R, typename ... Args>\n    R call(T &obj, R(T::*method)(Args...), std::tuple<Args...>&& tup) {\n        return call_helper(obj, method, typename make_indexes<Args...>::type(), std::forward<std::tuple<Args...>>(tup));\n    }\n\n\n#ifdef _MSC_VER // Microsoft compilers\n#define EXPAND(x) x\n#define __NARGS(_1, _2, _3, _4, _5, _6, _7, _8, _9, VAL, ...) VAL\n#define NARGS_1(...) EXPAND(__NARGS(__VA_ARGS__, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))\n#define AUGMENTER(...) unused, __VA_ARGS__\n#define NARGS(...) NARGS_1(AUGMENTER(__VA_ARGS__))\n#else // Others\n#define NARGS(...) __NARGS(0, ## __VA_ARGS__, 9,8,7,6,5,4,3,2,1,0)\n#define __NARGS(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,N,...) N\n#endif\n\n    static_assert(NARGS() == 0);\n    static_assert(NARGS(A) == 1);\n    static_assert(NARGS(A, B) == 2);\n    static_assert(NARGS(A, B, C) == 3);\n    static_assert(NARGS(A, B, C, D) == 4);\n    static_assert(NARGS(A, B, C, D, E) == 5);\n    static_assert(NARGS(A, B, C, D, E, F) == 6);\n    static_assert(NARGS(A, B, C, D, E, F, G) == 7);\n    static_assert(NARGS(A, B, C, D, E, F, G, X) == 8);\n    static_assert(NARGS(A, B, C, D, E, F, G, X, Y) == 9);\n\n\n    //    //decltype(std::declval<decltype(variable)>().method(__VA_ARGS__)) __VA_OPT__(,) DECLTYPE(__VA_ARGS__) \n    //\n    //    template<typename T>\n    //    struct arg_helper {\n    //\n    //        static auto type_arg(T arg) {\n    //            return arg;\n    //        }\n    //\n    //        static auto type_call(T arg) {\n    //            if constexpr (std::is_class_v<T> && std::is_base_of_v<LazyCallerInterface, T>) {\n    //                return arg;\n    //            } else {\n    //                return arg;\n    //            }\n    //        }\n    //    };\n    //\n    //#define DECLTYPE_EXPAND_TYPE(arg) decltype(arg_helper<decltype(arg)>::type_call(arg))\n    //    //    std::conditional<(std::is_class_v<decltype(arg)> && std::is_base_of_v<LazyCallerInterface, decltype(arg)>), decltype(*arg), decltype(arg)>::type\n    //    //decltype(arg)\n    //    //std::conditional<!(std::is_class_v<decltype(arg)> && std::is_base_of_v<LazyCallerInterface, decltype(arg)>), decltype(arg), decltype(std::declval<decltype(arg)>().operator*())>::type\n\n#define DECLTYPE_EXPAND_0()\n#define DECLTYPE_EXPAND_1(arg1) decltype(arg1)\n#define DECLTYPE_EXPAND_2(arg1, arg2)  decltype(arg1), decltype(arg2)\n#define DECLTYPE_EXPAND_3(arg1, arg2, arg3) decltype(arg1), decltype(arg2), decltype(arg3)\n#define DECLTYPE_EXPAND_4(arg1, arg2, arg3, arg4) decltype(arg1), decltype(arg2), decltype(arg3), decltype(arg4)\n#define DECLTYPE_EXPAND_5(arg1, arg2, arg3, arg4, arg5) decltype(arg1), decltype(arg2), decltype(arg3), decltype(arg4), decltype(arg5)\n#define DECLTYPE_EXPAND_6(arg1, arg2, arg3, arg4, arg5, arg6) decltype(arg1), decltype(arg2), decltype(arg3), decltype(arg4), decltype(arg5), decltype(arg6)\n#define DECLTYPE_EXPAND_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) decltype(arg1), decltype(arg2), decltype(arg3), decltype(arg4), decltype(arg5), decltype(arg6), decltype(arg7)\n#define DECLTYPE_EXPAND_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) decltype(arg1), decltype(arg2), decltype(arg3), decltype(arg4), decltype(arg5), decltype(arg6), decltype(arg7), decltype(arg8)\n#define DECLTYPE_EXPAND_9(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) decltype(arg1), decltype(arg2), decltype(arg3), decltype(arg4), decltype(arg5), decltype(arg6), decltype(arg7), decltype(arg8), decltype(arg9)\n\n#define DECLTYPE_EXPAND_HELPER(count, ...) DECLTYPE_EXPAND_ ## count (__VA_ARGS__)\n#define DECLTYPE_EXPAND(count, ...) DECLTYPE_EXPAND_HELPER(count, __VA_ARGS__)\n#define DECLTYPE(...) DECLTYPE_EXPAND(NARGS(__VA_ARGS__) __VA_OPT__(,) __VA_ARGS__)\n\n    //\n    //#define DECLTYPE_ARG_TYPE(arg) decltype(arg_helper<decltype(arg)>::type_arg(arg))\n    //\n    //#define DECLTYPE_ARG_0()\n    //#define DECLTYPE_ARG_1(arg1) DECLTYPE_ARG_TYPE(arg1)\n    //#define DECLTYPE_ARG_2(arg1, arg2)  DECLTYPE_ARG_TYPE(arg1), DECLTYPE_ARG_TYPE(arg2)\n    //#define DECLTYPE_ARG_3(arg1, arg2, arg3) DECLTYPE_ARG_TYPE(arg1), DECLTYPE_ARG_TYPE(arg2), DECLTYPE_ARG_TYPE(arg3)\n    //#define DECLTYPE_ARG_4(arg1, arg2, arg3, arg4) DECLTYPE_ARG_TYPE(arg1), DECLTYPE_ARG_TYPE(arg2), DECLTYPE_ARG_TYPE(arg3), DECLTYPE_ARG_TYPE(arg4)\n    //#define DECLTYPE_ARG_5(arg1, arg2, arg3, arg4, arg5) DECLTYPE_ARG_TYPE(arg1), DECLTYPE_ARG_TYPE(arg2), DECLTYPE_ARG_TYPE(arg3), DECLTYPE_ARG_TYPE(arg4), DECLTYPE_ARG_TYPE(arg5)\n    //#define DECLTYPE_ARG_6(arg1, arg2, arg3, arg4, arg5, arg6) DECLTYPE_ARG_TYPE(arg1), DECLTYPE_ARG_TYPE(arg2), DECLTYPE_ARG_TYPE(arg3), DECLTYPE_ARG_TYPE(arg4), DECLTYPE_ARG_TYPE(arg5), DECLTYPE_ARG_TYPE(arg6)\n    //#define DECLTYPE_ARG_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) DECLTYPE_ARG_TYPE(arg1), DECLTYPE_ARG_TYPE(arg2), DECLTYPE_ARG_TYPE(arg3), DECLTYPE_ARG_TYPE(arg4), DECLTYPE_ARG_TYPE(arg5), DECLTYPE_ARG_TYPE(arg6), DECLTYPE_ARG_TYPE(arg7)\n    //#define DECLTYPE_ARG_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) DECLTYPE_ARG_TYPE(arg1), DECLTYPE_ARG_TYPE(arg2), DECLTYPE_ARG_TYPE(arg3), DECLTYPE_ARG_TYPE(arg4), DECLTYPE_ARG_TYPE(arg5), DECLTYPE_ARG_TYPE(arg6), DECLTYPE_ARG_TYPE(arg7), DECLTYPE_ARG_TYPE(arg8)\n    //#define DECLTYPE_ARG_9(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) DECLTYPE_ARG_TYPE(arg1), DECLTYPE_ARG_TYPE(arg2), DECLTYPE_ARG_TYPE(arg3), DECLTYPE_ARG_TYPE(arg4), DECLTYPE_ARG_TYPE(arg5), DECLTYPE_ARG_TYPE(arg6), DECLTYPE_ARG_TYPE(arg7), DECLTYPE_ARG_TYPE(arg8), DECLTYPE_ARG_TYPE(arg9)\n    //\n    //#define DECLTYPE_ARG_HELPER(count, ...) DECLTYPE_ARG_ ## count (__VA_ARGS__)\n    //#define DECLTYPE_ARG(count, ...) DECLTYPE_ARG_HELPER(count, __VA_ARGS__)\n    //#define DECLTYPE_ARGS(...) DECLTYPE_ARG(NARGS(__VA_ARGS__) __VA_OPT__(,) __VA_ARGS__)\n    //\n#endif\n\n    /**\n     * @def LAZYCALL(variable, method, ...)\n     * \n     * Macro for creating a deferred call to a class method. \n     * Used to safely work with data types listed using the macro.\n     * \n     * Method arguments cannot be of types from the list @ref MEMSAFE_INVALIDATE\n     * \n     * Someday, using static reflection, the same thing can be done without macros.\n     * \n     */\n\n#define LAZYCALL(variable, method, ...) LazyCaller<decltype(variable), decltype(std::declval<decltype(variable)>().method(__VA_ARGS__)) __VA_OPT__(,) DECLTYPE(__VA_ARGS__) >(variable, &decltype(variable):: method __VA_OPT__(,) __VA_ARGS__ )\n\n    /**\n     * Lazy (deferred) invocation of class methods to safely work \n     * with iterators and other types of addresses \n     * that may become invalid after the underlying object's data has changed.\n     * \n     * @ref LAZYCALL()\n     */\n    template <typename T, typename R, typename ... Args>\n    class LazyCaller : public LazyCallerInterface {\n        T &object;\n\n        union {\n            R(T::*method)(Args...);\n            R(T::*method_const)(Args...) const;\n        };\n\n        std::tuple<Args...> args;\n\n    public:\n\n        LazyCaller(T &var, R(T::*call)(Args...), Args&&... args) : object(var), method(call), args(std::make_tuple(std::forward<Args>(args)...)) {\n        }\n\n        LazyCaller(T &var, R(T::*call)(Args...) const, Args&&... args) : object(var), method_const(call), args(std::make_tuple(std::forward<Args>(args)...)) {\n        }\n\n        inline R operator*() {\n            return call<T, R, Args...>(object, method, args);\n        }\n\n        inline R operator*() const {\n            return call<T, R, Args...>(object, method_const, args);\n        }\n    };\n\n\n    //    inline std::vector<int> vect;\n    //    inline auto check = LAZYCALL(vect, clear);\n    //    inline auto reserve = LAZYCALL(vect, reserve, 10UL);\n    //\n    //    inline std::vector<int> data(1, 1);\n    //    inline auto db = LAZYCALL(data, begin);\n    //    inline auto de = LAZYCALL(data, end);\n    //    inline std::vector<int> test(*db, *de);\n    //    //    inline auto call_test = LAZYCALL(vect, assign, db, de);\n    //\n    //\n    //    static_assert(std::is_same<decltype(10), decltype(0)>::value);\n    //    static_assert(std::is_same<std::vector<int>, std::vector<int>>::value);\n    //    static_assert(std::is_same<std::vector<int>::iterator, decltype(*db)>::value);\n    //\n    //    static_assert(std::is_base_of_v<LazyCallerInterface, decltype(db)>);\n    //\n    //    //    #define DECLTYPE_EXPAND_TYPE(arg)  decltype(arg)\n    //    //std::conditional<!(std::is_class_v<decltype(arg)> && std::is_base_of_v<LazyCallerInterface, decltype(arg)>), decltype(arg), decltype(std::declval<decltype(arg)>().operator*())>::type\n    //\n    //    static_assert(std::is_same<std::vector<int>::iterator, std::conditional<(std::is_class_v<decltype(db)> && std::is_base_of_v<LazyCallerInterface, decltype(db)>), decltype(*db), decltype(10)>::type >::value);\n    //    static_assert(std::is_same<int, std::conditional<(std::is_class_v<decltype(10)> && std::is_base_of_v<LazyCallerInterface, decltype(10)>), decltype(*db), decltype(10)>::type >::value);\n    //\n    //    static_assert(std::is_same<decltype(arg_helper<decltype(10)>::type_call(10)), decltype(10)>::value);\n    //    //    static_assert(std::is_same<decltype(arg_helper<decltype(db)>::type_call(db)), decltype(*db)>::value);\n    //\n    //    static_assert(std::is_same<DECLTYPE_EXPAND_TYPE(10), decltype(10)>::value);\n    //    //    static_assert(std::is_same<DECLTYPE_EXPAND_TYPE(db), decltype(*db)>::value);\n    //\n    //    //    static_assert(std::is_same<decltype(arg_type<decltype(db)>::call_type(db)), decltype(db)>::value);\n    //\n    //    //    static_assert(std::is_same<decltype(10UL), std::conditional<!(std::is_class_v<decltype(10UL)> && std::is_base_of_v<LazyCallerInterface, decltype(10UL)>), decltype(10UL), decltype(*10UL)>::type >::value);\n    //\n    //    //    static_assert(std::is_base_of_v<LazyCallerInterface, decltype(db)>);\n    //\n    //\n    //    //    static_assert(std::is_same<decltype(std::vector<int>::clear), decltype(std::vector<int>::clear)>::value);\n    //    //    static_assert(std::is_same<decltype(LazyCaller<std::vector<int>, decltype(std::declval<std::vector<int>>().clear())>::operator *())), void>::value);\n    //\n    //\n    //\n    /*\n     * \n     * \n     */\n\n    MEMSAFE_PROFILE(\"\"); // Reset to default profile\n\n    MEMSAFE_ERROR_TYPE(\"std::auto_ptr\");\n    MEMSAFE_ERROR_TYPE(\"std::shared_ptr\");\n\n    MEMSAFE_WARNING_TYPE(\"std::auto_ptr\");\n    MEMSAFE_WARNING_TYPE(\"std::shared_ptr\");\n\n    MEMSAFE_SHARED_TYPE(\"std::shared_ptr\");\n    MEMSAFE_SHARED_TYPE(\"memsafe::Shared\");\n\n    MEMSAFE_AUTO_TYPE(\"memsafe::Locker\");\n    MEMSAFE_AUTO_TYPE(\"__gnu_cxx::__normal_iterator\");\n    MEMSAFE_AUTO_TYPE(\"std::reverse_iterator\");\n\n    /*\n     * For a basic_string_view str, pointers, iterators, and references to elements of str are invalidated \n     * when an operation invalidates a pointer in the range [str.data(), str.data() + str.size()).\n     */\n    MEMSAFE_AUTO_TYPE(\"std::basic_string_view\");\n    /*\n     * For a span s, pointers, iterators, and references to elements of s are invalidated \n     * when an operation invalidates a pointer in the range [s.data(), s.data() + s.size()). \n     */\n    MEMSAFE_AUTO_TYPE(\"std::span\");\n\n\n    MEMSAFE_INVALIDATE_FUNC(\"std::swap\");\n    MEMSAFE_INVALIDATE_FUNC(\"std::move\");\n\n    // End define memory safety classes\n#if !defined(MEMSAFE_DISABLE)    \n    MEMSAFE_STATUS(\"enable\"); // Enable memory safety plugin\n#endif\n\n} // namespace memsafe\n\n\n#endif // INCLUDED_MEMSAFE_H_\n"
  },
  {
    "path": "memsafe_clang.cpp",
    "content": "#include \"memsafe_plugin.h\"\n\n#include \"llvm/Support/raw_ostream.h\"\n#include \"clang/Basic/Diagnostic.h\"\n\n#include \"clang/Frontend/FrontendPluginRegistry.h\"\n#include \"clang/Frontend/CompilerInstance.h\"\n\n#include \"clang/AST/AST.h\"\n#include \"clang/AST/Stmt.h\"\n#include \"clang/AST/Attr.h\"\n#include \"clang/AST/ASTConsumer.h\"\n#include \"clang/AST/RecursiveASTVisitor.h\"\n\n#include \"clang/Sema/ParsedAttr.h\"\n#include \"clang/Sema/Sema.h\"\n#include \"clang/Sema/SemaDiagnostic.h\"\n#include \"llvm/IR/Attributes.h\"\n\n#include \"clang/ASTMatchers/ASTMatchers.h\"\n#include \"clang/ASTMatchers/ASTMatchFinder.h\"\n\n#include \"clang/Lex/PreprocessorOptions.h\"\n\n#pragma clang attribute push\n#pragma clang diagnostic ignored \"-Wdeprecated-anon-enum-enum-conversion\"\n#pragma clang diagnostic ignored \"-Wdeprecated-this-capture\"\n\n#include \"clang/AST/ASTDumper.h\"\n\n#pragma clang attribute pop\n\nusing namespace clang;\nusing namespace clang::ast_matchers;\nusing namespace memsafe;\n\n\nnamespace {\n\n\n    /**\n     * @def MemSafePlugin\n     * \n     * The MemSafePlugin class is made as a RecursiveASTVisitor template for the following reasons:\n     * - AST traversal occurs from top to bottom through all leaves, which allows to dynamically create and clear context information.\n     * Whereas when searching for matches using AST Matcher, MatchCallback only called for the found nodes,\n     * but clearing the necessary context information for each call is very expensive.\n     * - RecursiveASTVisitor allows interrupting (or repeating) traversal of individual AST node depending on dynamic context information.\n     * - Matcher processes AST only for specific specified matchers and analysis of missed (not processed) attributes is difficult for it,\n     * whereas RecursiveASTVisitor sequentially traverses all AST nodes regardless of the configured templates.\n     *\n     * The plugin is used as a static signleton to store context and simplify access from any classes,\n     * but is created dynamically to use the context CompilerInstance\n     *\n     * Traverse ... - can form the current context\n     * Visit ... - only analyze data without changing the context\n     * \n     */\n\n    class MemSafePlugin;\n    static std::unique_ptr<MemSafePlugin> plugin;\n    static std::unique_ptr<MemSafeFile> scaner;\n\n    /**\n     * @def MemSafeLogger\n     * \n     * Container for addeded attributes with a processing mark \n     * (so as not to miss unprocessed attributes) and plugin analyzer log.\n     */\n\n    class MemSafeLogger {\n        const CompilerInstance &m_ci;\n        std::map<SourceLocation, bool> m_attrs;\n        std::vector<std::pair<SourceLocation, std::string>> m_logs;\n    public:\n\n        MemSafeLogger(const CompilerInstance &ci) : m_ci(ci) {\n        }\n\n        void Log(SourceLocation loc, std::string str) {\n            m_logs.push_back({std::move(loc), std::move(str)});\n        }\n\n        inline void AttrAdd(SourceLocation loc) {\n            assert(loc.isValid());\n            m_attrs.emplace(loc, false);\n        }\n\n        void AttrComplete(SourceLocation loc) {\n            auto found = m_attrs.find(loc);\n            if (found == m_attrs.end()) {\n                Log(loc, \"Attribute location not found!\");\n            } else {\n                found->second = true;\n            }\n        }\n\n        static std::string LocToStr(const SourceLocation &loc, const SourceManager &sm) {\n            std::string str = loc.printToString(sm);\n            size_t pos = str.find(' ');\n            if (pos == std::string::npos) {\n                return str;\n            }\n            return str.substr(0, pos);\n        }\n\n        inline std::string LocToStr(const SourceLocation &loc) {\n            return LocToStr(loc, m_ci.getSourceManager());\n        }\n\n        void Dump(raw_ostream & out) {\n\n            // For simple copy-paste into unit tests\n\n            //            for (auto &elem : m_logs) {\n            //                out << \"    \\\"\" << elem.second.substr(0, elem.second.find(\" \", 7)) << \"\\\",\\n\";\n            //            }\n            //            out << \"\\n\";\n\n\n            out << MEMSAFE_KEYWORD_START_LOG;\n            for (auto &elem : m_logs) {\n                out << LocToStr(elem.first);\n                out << \": \" << elem.second << \"\\n\";\n            }\n            for (auto &elem : m_attrs) {\n                if (!elem.second) {\n                    out << LocToStr(elem.first);\n                    out << \": unprocessed attribute!\\n\";\n                }\n            }\n        }\n    };\n\n    static std::unique_ptr<MemSafeLogger> logger;\n\n    /**\n     * @def MemSafeAttrInfo\n     * \n     * Class for applies a custom attribute to any declaration \n     * or expression without examining the arguments \n     * (only the number of arguments and their type are checked).\n     */\n\n    struct MemSafeAttrInfo : public ParsedAttrInfo {\n\n        MemSafeAttrInfo() {\n\n            OptArgs = 3;\n\n            static constexpr Spelling S[] = {\n                {ParsedAttr::AS_GNU, TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE)},\n                {ParsedAttr::AS_C23, TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE)},\n                {ParsedAttr::AS_CXX11, TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE)},\n                {ParsedAttr::AS_CXX11, \"::\" TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE)},\n            };\n            Spellings = S;\n        }\n\n        AnnotateAttr * CreateAttr(Sema &S, const ParsedAttr &Attr) const {\n\n            if (Attr.getNumArgs() < 1 || Attr.getNumArgs() > 3) {\n\n                S.Diag(Attr.getLoc(), S.getDiagnostics().getCustomDiagID(\n                        DiagnosticsEngine::Error,\n                        \"The attribute '\" TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE) \"' expects two or three string literals as arguments.\"));\n\n                return nullptr;\n            }\n\n            SmallVector<Expr *, 4> ArgsBuf;\n            for (unsigned i = 0; i < Attr.getNumArgs(); i++) {\n\n                if (!dyn_cast<StringLiteral>(Attr.getArgAsExpr(i)->IgnoreParenCasts())) {\n                    S.Diag(Attr.getLoc(), S.getDiagnostics().getCustomDiagID(\n                            DiagnosticsEngine::Error, \"Expected argument as a string literal\"));\n                    return nullptr;\n                }\n\n                ArgsBuf.push_back(Attr.getArgAsExpr(i));\n            }\n\n            // Add empty second argument\n            if (Attr.getNumArgs() == 1) {\n                ArgsBuf.push_back(StringLiteral::CreateEmpty(S.Context, 0, 0, 0));\n            }\n\n\n            // Add attribute location to check after plugin processing\n            if (logger) {\n                logger->AttrAdd(Attr.getLoc());\n            }\n\n            return AnnotateAttr::Create(S.Context, TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE), ArgsBuf.data(), ArgsBuf.size(), Attr.getRange());\n        }\n\n        AttrHandling handleDeclAttribute(Sema &S, Decl *D, const ParsedAttr &Attr) const override {\n            if (auto attr = CreateAttr(S, Attr)) {\n                D->addAttr(attr);\n                return AttributeApplied;\n            }\n            return AttributeNotApplied;\n        }\n\n        AttrHandling handleStmtAttribute(Sema &S, Stmt *St, const ParsedAttr &Attr, class Attr *&Result) const override {\n            if ((Result = CreateAttr(S, Attr))) {\n                return AttributeApplied;\n            }\n            return AttributeNotApplied;\n        }\n\n    };\n\n    /*\n     * \n     * \n     * \n     */\n\n    struct DeclInfo {\n        const ValueDecl * decl;\n        const char * type;\n    };\n\n    struct LifeTime {\n        typedef std::variant<std::monostate, const FunctionDecl *, const CXXRecordDecl *, const CXXTemporaryObjectExpr *, const CallExpr *, const CXXMemberCallExpr *, const CXXOperatorCallExpr *, const MemberExpr *> ScopeType;\n        /**\n         * The scope and lifetime of variables (code block, function definition, function or method call, etc.)\n         */\n        const ScopeType scope;\n\n        /** \n         * Map of iterators and reference variables (iter => value)\n         */\n        typedef std::map<std::string, std::string> DependentType;\n        DependentType dependent;\n        static inline const DependentType::iterator DependentEnd = static_cast<DependentType::iterator> (nullptr);\n\n        /** \n         * Map of dependent variable usage and their possible changes \n         * (data modifications that can invalidate the iterator)\n         * (value => Location)\n         */\n        typedef std::map<std::string, std::vector<SourceLocation>> BlockerType;\n        BlockerType blocker;\n        static inline const BlockerType::iterator BlockerEnd = static_cast<BlockerType::iterator> (nullptr);\n\n        // List of traking variables\n        std::map<const std::string, DeclInfo> vars;\n\n        // List of un traking (other) variables\n        std::set<std::string> other;\n\n        // Start location for FunctionDecl or other ...Calls, or End locattion for Stmt\n        SourceLocation location;\n\n        // Locattion for UNSAFE block or Invalid\n        SourceLocation unsafeLoc;\n\n        LifeTime(SourceLocation loc = SourceLocation(), const ScopeType c = std::monostate(), SourceLocation unsafe = SourceLocation())\n        : location(loc), scope(c), unsafeLoc(unsafe) {\n        }\n\n    };\n\n    class LifeTimeScope : SCOPE(protected) std::deque< LifeTime > { // use deque instead of vector as it preserves iterators when resizing\n\n    public:\n\n        enum ModifyMode : uint8_t {\n            UNKNOWN = 0,\n            BOTH_MODE = 1,\n            EDIT_ONLY = 2,\n            CONST_ONLY = 3,\n        };\n\n\n        const CompilerInstance &m_CI;\n\n        LifeTimeScope(const CompilerInstance &inst) : m_CI(inst) {\n        }\n\n        SourceLocation testUnsafe() {\n            auto iter = rbegin();\n            while (iter != rend()) {\n                if (iter->unsafeLoc.isValid()) {\n                    return iter->unsafeLoc;\n                }\n                iter++;\n            }\n            return SourceLocation();\n        }\n\n        inline bool testInplaceCaller() {\n\n            static_assert(std::is_same_v < std::monostate, std::variant_alternative_t < 0, LifeTime::ScopeType>>);\n            static_assert(std::is_same_v < const FunctionDecl *, std::variant_alternative_t < 1, LifeTime::ScopeType>>);\n\n            return back().scope.index() >= 2;\n        }\n\n        static ModifyMode testMode(const LifeTime::ScopeType &scope) {\n            if (std::holds_alternative<const MemberExpr *>(scope)) {\n                const MemberExpr *member = std::get<const MemberExpr *>(scope);\n\n                // llvm::outs() << \"testMode: \" << member->getMemberDecl()->getNameAsString() << \" \" << member->getMemberDecl() << \"\\n\";\n\n                DeclContext * cls = member->getMemberDecl()->getDeclContext();\n                if (cls) {\n\n                    bool const_count = false;\n                    bool non_const_count = false;\n\n                    for (auto elem : cls->noload_lookup(member->getMemberDecl()->getDeclName())) {\n                        if (const CXXMethodDecl * method = dyn_cast<CXXMethodDecl>(elem)) {\n                            if (method->isConst()) {\n                                const_count = true;\n                            } else {\n                                non_const_count = true;\n                            }\n                        }\n                    }\n\n                    if (const_count && non_const_count) {\n                        return ModifyMode::BOTH_MODE;\n                    } else if (!const_count && non_const_count) {\n                        return ModifyMode::EDIT_ONLY;\n                    } else if (const_count && !non_const_count) {\n                        return ModifyMode::CONST_ONLY;\n                    }\n                }\n            } else if (std::holds_alternative<const CXXOperatorCallExpr *>(scope)) {\n\n                const CXXOperatorCallExpr *op = std::get<const CXXOperatorCallExpr *>(scope);\n                if (op->isAssignmentOp()) {\n                    return ModifyMode::EDIT_ONLY;\n                } else if (op->isComparisonOp() || op->isInfixBinaryOp()) {\n                    return ModifyMode::CONST_ONLY;\n                }\n\n            }\n            return ModifyMode::UNKNOWN;\n        }\n\n        static std::string getName(const LifeTime::ScopeType &scope) {\n\n            static_assert(std::is_same_v <const CallExpr *, std::variant_alternative_t < 4, LifeTime::ScopeType>>);\n            static_assert(std::is_same_v <const MemberExpr *, std::variant_alternative_t < 7, LifeTime::ScopeType>>);\n\n\n            const CallExpr * call = nullptr;\n            if (std::holds_alternative<const MemberExpr *>(scope)) {\n                //                llvm::outs() << \"getMemberNameInfo(): \" << std::get<const MemberExpr *>(scope)->getMemberDecl()->getNameAsString() << \"\\n\";\n                return std::get<const MemberExpr *>(scope)->getMemberNameInfo().getAsString();\n\n            } else if (std::holds_alternative<const FunctionDecl *>(scope)) {\n\n                return std::get<const FunctionDecl *>(scope)->getNameAsString();\n\n            } else if (std::holds_alternative<const CXXMemberCallExpr *>(scope)) {\n                call = std::get<const CXXMemberCallExpr *>(scope);\n            } else if (std::holds_alternative<const CXXOperatorCallExpr *>(scope)) {\n                call = std::get<const CXXOperatorCallExpr *>(scope);\n            } else if (std::holds_alternative<const CallExpr *>(scope)) {\n                call = std::get<const CallExpr *>(scope);\n            }\n\n\n\n            if (call) {\n                return call->getDirectCallee()->getQualifiedNameAsString();\n            }\n\n            return \"\";\n        }\n\n        const char * findVariable(std::string_view name, int &level) {\n            if (name.empty()) {\n                return \"\";\n            }\n            auto iter = rbegin();\n            while (iter != rend()) {\n                auto found_var = iter->vars.find(name.begin());\n                if (found_var != iter->vars.end()) {\n                    level = std::distance(iter, rend());\n                    return found_var->second.type;\n                }\n                auto found_other = iter->other.find(name.begin());\n                if (found_other != iter->other.end()) {\n                    return \"\";\n                }\n                iter++;\n            }\n            return nullptr;\n        }\n\n        std::string getCalleeName() {\n            auto iter = rbegin();\n            while (iter != rend()) {\n                std::string result = getName(iter->scope);\n                if (!result.empty()) {\n                    return result;\n                }\n                iter++;\n            }\n            return \"\";\n        }\n\n        std::string getClassName() {\n            auto iter = rbegin();\n            while (iter != rend()) {\n                if (std::holds_alternative<const CXXRecordDecl *>(iter->scope)) {\n                    return std::get<const CXXRecordDecl *>(iter->scope)->getQualifiedNameAsString();\n                }\n                iter++;\n            }\n            return \"\";\n        }\n\n        SourceLocation testArgument() {\n            auto iter = rbegin();\n            while (iter != rend()) {\n                if (iter->unsafeLoc.isValid()) {\n                    return iter->unsafeLoc;\n                }\n                iter++;\n            }\n            return SourceLocation();\n        }\n\n        void PushScope(SourceLocation loc, LifeTime::ScopeType call = std::monostate(), SourceLocation unsafe = SourceLocation()) {\n            push_back(LifeTime(loc, call, unsafe));\n        }\n\n        void PopScope() {\n            assert(size() > 1); // First level reserved for static objects\n            pop_back();\n        }\n\n        LifeTime & back() {\n            assert(size()); // First level reserved for static objects\n            return std::deque< LifeTime >::back();\n        }\n\n        void AddVarDecl(const VarDecl * decl, const char *type, std::string name = \"\") {\n            assert(decl);\n            if (name.empty()) {\n                name = decl->getNameAsString();\n            }\n            assert(back().vars.find(name) == back().vars.end());\n            back().vars.emplace(name, DeclInfo({decl, type}));\n        }\n\n        LifeTime::DependentType::iterator findDependent(const std::string_view name) {\n            for (auto level = rbegin(); level != rend(); level++) {\n                auto found = level->dependent.find(name.begin());\n                if (found != level->dependent.end()) {\n                    return found;\n                }\n            }\n            return LifeTime::DependentEnd;\n        }\n\n        LifeTime::BlockerType::iterator findBlocker(const std::string_view name) {\n            for (auto level = rbegin(); level != rend(); level++) {\n                auto found = level->blocker.find(name.begin());\n                if (found != level->blocker.end()) {\n                    return found;\n                }\n            }\n            return LifeTime::BlockerEnd;\n        }\n\n        std::string Dump(const SourceLocation &loc, std::string_view filter) {\n\n            std::string result = MEMSAFE_KEYWORD_START_DUMP;\n            if (loc.isValid()) {\n                if (loc.isMacroID()) {\n                    result += m_CI.getSourceManager().getExpansionLoc(loc).printToString(m_CI.getSourceManager());\n                } else {\n                    result += loc.printToString(m_CI.getSourceManager());\n                }\n                result += \": \";\n            }\n            if (!filter.empty()) {\n                //@todo Create Dump filter \n                result += std::format(\" filter '{}' not implemented!\", filter.begin());\n            }\n            result += \"\\n\";\n\n            auto iter = begin();\n            while (iter != end()) {\n\n                if (iter->location.isValid()) {\n                    result += iter->location.printToString(m_CI.getSourceManager());\n\n                    std::string name = getName(iter->scope);\n                    if (!name.empty()) {\n                        result += \" [\";\n                        result += name;\n                        result += \"]\";\n                    }\n\n                } else {\n                    result += \" #static \";\n                }\n\n                result += \": \";\n\n                std::string list;\n                auto iter_list = iter->vars.begin();\n                while (iter_list != iter->vars.end()) {\n\n                    if (!list.empty()) {\n                        list += \", \";\n                    }\n\n                    list += iter_list->first;\n                    iter_list++;\n                }\n\n                result += list;\n\n\n                std::string dep_str;\n                auto dep_list = iter->dependent.begin();\n                while (dep_list != iter->dependent.end()) {\n\n                    if (!dep_str.empty()) {\n                        dep_str += \", \";\n                    }\n\n                    dep_str += \"(\";\n                    dep_str += dep_list->first;\n                    dep_str += \"=>\";\n                    dep_str += dep_list->second;\n                    dep_str += \")\";\n\n                    dep_list++;\n                }\n\n                if (!dep_str.empty()) {\n                    result += \" #dep \";\n                    result += dep_str;\n                }\n\n\n                std::string other_str;\n                auto other_list = iter->other.begin();\n                while (other_list != iter->other.end()) {\n\n                    if (!other_str.empty()) {\n                        other_str += \", \";\n                    }\n\n                    other_str += *other_list;\n                    other_list++;\n                }\n\n                if (!other_str.empty()) {\n                    result += \" #other \";\n                    result += other_str;\n                }\n\n                result += \"\\n\";\n                iter++;\n            }\n            return result;\n        }\n\n    };\n\n    /*\n     * \n     * \n     */\n\n    enum LogLevel : uint8_t {\n        INFO = 0,\n        WARN = 1,\n        ERR = 3,\n    };\n\n    enum ClassType : uint8_t {\n        UNKNOWN = 0,\n        AUTO = 1,\n        WEAK = 2,\n        SHARED = 3,\n        NOT_SHARED = 4,\n    };\n\n    class MemSafePlugin : public RecursiveASTVisitor<MemSafePlugin> {\n    public:\n        static inline const char * ERROR_TYPE = MEMSAFE_KEYWORD_ERROR \"-type\";\n        static inline const char * WARNING_TYPE = MEMSAFE_KEYWORD_WARNING \"-type\";\n\n        static inline const char * AUTO_TYPE = MEMSAFE_KEYWORD_AUTO_TYPE;\n        static inline const char * SHARED_TYPE = MEMSAFE_KEYWORD_SHARED_TYPE;\n        static inline const char * INVALIDATE_FUNC = MEMSAFE_KEYWORD_INVALIDATE_FUNC;\n\n        static inline const std::set<std::string> attArgs{SHARED_TYPE, AUTO_TYPE, INVALIDATE_FUNC};\n\n\n        // The first string arguments in the `memsafe` attribute for working and managing the plugin\n        static inline const char * PROFILE = MEMSAFE_KEYWORD_PROFILE;\n        static inline const char * STATUS = MEMSAFE_KEYWORD_STATUS;\n        static inline const char * LEVEL = MEMSAFE_KEYWORD_LEVEL;\n\n        static inline const char * ERROR = MEMSAFE_KEYWORD_ERROR;\n        static inline const char * WARNING = MEMSAFE_KEYWORD_WARNING;\n        static inline const char * NOTE = MEMSAFE_KEYWORD_NOTE;\n        static inline const char * REMARK = MEMSAFE_KEYWORD_REMARK;\n        static inline const char * IGNORED = MEMSAFE_KEYWORD_IGNORED;\n\n        static inline const char * BASELINE = MEMSAFE_KEYWORD_BASELINE;\n        static inline const char * UNSAFE = MEMSAFE_KEYWORD_UNSAFE;\n        static inline const char * PRINT_AST = MEMSAFE_KEYWORD_PRINT_AST;\n        static inline const char * PRINT_DUMP = MEMSAFE_KEYWORD_PRINT_DUMP;\n\n        static inline const char * STATUS_ENABLE = MEMSAFE_KEYWORD_ENABLE;\n        static inline const char * STATUS_DISABLE = MEMSAFE_KEYWORD_DISABLE;\n        static inline const char * STATUS_PUSH = MEMSAFE_KEYWORD_PUSH;\n        static inline const char * STATUS_POP = MEMSAFE_KEYWORD_POP;\n\n        std::set<std::string> m_listFirstArg{PROFILE, STATUS, LEVEL, UNSAFE, SHARED_TYPE, AUTO_TYPE, INVALIDATE_FUNC, WARNING_TYPE, ERROR_TYPE, BASELINE, PRINT_AST, PRINT_DUMP};\n        std::set<std::string> m_listStatus{STATUS_ENABLE, STATUS_DISABLE, STATUS_PUSH, STATUS_POP};\n        std::set<std::string> m_listLevel{ERROR, WARNING, NOTE, REMARK, IGNORED};\n\n\n        typedef std::map<std::string, std::pair<const CXXRecordDecl *, SourceLocation>> ClassListType;\n        typedef std::variant<const CXXRecordDecl *, std::string> LocationType;\n\n        bool m_is_cyclic_analysis;\n        MemSafeFile::ClassReadType m_classes;\n        ClassListType m_not_shared_class;\n\n        /**\n         * List of base classes that contain strong pointers to data \n         * (copying a variable does not copy the data,  only the reference \n         * and increments the ownership counter).\n         */\n        std::map<std::string, LocationType> m_shared_type;\n        /**\n         * List of base classes that contain strong pointers to data \n         * that can only be created in temporary variables \n         * (which are automatically deallocated when they go out of scope).\n         */\n        std::set<std::string> m_auto_type;\n        /**\n         * List of base iterator types that must be tracked for strict control of dependent pointers.         \n         */\n        std::set<std::string> m_invalidate_func;\n\n        std::set<std::string> m_warning_type;\n        std::set<std::string> m_error_type;\n\n        std::vector<bool> m_status{false};\n\n\n        clang::DiagnosticsEngine::Level m_level_non_const_arg;\n        clang::DiagnosticsEngine::Level m_level_non_const_method;\n        clang::DiagnosticsEngine::Level m_diagnostic_level;\n\n        static const inline std::pair<std::string, std::string> pair_empty{std::make_pair<std::string, std::string>(\"\", \"\")};\n\n        int64_t line_base;\n        int64_t line_number;\n\n        LifeTimeScope m_scopes;\n\n        memsafe::StringMatcher m_dump_matcher;\n        SourceLocation m_dump_location;\n        SourceLocation m_trace_location;\n\n        const CompilerInstance &m_CI;\n\n        MemSafePlugin(const CompilerInstance &instance) :\n        m_CI(instance), m_scopes(instance), line_base(0), line_number(0) {\n            // Zero level for static variables\n            m_scopes.PushScope(SourceLocation(), std::monostate(), SourceLocation());\n\n            m_diagnostic_level = clang::DiagnosticsEngine::Level::Error;\n\n            m_is_cyclic_analysis = true;\n        }\n\n        inline clang::DiagnosticsEngine &getDiag() {\n            return m_CI.getDiagnostics();\n        }\n\n        void clear() {\n            //            MemSafePlugin empty(m_CI);\n            //            std::swap(*this, empty);\n        }\n\n        void dump(raw_ostream & out) {\n            out << \"\\n#memsafe-config\\n\";\n            out << \"error-type: \" << makeHelperString(m_error_type) << \"\\n\";\n            out << \"warning-type: \" << makeHelperString(m_warning_type) << \"\\n\";\n            out << MEMSAFE_KEYWORD_AUTO_TYPE \": \" << makeHelperString(m_auto_type) << \"\\n\";\n            out << MEMSAFE_KEYWORD_SHARED_TYPE \": \" << makeHelperString(m_shared_type) << \"\\n\";\n            out << \"not-shared-classes: \" << makeHelperString(m_not_shared_class) << \"\\n\";\n            out << MEMSAFE_KEYWORD_INVALIDATE_FUNC \": \" << makeHelperString(m_invalidate_func) << \"\\n\";\n            out << \"\\n\";\n        }\n\n        clang::DiagnosticsEngine::Level getLevel(clang::DiagnosticsEngine::Level original) {\n            SourceLocation loc = m_scopes.testUnsafe();\n            if (loc.isValid()) {\n                return clang::DiagnosticsEngine::Level::Ignored;\n            }\n            if (!isEnabledStatus()) {\n                return clang::DiagnosticsEngine::Level::Ignored;\n            } else if (original > m_diagnostic_level) {\n                return m_diagnostic_level;\n            }\n            return original;\n        }\n\n        std::string LogPos(const SourceLocation &loc) {\n\n            size_t line_no = 0;\n            if (loc.isMacroID()) {\n                line_no = m_CI.getSourceManager().getSpellingLineNumber(m_CI.getSourceManager().getExpansionLoc(loc));\n            } else {\n                line_no = m_CI.getSourceManager().getSpellingLineNumber(loc);\n            }\n\n            if (loc.isValid()) {\n                return std::format(\"{}\", line_no - line_base + line_number);\n            }\n            return \"0\";\n        }\n\n        void LogOnly(SourceLocation loc, std::string str, SourceLocation hash = SourceLocation(), LogLevel level = LogLevel::INFO) {\n            if (logger) {\n                const char * prefix = nullptr;\n                switch (level) {\n                    case LogLevel::INFO:\n                        prefix = \"log\";\n                        break;\n                    case LogLevel::WARN:\n                        prefix = \"warn\";\n                        break;\n                    case LogLevel::ERR:\n                        prefix = \"err\";\n                        break;\n                }\n                logger->Log(loc, std::format(\"#{} #{} {}\", prefix, hash.isValid() ? LogPos(hash) : LogPos(loc), str));\n            }\n        }\n\n        void LogWarning(SourceLocation loc, std::string str, SourceLocation hash = SourceLocation()) {\n            getDiag().Report(loc, getDiag().getCustomDiagID(\n                    getLevel(clang::DiagnosticsEngine::Warning), \"%0\"))\n                    .AddString(str);\n            LogOnly(loc, str, hash, LogLevel::WARN);\n        }\n\n        void LogError(SourceLocation loc, std::string str, SourceLocation hash = SourceLocation()) {\n            getDiag().Report(loc, getDiag().getCustomDiagID(\n                    getLevel(clang::DiagnosticsEngine::Error), \"%0\"))\n                    .AddString(str);\n            LogOnly(loc, str, hash, LogLevel::ERR);\n        }\n\n        template <typename T>\n        static std::string makeHelperString(const T &map) {\n            std::string result;\n            for (auto elem : map) {\n                if (!result.empty()) {\n                    result += \"', '\";\n                }\n                result += elem.first;\n            }\n            result.insert(0, \"'\");\n            result += \"'\";\n            return result;\n        }\n\n        static std::string makeHelperString(const std::set<std::string> &set) {\n            std::string result;\n            for (auto &elem : set) {\n\n                if (!result.empty()) {\n                    result += \"', '\";\n                }\n                result += elem;\n            }\n            result.insert(0, \"'\");\n            result += \"'\";\n            return result;\n        }\n\n        static bool checkBehavior(const std::string_view str, clang::DiagnosticsEngine::Level *level = nullptr) {\n            if (str.compare(ERROR) == 0) {\n                if (level) {\n                    *level = clang::DiagnosticsEngine::Level::Error;\n                }\n                return true;\n            } else if (str.compare(WARNING) == 0) {\n                if (level) {\n                    *level = clang::DiagnosticsEngine::Level::Warning;\n                }\n                return true;\n            } else if (str.compare(IGNORED) == 0) {\n                if (level) {\n                    *level = clang::DiagnosticsEngine::Level::Ignored;\n                }\n                return true;\n            }\n            return false;\n        }\n\n        static std::string unknownArgumentHelper(const std::string_view arg, const std::set<std::string> & set) {\n            std::string result = \"Unknown argument '\";\n            result += arg.begin();\n            result += \"'. Expected string argument from the following list: \";\n            result += makeHelperString(set);\n            return result;\n        }\n\n        std::string processArgs(std::string_view first, std::string_view second, SourceLocation loc) {\n\n            std::string result;\n            if (first.empty() || second.empty()) {\n                if (first.compare(PROFILE) == 0) {\n                    clear();\n                } else if (first.compare(UNSAFE) == 0 || first.compare(PRINT_AST) == 0 || first.compare(PRINT_DUMP) == 0) {\n                    // The second argument may be empty\n                } else {\n                    result = \"Two string literal arguments expected!\";\n                }\n            } else if (m_listFirstArg.find(first.begin()) == m_listFirstArg.end()) {\n                result = unknownArgumentHelper(first.begin(), m_listFirstArg);\n            }\n\n            static const char * LEVEL_ERROR_MESSAGE = \"Required behavior not recognized! Allowed values: '\"\n                    MEMSAFE_KEYWORD_ERROR \"', '\" \"', '\" MEMSAFE_KEYWORD_WARNING \"' or '\" MEMSAFE_KEYWORD_IGNORED \"'.\";\n\n            if (result.empty()) {\n                if (first.compare(STATUS) == 0) {\n                    if (m_listStatus.find(second.begin()) == m_listStatus.end()) {\n                        result = unknownArgumentHelper(second, m_listStatus);\n                    } else {\n                        if (m_status.empty()) {\n                            result = \"Violation of the logic of saving and restoring the state of the plugin\";\n                        } else {\n                            if (second.compare(STATUS_ENABLE) == 0) {\n                                *m_status.rbegin() = true;\n                            } else if (second.compare(STATUS_DISABLE) == 0) {\n                                *m_status.rbegin() = false;\n                            } else if (second.compare(STATUS_PUSH) == 0) {\n                                m_status.push_back(true);\n                            } else if (second.compare(STATUS_POP) == 0) {\n                                if (m_status.size() == 1) {\n                                    result = \"Violation of the logic of saving and restoring the state of the plugin\";\n                                } else {\n                                    m_status.pop_back();\n                                }\n                            }\n                        }\n                    }\n                } else if (first.compare(LEVEL) == 0) {\n\n                    if (m_listLevel.find(second.begin()) == m_listLevel.end()) {\n                        result = unknownArgumentHelper(second, m_listLevel);\n                    } else if (!checkBehavior(second, &m_diagnostic_level)) {\n                        result = LEVEL_ERROR_MESSAGE;\n                    }\n\n                } else if (first.compare(PROFILE) == 0) {\n                    if (!second.empty()) {\n                        result = \"Loading profile from file is not implemented!\";\n                    }\n                } else if (first.compare(ERROR_TYPE) == 0) {\n                    m_error_type.emplace(second.begin());\n                } else if (first.compare(WARNING_TYPE) == 0) {\n                    m_warning_type.emplace(second.begin());\n                } else if (first.compare(SHARED_TYPE) == 0) {\n                    m_shared_type.emplace(second.begin(), MemSafeLogger::LocToStr(loc, m_CI.getSourceManager()));\n                } else if (first.compare(AUTO_TYPE) == 0) {\n                    m_auto_type.emplace(second.begin());\n                } else if (first.compare(INVALIDATE_FUNC) == 0) {\n                    m_invalidate_func.emplace(second.begin());\n                }\n            }\n            return result;\n        }\n\n        /**\n         * Find class type by name\n         */\n\n        const char * findClassType(std::string_view type, bool local_only = false) {\n\n            if (m_auto_type.find(type.begin()) != m_auto_type.end()) {\n                return AUTO_TYPE;\n            }\n            std::map<std::string, LocationType>::iterator found;\n            found = m_shared_type.find(type.begin());\n            if (found != m_shared_type.end()) {\n                return (!local_only || std::holds_alternative<const CXXRecordDecl *>(found->second)) ? SHARED_TYPE : nullptr;\n            }\n            return nullptr;\n        }\n\n        std::string LocationTypeToString(LocationType & loc) {\n            if (std::holds_alternative<std::string>(loc)) {\n                return std::get<std::string>(loc);\n            }\n            assert(std::holds_alternative<const CXXRecordDecl *>(loc));\n            return MemSafeLogger::LocToStr(std::get<const CXXRecordDecl *>(loc)->getLocation(), m_CI.getSourceManager());\n        }\n\n        void setCyclicAnalysis(bool status) {\n            m_is_cyclic_analysis = status;\n        }\n\n        /* \n         * A reference class is a class that has at least one field, \n         * or at least one field of any parent class, \n         * or the parent class itself has a reference type \n         * (i.e. the shared-type list contains the name of the class or one of its parents)\n         * or has a pointer (reference) to a structured data type.\n         * \n         * All parent classes must have a definition in the current translation unit \n         * (a forward definition is not sufficient, or a compile-time error will occur).\n         * \n         * This means that the definitions of all its parent classes and \n         * the types of fields must be available when the class is defined. \n         * However, fields with reference types may have a forward type declaration \n         * (i.e. not have a definition in the current translation unit).\n         * \n         * class Pred;\n         * class Class {\n         *      std::shared_ptr<Pred> pred; // This reference type and definition of class Pred is not required\n         * };\n         * \n         * Therefore, to check whether a struct is a reference class \n         * (whether the class contains reference data types), \n         * the definition of reference data types in the class fields is not required.\n         */\n\n        bool testSharedType(const CXXRecordDecl &decl, ClassListType &list) {\n\n            bool is_shared = false;\n            auto found_shared = m_shared_type.find(decl.getQualifiedNameAsString());\n            if (found_shared != m_shared_type.end()) {\n\n                LogOnly(decl.getLocation(), std::format(\"Detected shared type '{}' registered at {}\",\n                        decl.getQualifiedNameAsString(), LocationTypeToString(found_shared->second)));\n\n                is_shared = true;\n\n            } else {\n\n                for (auto elem : list) {\n                    if (m_shared_type.find(elem.first) != m_shared_type.end()) {\n\n                        is_shared = true;\n\n                        // At least one parent or field type of the class is a reference class, \n                        // which means that the class itself is also a reference class.\n                        m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                        LogOnly(decl.getLocation(), std::format(\"Add shared type '{}'\", decl.getQualifiedNameAsString()));\n                        break;\n                    }\n                }\n            }\n            return is_shared;\n        }\n\n        /** \n         * Make the list of used classes by recursively traversing parent classes and all their field types.\n         */\n        void MakeUsedClasses(const CXXRecordDecl &decl, ClassListType &used, ClassListType &fields) {\n            if (used.find(decl.getQualifiedNameAsString()) != used.end()) {\n                return;\n            }\n\n            if (const ClassTemplateSpecializationDecl * Special = dyn_cast<const ClassTemplateSpecializationDecl> (&decl)) {\n\n                if (m_shared_type.find(Special->getQualifiedNameAsString()) != m_shared_type.end()) {\n                    m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                } else {\n                    MakeUsedClasses(*Special->getSpecializedTemplate()->getTemplatedDecl(), used, fields);\n                }\n\n                const TemplateArgumentList& ArgsList = Special->getTemplateArgs();\n                const TemplateParameterList* TemplateList = Special->getSpecializedTemplate()->getTemplateParameters();\n\n                int Index = 0;\n                for (auto TemplateToken = TemplateList->begin(); TemplateToken != TemplateList->end(); TemplateToken++) {\n                    if ((*TemplateToken)->getKind() == Decl::Kind::TemplateTypeParm) {\n                        if (const CXXRecordDecl * type = ArgsList[Index].getAsType()->getAsCXXRecordDecl()) {\n                            if (m_shared_type.find(type->getQualifiedNameAsString()) != m_shared_type.end()) {\n                                m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                            }\n                            used[type->getQualifiedNameAsString()] = {type, Special->getLocation()};\n                            MakeUsedClasses(*type, used, fields);\n                        }\n                    }\n                    Index++;\n                }\n            }\n\n            if (decl.hasDefinition()) {\n\n                for (auto iter = decl.bases_begin(); iter != decl.bases_end(); iter++) {\n\n                    // iter->getType()->dump();\n\n                    if (const ElaboratedType * templ = dyn_cast<const ElaboratedType> (iter->getType())) {\n\n                        if (const TemplateSpecializationType * Special = dyn_cast<const TemplateSpecializationType> (templ->desugar())) {\n                            if (const ClassTemplateDecl * templ_class = dyn_cast<const ClassTemplateDecl> (Special->getTemplateName().getAsTemplateDecl())) {\n                                assert(templ_class->getTemplatedDecl());\n\n                                if (m_shared_type.find(templ_class->getTemplatedDecl()->getQualifiedNameAsString()) != m_shared_type.end()) {\n                                    m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                                } else {\n                                    //@todo Do you need all the descendants or can you limit the list to the first template class?\n                                    used[templ_class->getTemplatedDecl()->getQualifiedNameAsString()] = {templ_class->getTemplatedDecl(), iter->getBeginLoc()};\n                                    MakeUsedClasses(*templ_class->getTemplatedDecl(), used, fields);\n                                }\n\n                                for (auto elem : Special->template_arguments()) {\n                                    //                                    llvm::outs() << elem.getKind() << \"\\n\";\n                                    if (elem.getKind() == TemplateArgument::ArgKind::Type) {\n                                        if (const CXXRecordDecl * type = elem.getAsType()->getAsCXXRecordDecl()) {\n                                            if (m_shared_type.find(type->getQualifiedNameAsString()) != m_shared_type.end()) {\n                                                m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                                            } else {\n                                                //@todo Do you need all the descendants or can you limit the list to the first template class?\n                                                used[type->getQualifiedNameAsString()] = {type, iter->getBeginLoc()};\n                                                MakeUsedClasses(*elem.getAsType()->getAsCXXRecordDecl(), used, fields);\n                                            }\n                                        }\n                                    }\n                                }\n                            }\n                        } else if (const RecordType * rec = dyn_cast<const RecordType> (templ->desugar())) {\n                            if (const CXXRecordDecl * base = rec->desugar()->getAsCXXRecordDecl()) {\n                                if (m_shared_type.find(base->getQualifiedNameAsString()) != m_shared_type.end()) {\n                                    m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                                }\n                                used[base->getQualifiedNameAsString()] = {base, iter->getBeginLoc()};\n                                MakeUsedClasses(*base, used, fields);\n                            }\n                        }\n\n                    } else if (const ClassTemplateSpecializationDecl * Special = dyn_cast<const ClassTemplateSpecializationDecl> (iter->getType()->getAsCXXRecordDecl())) {\n\n                        if (m_shared_type.find(Special->getQualifiedNameAsString()) != m_shared_type.end()) {\n                            m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                        } else {\n                            MakeUsedClasses(*Special->getSpecializedTemplate()->getTemplatedDecl(), used, fields);\n                        }\n\n                        const TemplateArgumentList& ArgsList = Special->getTemplateArgs();\n                        const TemplateParameterList* TemplateList = Special->getSpecializedTemplate()->getTemplateParameters();\n\n                        int Index = 0;\n                        for (auto TemplateToken = TemplateList->begin(); TemplateToken != TemplateList->end(); TemplateToken++) {\n                            if ((*TemplateToken)->getKind() == Decl::Kind::TemplateTypeParm) {\n                                if (const CXXRecordDecl * type = ArgsList[Index].getAsType()->getAsCXXRecordDecl()) {\n                                    if (m_shared_type.find(type->getQualifiedNameAsString()) != m_shared_type.end()) {\n                                        m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                                    }\n                                    used[type->getQualifiedNameAsString()] = {type, iter->getBeginLoc()};\n                                    MakeUsedClasses(*type, used, fields);\n                                }\n                            }\n                            Index++;\n                        }\n\n                    } else if (const CXXRecordDecl * base = iter->getType()->getAsCXXRecordDecl()) {\n\n                        if (m_shared_type.find(base->getQualifiedNameAsString()) != m_shared_type.end()) {\n                            m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                        }\n                        used[base->getQualifiedNameAsString()] = {base, iter->getBeginLoc()};\n                        MakeUsedClasses(*base, used, fields);\n                    }\n                }\n\n                for (auto field = decl.field_begin(); field != decl.field_end(); field++) {\n\n                    if (field->getCanonicalDecl()->getType()->isPointerOrReferenceType()) {\n\n                        QualType CanonicalType = field->getCanonicalDecl()->getType()->getPointeeType();\n                        //  llvm::outs() << \"isPointerOrReferenceType \" << CanonicalType.getAsString() << \"\\n\";\n\n                        if (const auto *RT = CanonicalType->getAs<RecordType>()) {\n                            if (const auto *ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) {\n\n                                // the presence of a field with a reference to a structured type \n                                // means that the current type is a reference data type\n                                m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n\n\n                                if (fields.find(ClassDecl->getQualifiedNameAsString()) == fields.end() && fields.find(decl.getQualifiedNameAsString()) == fields.end()) {\n\n                                    fields[ClassDecl->getQualifiedNameAsString()] = {ClassDecl, field->getLocation()};\n\n                                    LogOnly(field->getLocation(), std::format(\"Field with reference to structured data type '{}'\", ClassDecl->getQualifiedNameAsString()));\n\n                                    // Save the type name in the list of used data types \n                                    // for future analysis of circular references.\n                                    MakeUsedClasses(*ClassDecl, used, fields);\n                                }\n\n                            }\n                        }\n                    }\n\n\n                    const CXXRecordDecl * field_type = field->getType()->getAsCXXRecordDecl();\n                    if (!field_type) {\n                        continue;\n                    }\n\n\n                    if (const ClassTemplateSpecializationDecl * Special = dyn_cast<const ClassTemplateSpecializationDecl> (field_type)) {\n\n                        if (m_shared_type.find(Special->getQualifiedNameAsString()) != m_shared_type.end()) {\n                            m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                        } else {\n                            if (fields.find(Special->getQualifiedNameAsString()) == fields.end() && fields.find(decl.getQualifiedNameAsString()) == fields.end()) {\n                                MakeUsedClasses(*Special, used, fields);\n                            }\n                        }\n\n                        // std::string diag_name;\n                        // llvm::raw_string_ostream str_out(diag_name);\n                        // Special->getNameForDiagnostic(str_out,m_CI.getASTContext().getPrintingPolicy(), true);\n                        // llvm::outs() << diag_name << \"\\n\";\n\n                        const TemplateArgumentList& ArgsList = Special->getTemplateArgs();\n                        const TemplateParameterList* TemplateList = Special->getSpecializedTemplate()->getTemplateParameters();\n\n                        int Index = 0;\n                        for (auto TemplateToken = TemplateList->begin(); TemplateToken != TemplateList->end(); TemplateToken++) {\n                            if ((*TemplateToken)->getKind() == Decl::Kind::TemplateTypeParm) {\n                                if (const CXXRecordDecl * type = ArgsList[Index].getAsType()->getAsCXXRecordDecl()) {\n                                    if (fields.find(type->getQualifiedNameAsString()) == fields.end() && fields.find(decl.getQualifiedNameAsString()) == fields.end()) {\n                                        if (m_shared_type.find(type->getQualifiedNameAsString()) != m_shared_type.end()) {\n                                            m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                                        }\n                                        fields[type->getQualifiedNameAsString()] = {type, field->getLocation()};\n                                        MakeUsedClasses(*type, used, fields);\n                                    }\n                                }\n                            }\n                            Index++;\n                        }\n\n                    } else {\n                        if (fields.find(field_type->getQualifiedNameAsString()) == fields.end() && fields.find(decl.getQualifiedNameAsString()) == fields.end()) {\n                            if (m_shared_type.find(field_type->getQualifiedNameAsString()) != m_shared_type.end()) {\n                                m_shared_type[decl.getQualifiedNameAsString()] = &decl;\n                            }\n                            fields[field_type->getQualifiedNameAsString()] = {field_type, field->getLocation()};\n                            MakeUsedClasses(*field_type, used, fields);\n                        }\n                    }\n                }\n            }\n        }\n\n        void reduceSharedList(ClassListType & list, bool test_external = true) {\n            auto iter = list.begin();\n            while (iter != list.end()) {\n                if (iter->second.first->hasDefinition()) {\n\n                    auto found_shared = m_shared_type.find(iter->first);\n                    if (found_shared == m_shared_type.end()) {\n                        iter = list.erase(iter);\n                    } else {\n                        iter++;\n                    }\n\n                } else if (test_external) {\n\n                    auto found = m_classes.find(iter->first);\n                    if (found == m_classes.end()) {\n\n                        std::string message = std::format(\"Class definition '{}' not found in current translation unit.\", iter->first);\n\n                        LogError(iter->second.second, message);\n\n                        getDiag().Report(iter->second.second,\n                                getDiag().getCustomDiagID(clang::DiagnosticsEngine::Error, \"\"\n                                \"%0\\n\"\n                                \"The circular reference analyzer requires two passes.\\n\"\n                                \"First run the plugin with key '--circleref-write -fsyntax-only' to generate the class list,\\n\"\n                                \"then run a second time with the '--circleref-read' key to re-analyze,\\n\"\n                                \"or disable the circular reference analyzer with the 'circleref-disable' option.\\n\"))\n                                .AddString(message);\n\n                        throw std::runtime_error(message);\n\n                    } else {\n                        if (found->second.parents.empty() && found->second.fields.empty()) {\n                            LogOnly(iter->second.second, std::format(\"Non shared class definition '{}' used from another translation unit.\", iter->first));\n                            iter = list.erase(iter);\n                        } else {\n                            LogOnly(iter->second.second, std::format(\"Shared class definition '{}' used from another translation unit.\", iter->first));\n                            iter++;\n                        }\n                    }\n                } else {\n                    iter++;\n                }\n            }\n        }\n\n        /**\n         * A class with cyclic relationships that has a field of reference type to its own type,\n         * or its field has a reference type to another class that has a field of reference type\n         * to the class being checked, either directly or through reference fields of other classes.\n         */\n        bool checkCycles(const CXXRecordDecl &decl, ClassListType & used, ClassListType & fields) {\n\n            // Remove all not shared classes\n            reduceSharedList(fields);\n\n            used[decl.getQualifiedNameAsString()] = {&decl, decl.getLocation()};\n\n            for (auto parent : used) {\n                auto field_found = fields.find(parent.first);\n                if (field_found != fields.end()) {\n                    LogError(field_found->second.second, std::format(\"Class {} has a reference to itself through the field type {}\",\n                            decl.getQualifiedNameAsString(), field_found->first));\n                    return false;\n                }\n            }\n\n            ClassListType other;\n            ClassListType other_fields;\n            for (auto elem : fields) {\n\n                assert(elem.second.first);\n\n                other.clear();\n                other_fields.clear();\n\n                MakeUsedClasses(*elem.second.first, other, other_fields);\n\n                reduceSharedList(other_fields);\n\n                auto other_found = other_fields.find(elem.first);\n                if (other_found != other_fields.end()) {\n                    bool is_unsafe = m_scopes.testUnsafe().isValid() || checkDeclUnsafe(decl) || checkDeclUnsafe(*elem.second.first) || checkDeclUnsafe(*other_found->second.first);\n\n                    if (is_unsafe) {\n                        LogWarning(other_found->second.second, std::format(\"UNSAFE The class '{}' has a circular reference through class '{}'\",\n                                decl.getQualifiedNameAsString(), other_found->first));\n                    } else {\n                        // Class {} has a cross reference through a field with type вввввв\n                        LogError(other_found->second.second, std::format(\"The class '{}' has a circular reference through class '{}'\",\n                                decl.getQualifiedNameAsString(), other_found->first));\n                    }\n                    return false;\n                }\n\n                for (auto elem_other : other_fields) {\n                    if (used.count(elem_other.first)) {\n\n                        bool is_unsafe = m_scopes.testUnsafe().isValid() || checkDeclUnsafe(decl) || checkDeclUnsafe(*elem.second.first) || checkDeclUnsafe(*elem_other.second.first);\n\n                        if (is_unsafe) {\n                            LogWarning(elem_other.second.second, std::format(\"UNSAFE The class '{}' has a circular reference through class '{}'\",\n                                    elem.first, decl.getQualifiedNameAsString()));\n                        } else {\n                            LogError(elem_other.second.second, std::format(\"The class '{}' has a circular reference through class '{}'\",\n                                    elem.first, decl.getQualifiedNameAsString()));\n                        }\n                        return false;\n                    }\n                }\n            }\n\n            return true;\n        }\n\n        inline bool isEnabledStatus() {\n            assert(!m_status.empty());\n            return *m_status.rbegin();\n        }\n\n        /*\n         * plugin helper methods\n         * \n         */\n        inline bool isEnabled() {\n            return isEnabledStatus() && !scaner;\n        }\n\n        SourceLocation checkUnsafeBlock(const AttributedStmt * attrStmt) {\n\n            if (attrStmt) {\n\n                auto attrs = attrStmt->getAttrs();\n\n                for (auto &elem : attrs) {\n\n                    std::pair<std::string, std::string> pair = parseAttr(dyn_cast_or_null<AnnotateAttr>(elem));\n                    if (pair != pair_empty) {\n\n                        if (pair.first.compare(UNSAFE) == 0) {\n\n                            if (logger) {\n                                logger->AttrComplete(elem->getLocation());\n                            }\n\n                            LogOnly(attrStmt->getBeginLoc(), \"Unsafe statement\", attrStmt->getBeginLoc());\n\n                            return elem->getLocation();\n                        }\n                    }\n\n                }\n            }\n            return SourceLocation();\n        }\n\n        std::pair<std::string, std::string> parseAttr(const AnnotateAttr * const attr) {\n            if (!attr || attr->getAnnotation() != TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE) || attr->args_size() != 2) {\n                return pair_empty;\n            }\n\n            clang::AnnotateAttr::args_iterator result = attr->args_begin();\n            StringLiteral * first = dyn_cast_or_null<StringLiteral>(*result);\n            result++;\n            StringLiteral * second = dyn_cast_or_null<StringLiteral>(*result);\n\n            if (!first || !second) {\n                getDiag().Report(attr->getLocation(), getDiag().getCustomDiagID(\n                        DiagnosticsEngine::Error, \"Two string literal arguments expected!\"));\n                return pair_empty;\n            }\n            return std::make_pair < std::string, std::string>(first->getString().str(), second->getString().str());\n        }\n\n        /*\n         * \n         * \n         * \n         */\n\n        bool checkDeclUnsafe(const Decl &decl) {\n            auto attr_args = parseAttr(decl.getAttr<AnnotateAttr>());\n            if (attr_args != pair_empty) {\n                return attr_args.first.compare(UNSAFE) == 0;\n            }\n            return false;\n        }\n\n        void checkDeclAttributes(const Decl *decl) {\n            // Check namespace annotation attribute\n            // This check should be done first as it is used to enable and disable the plugin.\n\n            if (!decl) {\n                return;\n            }\n\n            AnnotateAttr * attr = decl->getAttr<AnnotateAttr>();\n            auto attr_args = parseAttr(attr);\n\n            if (attr_args != pair_empty) {\n\n                std::string error_str = processArgs(attr_args.first, attr_args.second, decl->getLocation());\n\n                if (!error_str.empty()) {\n\n                    clang::DiagnosticBuilder DB = getDiag().Report(attr->getLocation(), getDiag().getCustomDiagID(\n                            DiagnosticsEngine::Error, \"Error detected: %0\"));\n                    DB.AddString(error_str);\n\n                    LogError(attr->getLocation(), error_str);\n\n                } else if (attr_args.first.compare(BASELINE) == 0) {\n\n                    SourceLocation loc = decl->getLocation();\n                    if (loc.isMacroID()) {\n                        loc = m_CI.getSourceManager().getExpansionLoc(loc);\n                    }\n\n                    try {\n                        int old_line_number = line_number;\n                        line_number = std::stoi(SeparatorRemove(attr_args.second));\n                        line_base = getDiag().getSourceManager().getSpellingLineNumber(loc);\n\n                        if (old_line_number >= line_number) {\n                            LogOnly(loc, \"Error in base sequential numbering\");\n                            getDiag().Report(loc, getDiag().getCustomDiagID(DiagnosticsEngine::Error, \"Error in base sequential numbering\"));\n                        }\n\n                    } catch (...) {\n                        LogOnly(loc, \"The second argument is expected to be a line number as a literal string!\");\n                        getDiag().Report(loc, getDiag().getCustomDiagID(\n                                DiagnosticsEngine::Error,\n                                \"The second argument is expected to be a line number as a literal string!\"));\n                    }\n\n                } else if (attr_args.first.compare(STATUS) == 0) {\n\n                    clang::DiagnosticBuilder DB = getDiag().Report(decl->getLocation(), getDiag().getCustomDiagID(\n                            DiagnosticsEngine::Note,\n                            \"Status memory safety plugin is %0!\"));\n                    DB.AddString(attr_args.second);\n\n                }\n\n                if (logger) {\n                    logger->AttrComplete(attr->getLocation());\n                }\n\n            }\n        }\n\n        /*\n         * @ref MEMSAFE_DUMP\n         */\n        void checkDumpFilter(const Decl * decl) {\n            if (decl) {\n                AnnotateAttr *attr = decl->getAttr<AnnotateAttr>();\n                auto attr_args = parseAttr(attr);\n                if (attr_args != pair_empty) {\n                    if (attr_args.first.compare(PRINT_AST) == 0) {\n                        if (attr_args.second.empty()) {\n                            m_dump_matcher.Clear();\n                        } else {\n                            //@todo Create Dump filter \n                            llvm::outs() << \"Dump filter '\" << attr_args.second << \"' not implemented!\\n\";\n                            m_dump_matcher.Create(attr_args.second, ';');\n                        }\n                        if (decl->getLocation().isMacroID()) {\n                            m_dump_location = m_CI.getSourceManager().getExpansionLoc(decl->getLocation());\n                        } else {\n                            m_dump_location = decl->getLocation();\n                        }\n\n                        if (logger) {\n                            logger->AttrComplete(attr->getLocation());\n                        }\n\n                    } else if (attr_args.first.compare(PRINT_DUMP) == 0) {\n\n                        if (skipLocation(m_trace_location, decl->getLocation())) {\n                            return;\n                        }\n\n                        if (logger) {\n                            logger->AttrComplete(attr->getLocation());\n                        }\n\n                        llvm::outs() << m_scopes.Dump(attr->getLocation(), attr_args.second);\n                    }\n                }\n            }\n        }\n\n        bool skipLocation(SourceLocation &last, const SourceLocation &loc) {\n            int64_t line_no = 0;\n            SourceLocation test_loc = loc;\n\n            if (loc.isMacroID()) {\n                test_loc = m_CI.getSourceManager().getExpansionLoc(loc);\n            }\n            if (last.isValid() &&\n                    m_CI.getSourceManager().getSpellingLineNumber(test_loc) == m_CI.getSourceManager().getSpellingLineNumber(last)) {\n                return true;\n            }\n            last = test_loc;\n            return false;\n        }\n\n        void printDumpIfEnabled(const Decl * decl) {\n            if (!decl || !isEnabledStatus() || m_dump_matcher.isEmpty() || skipLocation(m_dump_location, decl->getLocation())) {\n                return;\n            }\n\n            // Source location for IDE\n            llvm::outs() << decl->getLocation().printToString(m_CI.getSourceManager());\n            // Color highlighting\n            llvm::outs() << \"  \\033[1;46;34m\";\n            // The string at the current position to expand the AST\n\n            PrintingPolicy Policy(m_CI.getASTContext().getPrintingPolicy());\n            Policy.SuppressScope = false;\n            Policy.AnonymousTagLocations = true;\n\n            //@todo Create Dump filter \n            std::string output;\n            llvm::raw_string_ostream str(output);\n            decl->print(str, Policy);\n\n            size_t pos = output.find(\"\\n\");\n            if (pos == std::string::npos) {\n                llvm::outs() << output;\n            } else {\n                llvm::outs() << output.substr(0, pos - 1);\n            }\n\n            // Close color highlighting\n            llvm::outs() << \"\\033[0m \";\n            llvm::outs() << \" dump:\\n\";\n\n\n            // Ast tree for current line\n            const ASTContext &Ctx = m_CI.getASTContext();\n            ASTDumper P(llvm::outs(), Ctx, /*ShowColors=*/true);\n            P.Visit(decl); //dyn_cast<Decl>(decl)\n\n        }\n\n        void printDumpIfEnabled(const Stmt * stmt) {\n            if (!stmt || !isEnabledStatus() || m_dump_matcher.isEmpty() || skipLocation(m_dump_location, stmt->getBeginLoc())) {\n                return;\n            }\n\n            // Source location for IDE\n            llvm::outs() << stmt->getBeginLoc().printToString(m_CI.getSourceManager());\n            // Color highlighting\n            llvm::outs() << \"  \\033[1;46;34m\";\n            // The string at the current position to expand the AST\n\n            PrintingPolicy Policy(m_CI.getASTContext().getPrintingPolicy());\n            Policy.SuppressScope = false;\n            Policy.AnonymousTagLocations = true;\n\n            //@todo Create Dump filter \n            std::string output;\n            llvm::raw_string_ostream str(output);\n            stmt->printPretty(str, nullptr, Policy);\n\n            size_t pos = output.find(\"\\n\");\n            if (pos == std::string::npos) {\n                llvm::outs() << output;\n            } else {\n                llvm::outs() << output.substr(0, pos - 1);\n            }\n\n            // Close color highlighting\n            llvm::outs() << \"\\033[0m \";\n            llvm::outs() << \" dump:\\n\";\n\n\n            // Ast tree for current line\n            const ASTContext &Ctx = m_CI.getASTContext();\n            ASTDumper P(llvm::outs(), Ctx, /*ShowColors=*/true);\n            P.Visit(stmt); //dyn_cast<Decl>(decl)\n        }\n\n        /*\n         * \n         * \n         */\n\n        const char * checkClassNameTracking(const CXXRecordDecl * type) {\n            const char * result = type ? findClassType(type->getQualifiedNameAsString()) : nullptr;\n            const CXXRecordDecl * cxx = dyn_cast_or_null<CXXRecordDecl>(type);\n            if (cxx) {\n                for (auto iter = cxx->bases_begin(); !result && iter != cxx->bases_end(); iter++) {\n                    if (iter->isBaseOfClass()) {\n                        if (const CXXRecordDecl * base = iter->getType()->getAsCXXRecordDecl()) {\n                            result = checkClassNameTracking(base);\n                        }\n                    }\n                }\n            }\n            return result;\n        }\n\n        const DeclRefExpr * getInitializer(const VarDecl &decl) {\n            if (const CXXMemberCallExpr * calle = dyn_cast_or_null<CXXMemberCallExpr>(getExprInitializer(decl))) {\n                return dyn_cast<DeclRefExpr>(removeTempExpr(calle->getImplicitObjectArgument()));\n            }\n            if (const CXXOperatorCallExpr * op = dyn_cast_or_null<CXXOperatorCallExpr>(getExprInitializer(decl))) {\n                return dyn_cast<DeclRefExpr>(removeTempExpr(op->getArg(0)));\n            }\n            return nullptr;\n        }\n\n        const Expr * removeTempExpr(const Expr * expr) {\n            if (expr && (isa<ImplicitCastExpr>(expr) || isa<ExprWithCleanups>(expr) || isa<CXXBindTemporaryExpr>(expr) || isa<MaterializeTemporaryExpr>(expr))) {\n                return expr->IgnoreUnlessSpelledInSource();\n            }\n            return expr;\n        }\n\n        const Expr * getExprInitializer(const VarDecl & var) {\n\n            const Expr * result = removeTempExpr(var.getAnyInitializer());\n\n            if (!result || isa<StringLiteral>(result) || isa<IntegerLiteral>(result)) {\n                return nullptr;\n            }\n\n            if (isa<DeclRefExpr>(result) || isa<CXXMemberCallExpr>(result) || isa<CXXOperatorCallExpr>(result) || isa<CXXConstructExpr>(result) || isa<UnaryOperator>(result)) {\n                return result;\n            }\n\n            if (const ParenExpr * paren = dyn_cast<ParenExpr>(result)) {\n                return paren->getSubExpr();\n            }\n\n            LogError(var.getLocation(), \"Unknown VarDecl initializer\");\n            var.getAnyInitializer()->dumpColor();\n\n            return nullptr;\n\n        }\n\n        std::string getArgName(const Expr * arg) {\n            const DeclRefExpr * dre = nullptr;\n            if (const Expr * init = removeTempExpr(arg)) {\n                dre = dyn_cast<DeclRefExpr>(init->IgnoreUnlessSpelledInSource()->IgnoreImplicit());\n            }\n            if (dre && dre->getDecl()) {\n                return dre->getDecl()->getNameAsString();\n            }\n            return \"\";\n        }\n\n        void checkTypeName(const SourceLocation &loc, std::string_view name, bool unsafe) {\n            if (m_error_type.find(name.begin()) != m_error_type.end()) {\n                if (unsafe) {\n                    LogWarning(loc, std::format(\"UNSAFE Error type found '{}'\", name));\n                } else {\n                    LogError(loc, std::format(\"Error type found '{}'\", name));\n                }\n            } else if (m_warning_type.find(name.begin()) != m_warning_type.end()) {\n                if (unsafe) {\n                    LogWarning(loc, std::format(\"UNSAFE Warning type found '{}'\", name));\n                } else {\n                    LogWarning(loc, std::format(\"Warning type found '{}'\", name));\n                }\n            }\n        }\n\n        bool checkArg(const Expr * arg, std::string &name, const char * &type, int &level) {\n            name = getArgName(arg);\n            if (name.empty()) {\n                LogOnly(arg->getBeginLoc(), \"Argument is not a variable\");\n                return false;\n            }\n\n            type = m_scopes.findVariable(name, level);\n            if (type == nullptr) {\n                LogError(arg->getBeginLoc(), \"Variable name not found!\");\n                return false;\n            }\n            return true;\n        }\n\n        /*\n         * \n         * RecursiveASTVisitor template methods Visit... for analyzing source code based on the created context\n         * \n         * \n         */\n\n        bool VisitDeclRefExpr(const DeclRefExpr * ref) {\n            if (isEnabled() && !ref->getDecl()->isFunctionOrFunctionTemplate()) {\n\n                std::string ref_name = ref->getDecl()->getNameAsString();\n                std::string caller = LifeTimeScope::getName(m_scopes.back().scope);\n\n                SourceLocation cur_location = ref->getLocation();\n\n                clang::Expr::Classification cls = ref->ClassifyModifiable(m_CI.getASTContext(), cur_location);\n                //                Expr::isModifiableLvalueResult mod = ref->isModifiableLvalue(m_CI.getSourceManager(), ref->getLocation());\n                //                llvm::outs() << \"isModifiable(): \" << cls.getModifiable() << \"\\n\";\n\n\n                auto found = m_scopes.findBlocker(ref_name);\n                if (found != LifeTime::BlockerEnd) {\n                    if (!found->second.empty() && found->second.front() == cur_location) {\n                        // First use -> clear source location\n                        found->second.clear();\n\n                    } else {\n\n                        LifeTimeScope::ModifyMode mode = LifeTimeScope::testMode(m_scopes.back().scope);\n\n                        if (mode == LifeTimeScope::ModifyMode::CONST_ONLY) {\n\n                            LogOnly(cur_location, std::format(\"Only constant method '{}' does not change data.\", caller));\n                            return true;\n\n                        } else if (mode == LifeTimeScope::ModifyMode::EDIT_ONLY) {\n\n                            LogOnly(cur_location, std::format(\"Only non constant method '{}' alway changed data.\", caller));\n                            found->second.push_back(cur_location);\n\n                        } else if (mode == LifeTimeScope::ModifyMode::BOTH_MODE) {\n\n                            if (m_level_non_const_method < clang::DiagnosticsEngine::Level::Warning) {\n                                LogOnly(cur_location, std::format(\"Both methods '{}' for constant and non-constant objects tracking disabled!\", caller));\n                                return true;\n                            } else if (m_level_non_const_method == clang::DiagnosticsEngine::Level::Warning) {\n                                LogOnly(cur_location, std::format(\"Both methods '{}' for constant and non-constant objects warning only!\", caller));\n                                return true;\n                            } else if (m_level_non_const_method > clang::DiagnosticsEngine::Level::Warning) {\n                                LogOnly(cur_location, std::format(\"Both methods '{}' for constant and non-constant objects tracking enabled!\", caller));\n                                found->second.push_back(cur_location);\n                                return true;\n                            }\n                        }\n                    }\n                }\n\n                auto depend_found = m_scopes.findDependent(ref_name);\n                if (depend_found != LifeTime::DependentEnd) {\n\n\n                    std::string caller = LifeTimeScope::getName(m_scopes.back().scope);\n                    LifeTimeScope::ModifyMode mode = LifeTimeScope::testMode(m_scopes.back().scope);\n\n                    auto block_found = m_scopes.findBlocker(depend_found->second);\n                    if (block_found != LifeTime::BlockerEnd) {\n\n                        if (!caller.empty()) {\n                            if (m_invalidate_func.find(caller) != m_invalidate_func.end()) {\n                                LogOnly(ref->getLocation(), std::format(\"Call {} '{}'\", MEMSAFE_KEYWORD_INVALIDATE_FUNC, caller));\n                            } else {\n                                caller.clear();\n                            }\n                        }\n\n                        if (block_found->second.empty()) {\n                            LogOnly(ref->getLocation(), std::format(\"Depended {} corrected!\", ref_name));\n                        } else {\n\n                            for (auto &elem : block_found->second) {\n                                LogWarning(elem, std::format(\"using main variable '{}'\", block_found->first));\n                            }\n                            LogError(ref->getLocation(), std::format(\"Using the dependent variable '{}' after changing the main variable '{}'!\", ref_name, block_found->first));\n                        }\n                    }\n                }\n\n            }\n            return true;\n        }\n\n        //  **************************************************************************************************\n        //  **************************************************************************************************\n        //  **************************************************************************************************\n        //  Disabled checks lifetime, ownership and borrowing due to change in approach to reference analysis\n        //\n        //  **************************************************************************************************\n        //  **************************************************************************************************\n        //  **************************************************************************************************\n        //\n        //        bool VisitCallExpr(const CallExpr * call) {\n        //            if (isEnabled() && call->getNumArgs() == 2) {\n        //\n        //                if (call->getDirectCallee()-> getQualifiedNameAsString().compare(\"std::swap\") != 0) {\n        //                    // check only swap funstion or method\n        //                    return true;\n        //                }\n        //\n        //                std::string lval;\n        //                const char * lval_type;\n        //                int lval_level;\n        //\n        //                std::string rval;\n        //                const char * rval_type;\n        //                int rval_level;\n        //\n        //                if (checkArg(call->getArg(0), lval, lval_type, lval_level) && checkArg(call->getArg(1), rval, rval_type, rval_level)) {\n        //                    if (std::string_view(SHARED_TYPE).compare(lval_type) == 0 && std::string_view(SHARED_TYPE).compare(rval_type) == 0) {\n        //                        if (lval_level == rval_level) {\n        //                            LogOnly(call->getBeginLoc(), \"Swap shared variables with the same lifetime\");\n        //                        } else {\n        //                            if (m_scopes.testUnsafe().isValid()) {\n        //                                LogWarning(call->getBeginLoc(), \"UNSAFE swap the shared variables with different lifetimes\");\n        //                            } else {\n        //                                LogError(call->getBeginLoc(), \"Error swap the shared variables with different lifetimes\");\n        //                            }\n        //                        }\n        //                    }\n        //                }\n        //            }\n        //            return true;\n        //        }\n        //\n        //        bool VisitCXXOperatorCallExpr(const CXXOperatorCallExpr * op) {\n        //            if (isEnabled() && op->isAssignmentOp()) {\n        //\n        //                assert(op->getNumArgs() == 2);\n        //\n        //                std::string lval;\n        //                const char * lval_type;\n        //                int lval_level;\n        //\n        //                std::string rval;\n        //                const char * rval_type;\n        //                int rval_level;\n        //\n        //                if (checkArg(op->getArg(0), lval, lval_type, lval_level) && checkArg(op->getArg(1), rval, rval_type, rval_level)) {\n        //                    if (std::string_view(SHARED_TYPE).compare(lval_type) == 0 && std::string_view(SHARED_TYPE).compare(rval_type) == 0) {\n        //                        if (lval_level > rval_level) {\n        //                            LogOnly(op->getBeginLoc(), \"Copy of shared variable with shorter lifetime\");\n        //                        } else {\n        //                            if (m_scopes.testUnsafe().isValid()) {\n        //                                LogWarning(op->getBeginLoc(), \"UNSAFE copy a shared variable\");\n        //                            } else {\n        //                                LogError(op->getBeginLoc(), \"Error copying shared variable due to lifetime extension\");\n        //                            }\n        //                        }\n        //                    }\n        //                }\n        //            }\n        //            return true;\n        //        }\n        //        bool VisitReturnStmt(const ReturnStmt * ret) {\n        //\n        //            if (isEnabled() && ret) {\n        //\n        //                if (const ExprWithCleanups * inplace = dyn_cast_or_null<ExprWithCleanups>(ret->getRetValue())) {\n        //                    LogOnly(inplace->getBeginLoc(), \"Return inplace object\");\n        //                    return true;\n        //                }\n        //\n        //                std::string retval = getArgName(ret->getRetValue());\n        //                if (retval.empty()) {\n        //                    LogOnly(ret->getBeginLoc(), \"Return is not a variable\");\n        //                    return true;\n        //                }\n        //\n        //                int retval_level;\n        //                const char * retval_type = m_scopes.findVariable(retval, retval_level);\n        //                if (retval_type == nullptr) {\n        //                    LogError(ret->getBeginLoc(), \"Return variable name not found!\");\n        //                    return true;\n        //                }\n        //\n        //                if (std::string_view(AUTO_TYPE).compare(retval_type) == 0) {\n        //                    if (m_scopes.testUnsafe().isValid()) {\n        //                        LogWarning(ret->getBeginLoc(), \"UNSAFE return auto variable\");\n        //                    } else {\n        //                        LogOnly(ret->getBeginLoc(), \"Return auto variable\");\n        //                    }\n        //                } else if (std::string_view(SHARED_TYPE).compare(retval_type) == 0) {\n        //                    if (m_scopes.testUnsafe().isValid()) {\n        //                        LogWarning(ret->getBeginLoc(), \"UNSAFE return shared variable\");\n        //                    } else {\n        //                        LogError(ret->getBeginLoc(), \"Return shared variable\");\n        //                    }\n        //                }\n        //            }\n        //            return true;\n        //        }\n        //        bool VisitBinaryOperator(const BinaryOperator * op) {\n        //\n        //            if (isEnabled() && op->isAssignmentOp()) {\n        //\n        //                std::string lval;\n        //                const char * lval_type;\n        //                int lval_level;\n        //                bool is_lval = checkArg(op->getLHS(), lval, lval_type, lval_level);\n        //\n        //\n        //                std::string rval;\n        //                const char * rval_type;\n        //                int rval_level;\n        //                bool is_rval = checkArg(op->getRHS(), rval, rval_type, rval_level);\n        //\n        //                if (is_lval && is_rval) {\n        //                    if (std::string_view(SHARED_TYPE).compare(lval_type) == 0 && std::string_view(SHARED_TYPE).compare(rval_type) == 0) {\n        //                        if (lval_level > rval_level) {\n        //                            LogOnly(op->getBeginLoc(), \"Copy of shared variable with shorter lifetime\");\n        //                        } else {\n        //                            if (m_scopes.testUnsafe().isValid()) {\n        //                                LogWarning(op->getBeginLoc(), \"UNSAFE copy a shared variable\");\n        //                            } else {\n        //                                LogError(op->getBeginLoc(), \"Error copying shared variable due to lifetime extension\");\n        //                            }\n        //                        }\n        //                    }\n        //                }\n        //            }\n        //            return true;\n        //        }\n        //  **************************************************************************************************\n        //  **************************************************************************************************\n        //  **************************************************************************************************\n\n        bool VisitUnaryOperator(const UnaryOperator * unary) {\n\n            if (isEnabled() && unary->getOpcode() == UnaryOperator::Opcode::UO_AddrOf) {\n\n                //https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/OperationKinds.def                \n                //// [C++ 5.5] Pointer-to-member operators.\n                //BINARY_OPERATION(PtrMemD, \".*\")\n                //BINARY_OPERATION(PtrMemI, \"->*\")\n                //// C++20 [expr.spaceship] Three-way comparison operator.\n                //BINARY_OPERATION(Cmp, \"<=>\")\n                //\n                //        // [C99 6.5.3.2] Address and indirection\n                //UNARY_OPERATION(AddrOf, \"&\")\n                //UNARY_OPERATION(Deref, \"*\")\n                //// [C++ Coroutines] co_await operator\n                //UNARY_OPERATION(Coawait, \"co_await\")\n\n                // @todo Receiving a raw pointer is an error ?\n                if (m_scopes.testInplaceCaller()) {\n                    LogOnly(unary->getOperatorLoc(), \"Inplace address arithmetic\");\n                } else {\n                    LogError(unary->getOperatorLoc(), \"Operator for address arithmetic\");\n                }\n            }\n\n            return true;\n        }\n\n        bool VisitFieldDecl(const FieldDecl * field) {\n\n            if (isEnabled()) {\n\n                // The type (class) of the variable that the plugin should analyze\n                const CXXRecordDecl * class_decl = field->getType()->getAsCXXRecordDecl();\n                const char * found_type = checkClassNameTracking(class_decl);\n\n                bool is_unsafe = m_scopes.testUnsafe().isValid() || checkDeclUnsafe(*field);\n\n                if (class_decl) {\n                    checkTypeName(field->getLocation(), class_decl->getQualifiedNameAsString(), is_unsafe);\n                }\n                // The name of the variable\n                std::string var_name = field->getNameAsString();\n\n                if (AUTO_TYPE == found_type) {\n\n                    // @todo Is it possible to create temporary automatic variables as class fields whose instance lifetime can be any?\n\n                    if (is_unsafe) {\n                        LogWarning(field->getLocation(), std::format(\"UNSAFE create auto variabe as field {}:{}\", var_name, found_type));\n                    } else {\n                        LogError(field->getLocation(), std::format(\"Create auto variabe as field {}:{}\", var_name, found_type));\n                    }\n\n\n                } else if (field->getType()->isPointerType()) {\n\n                    // any variant of a raw pointer or address is an error\n\n                    if (is_unsafe) {\n                        LogWarning(field->getLocation(), \"UNSAFE field type raw pointer\");\n                    } else {\n                        LogError(field->getLocation(), \"Field type raw pointer\");\n                    }\n\n                }\n            }\n\n            return true;\n        }\n\n        /*\n         * \n         * RecursiveASTVisitor Traverse... template methods for the created plugin context\n         * \n         * \n         * \n         * \n         * \n         */\n\n\n#define TRAVERSE_CONTEXT( name ) \\\n        bool Traverse ## name (name * arg) { \\\n            if (isEnabledStatus()) { \\\n                m_scopes.PushScope(arg->getEndLoc(), arg); \\\n                RecursiveASTVisitor<MemSafePlugin>::Traverse ## name (arg); \\\n                m_scopes.PopScope(); \\\n            } \\\n            return true; \\\n        }\n\n\n        TRAVERSE_CONTEXT(MemberExpr);\n\n        TRAVERSE_CONTEXT(CallExpr);\n        TRAVERSE_CONTEXT(CXXMemberCallExpr);\n        TRAVERSE_CONTEXT(CXXOperatorCallExpr);\n        TRAVERSE_CONTEXT(CXXTemporaryObjectExpr);\n\n        /*\n         * Creating a plugin context for classes\n         */\n\n        bool TraverseCXXRecordDecl(CXXRecordDecl * decl) {\n\n            if (isEnabledStatus() && decl->hasDefinition()) {\n\n                if (!scaner) {\n                    m_scopes.PushScope(decl->getLocation(), decl, m_scopes.testUnsafe());\n                }\n\n                if (m_is_cyclic_analysis) {\n                    try {\n\n                        ClassListType used;\n                        ClassListType fileds;\n\n                        // Don't add the name of the class being checked the first time,\n                        // so that circular dependencies can be detected\n                        MakeUsedClasses(*decl, used, fileds);\n\n                        if (!scaner) {\n                            // If this is the first pass at creating a circular reference file, \n                            // it is not possible to analyze them now.\n                            if (!testSharedType(*decl, used)) {\n                                if (decl->hasDefinition()) {\n                                    m_not_shared_class[decl->getQualifiedNameAsString()] = {decl, decl->getLocation()};\n                                    LogOnly(decl->getLocation(), std::format(\"Class '{}' marked as not shared\", decl->getQualifiedNameAsString()));\n                                }\n                            } else {\n                                if (checkCycles(*decl, used, fileds)) {\n                                    LogOnly(decl->getLocation(), std::format(\"Class '{}' checked for cyclic references\", decl->getQualifiedNameAsString()));\n                                }\n                            }\n                        }\n\n                    } catch (...) {\n                        return false;\n                    }\n                }\n\n                RecursiveASTVisitor<MemSafePlugin>::TraverseCXXRecordDecl(decl);\n\n                if (!scaner) {\n                    m_scopes.PopScope();\n                }\n\n                return true;\n            }\n\n            return RecursiveASTVisitor<MemSafePlugin>::TraverseCXXRecordDecl(decl);\n        }\n\n        /*\n         * \n         * Creating a plugin context based on a variable type\n         *  \n         */\n\n        bool TraverseVarDecl(VarDecl * var) {\n\n            if (isEnabled()) {\n\n                bool is_unsafe = m_scopes.testUnsafe().isValid() || checkDeclUnsafe(*var);\n                const CXXRecordDecl *class_decl = var->getType()->getAsCXXRecordDecl();\n                if (class_decl) {\n                    checkTypeName(var->getLocation(), class_decl->getQualifiedNameAsString(), is_unsafe);\n                }\n\n                // The type (class) of a reference type variable depends on the data \n                // and may become invalid if the original data changes.\n\n                const DeclRefExpr * dre = nullptr;\n\n                if (Expr * init = var->getInit()) {\n                    dre = dyn_cast<DeclRefExpr>(removeTempExpr(init));\n                }\n\n                if (!dre) {\n                    dre = getInitializer(*var);\n                }\n\n\n                // The name of the variable\n                std::string var_name = var->getNameAsString();\n\n                // The type (class) of the variable that the plugin should analyze\n                const char * found_type = checkClassNameTracking(class_decl);\n\n                if (!found_type) {\n\n                    // The type (class) of the variable does not require analysis\n                    m_scopes.back().other.emplace(var_name);\n\n                    if (var->getType()->isPointerType()) {\n                        if (is_unsafe) {\n                            LogWarning(var->getLocation(), \"UNSAFE Raw address\");\n                        } else {\n                            LogError(var->getLocation(), \"Raw address\");\n                        }\n                    }\n\n                    if (var->getType()->isPointerType() || var->getType()-> isReferenceType()) {\n                        if (dre) {\n                            std::string depend_name = dre->getDecl()->getNameAsString();\n\n                            m_scopes.back().dependent.emplace(var_name, depend_name);\n                            m_scopes.back().blocker.emplace(depend_name, std::vector<SourceLocation>({dre->getLocation()}));\n\n                            LogOnly(var->getLocation(), std::format(\"{}:raw-addr=>{}\", var_name, depend_name));\n                        }\n                    }\n\n                } else if (AUTO_TYPE == found_type) {\n\n\n                    /*\n                     * SD_FullExpression \tFull-expression storage duration (for temporaries).\n                     * SD_Automatic \tAutomatic storage duration (most local variables).\n                     * \n                     * SD_Thread \tThread storage duration.\n                     * SD_Static \tStatic storage duration.\n                     * \n                     * SD_Dynamic \tDynamic storage duration. \n                     */\n                    if (var->getStorageDuration() == SD_Static) {\n                        if (is_unsafe) {\n                            LogWarning(var->getLocation(), std::format(\"UNSAFE create auto variabe as static {}:{}\", var_name, found_type));\n                        } else {\n                            LogError(var->getLocation(), std::format(\"Create auto variabe as static {}:{}\", var_name, found_type));\n                        }\n                    } else {\n                        LogOnly(var->getLocation(), std::format(\"Var found {}:{}\", var_name, found_type));\n                    }\n\n                    if (dre) {\n\n                        std::string depend_name = dre->getDecl()->getNameAsString();\n\n                        /* var_name is a reference type from the variable depend_name.\n                         * \n                         * var_name can be used until the original variable depend_name is changed\n                         * or it has a non-const method call that changes its internal state.\n                         *\n                         * The first use depend_name sets SourceLocation from the current position, \n                         * so that it is cleared in the first call to VisitDeclRefExpr.\n                         * \n                         * After that, any attempt to access var_name will result in an error.\n                         */\n\n                        m_scopes.back().dependent.emplace(var_name, depend_name);\n                        m_scopes.back().blocker.emplace(depend_name, std::vector<SourceLocation>({dre->getLocation()}));\n\n                        LogOnly(var->getLocation(), std::format(\"{}:{}=>{}\", var_name, found_type, depend_name));\n\n                    } else {\n                        LogError(var->getLocation(), std::format(\"Unknown depended type {}:{}\", var_name, found_type));\n                    }\n\n                } else {\n\n                    // The remaining types (classes) are used for safe memory management.\n                    m_scopes.AddVarDecl(var, found_type);\n\n                    LogOnly(var->getLocation(), std::format(\"Var found {}:{}\", var_name, found_type));\n                }\n            }\n\n            return RecursiveASTVisitor<MemSafePlugin>::TraverseVarDecl(var);\n        }\n\n        bool TraverseParmVarDecl(ParmVarDecl * param) {\n            if (isEnabled()) {\n                m_scopes.AddVarDecl(param, checkClassNameTracking(param->getType()->getAsCXXRecordDecl()));\n            }\n            return true;\n        }\n\n        /*\n         * Traversing statements in AST\n         */\n        bool TraverseStmt(Stmt * stmt) {\n\n            // Enabling and disabling planig is implemented via declarations, \n            // so statements are processed only after the plugin is activated.\n            if (isEnabledStatus()) {\n\n                // Check for dump AST tree\n                if (const DeclStmt * decl = dyn_cast_or_null<DeclStmt>(stmt)) {\n                    checkDumpFilter(decl->getSingleDecl());\n                }\n                printDumpIfEnabled(stmt);\n\n\n                const AttributedStmt * attrStmt = dyn_cast_or_null<AttributedStmt>(stmt);\n                const CompoundStmt * block = dyn_cast_or_null<CompoundStmt>(stmt);\n\n                if (isEnabled() && (attrStmt || block)) {\n\n\n                    m_scopes.PushScope(stmt->getEndLoc(), std::monostate(), checkUnsafeBlock(attrStmt));\n\n                    RecursiveASTVisitor<MemSafePlugin>::TraverseStmt(stmt);\n\n                    m_scopes.PopScope();\n\n                    return true;\n\n                }\n\n                // Recursive traversal of statements only when the plugin is enabled\n                RecursiveASTVisitor<MemSafePlugin>::TraverseStmt(stmt);\n            }\n\n            return true;\n        }\n\n        /*\n         * All AST analysis starts with TraverseDecl\n         * \n         */\n        bool TraverseDecl(Decl * D) {\n\n            checkDumpFilter(D);\n            checkDeclAttributes(D);\n            printDumpIfEnabled(D);\n\n            if (const FunctionDecl * func = dyn_cast_or_null<FunctionDecl>(D)) {\n\n                if (isEnabled() && func->isDefined()) {\n\n                    m_scopes.PushScope(D->getLocation(), func, m_scopes.testUnsafe());\n\n                    RecursiveASTVisitor<MemSafePlugin>::TraverseDecl(D);\n\n                    m_scopes.PopScope();\n                    return true;\n                }\n\n            }\n\n            // Enabling and disabling the plugin is implemented using declarations, \n            // so declarations are always processed.\n            RecursiveASTVisitor<MemSafePlugin>::TraverseDecl(D);\n\n            return true;\n        }\n\n    };\n\n    /*\n     * \n     * \n     * \n     * \n     */\n\n    class MemSafePluginASTConsumer : public ASTConsumer {\n    public:\n\n        void HandleTranslationUnit(ASTContext &context) override {\n\n            context.getParentMapContext().setTraversalKind(clang::TraversalKind::TK_IgnoreUnlessSpelledInSource);\n            plugin->TraverseDecl(context.getTranslationUnitDecl());\n\n            if (scaner) {\n                if (context.getDiagnostics().hasErrorOccurred()) {\n                    fs::remove(scaner->m_file_name);\n                    llvm::outs() << \"The file '\" << scaner->m_file_name << \"' was not written due to errors in the source code!\\n\";\n                } else {\n\n\n                    /* \n                     * The circular reference analysis file provides information about all classes that are defined \n                     * in the current translation unit (this means that the same class can be found in several files \n                     * (i.e. translation units) at the same time).\n                     * \n                     * For each class, all parent classes are saved and for fields, \n                     * only their types are saved if they are shared (or pointers/references)\n                     */\n\n\n                    MemSafeFile::ClassReadType classes;\n                    MemSafePlugin::ClassListType parents;\n                    MemSafePlugin::ClassListType fields;\n                    MemSafeFile::ClassRead shared;\n\n                    for (auto elem : plugin->m_shared_type) {\n                        if (const CXXRecordDecl ** cls = std::get_if<const CXXRecordDecl *>(&elem.second)) {\n                            // Keep only those classes that are defined in the current translation unit\n                            if ((*cls)->hasDefinition()) {\n\n                                parents.clear();\n                                fields.clear();\n\n                                plugin->MakeUsedClasses(**cls, parents, fields);\n\n                                shared.parents.clear();\n                                for (auto par_elem : parents) {\n                                    shared.parents[par_elem.first] = MemSafeLogger::LocToStr(par_elem.second.second, context.getSourceManager());\n                                }\n\n                                plugin->reduceSharedList(fields, false);\n\n                                shared.fields.clear();\n                                for (auto fil_elem : fields) {\n                                    shared.fields[fil_elem.first] = MemSafeLogger::LocToStr(fil_elem.second.second, context.getSourceManager());\n                                }\n\n                                shared.comment = MemSafeLogger::LocToStr((*cls)->getLocation(), context.getSourceManager());\n                                classes[(*cls)->getQualifiedNameAsString()] = shared;\n\n                            }\n                        }\n                    }\n\n                    shared.parents.clear();\n                    shared.fields.clear();\n                    for (auto elem : plugin->m_not_shared_class) {\n                        if (plugin->m_shared_type.find(elem.first) == plugin->m_shared_type.end()) {\n                            shared.comment = \"Not shared type at: \";\n                            shared.comment += MemSafeLogger::LocToStr(elem.second.second, context.getSourceManager());\n                            classes[elem.first] = shared;\n                        }\n                    }\n\n                    scaner->WriteFile(classes);\n                    llvm::outs() << \"Write file '\" << scaner->m_file_name << \"' complete!\\n\";\n                }\n            }\n\n            if (logger) {\n\n                llvm::outs().flush();\n                llvm::errs().flush();\n\n                logger->Dump(llvm::outs());\n                llvm::outs() << \"\\n\";\n                plugin->dump(llvm::outs());\n            }\n        }\n    };\n\n    /*\n     * \n     * \n     * \n     * \n     */\n\n    class MemSafePluginASTAction : public PluginASTAction {\n    public:\n\n        /* Three types of plugin execution:\n         *\n         * - In one pass for one translation unit (default).\n         * When all type definitions are in one file or strong references are not used \n         * for forward declarations of types whose definitions are in other translation units.\n         *\n         * - The first pass when processing several translation units (when the circleref-write argument is specified).\n         * Create a file of the list of shared data types without performing the actual AST analysis.\n         *\n         * - The second pass when processing several translation units (when the circleref-read argument is specified).\n         * Perform direct analysis of the program source code analysis with control of recursive references,\n         * the list of which must be in the file created during the first processing of all translation units.\n         *\n         */\n        std::string m_shared_write;\n        std::string m_shared_read;\n        bool m_shared_disabled;\n\n        std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &Compiler, StringRef InFile) override {\n\n            std::unique_ptr<MemSafePluginASTConsumer> obj = std::unique_ptr<MemSafePluginASTConsumer>(new MemSafePluginASTConsumer());\n\n            if (m_shared_disabled) {\n\n                plugin->setCyclicAnalysis(false);\n                PrintColor(llvm::outs(), \"Circular reference analysis disabled\");\n\n            } else if (!m_shared_write.empty()) {\n\n                PrintColor(llvm::outs(), \"Write the circular reference analysis data to file {}\", m_shared_write);\n                scaner = std::unique_ptr<MemSafeFile>(new MemSafeFile(m_shared_write, InFile.str()));\n\n            } else if (!m_shared_read.empty()) {\n\n                PrintColor(llvm::outs(), \"Read the circular reference analysis data from {}\", m_shared_read);\n                MemSafeFile read(m_shared_read, InFile.str());\n\n                // Read the list of classes present in other files (translation units).\n                read.ReadFile(plugin->m_classes);\n            }\n            return obj;\n        }\n\n        template <class... Args>\n        void PrintColor(raw_ostream & out, std::format_string<Args...> fmt, Args&&... args) {\n\n            out << \"\\033[1;46;34m\";\n            out << std::format(fmt, args...);\n            out << \"\\033[0m\\n\";\n        }\n\n        bool ParseArgs(const CompilerInstance &CI, const std::vector<std::string> &args) override {\n\n            m_shared_disabled = false;\n            plugin = std::unique_ptr<MemSafePlugin>(new MemSafePlugin(CI));\n\n            llvm::outs().SetUnbuffered();\n            llvm::errs().SetUnbuffered();\n\n            std::string first;\n            std::string second;\n            size_t pos;\n            for (auto &elem : args) {\n                pos = elem.find(\"=\");\n                if (pos != std::string::npos) {\n                    first = elem.substr(0, pos);\n                    second = elem.substr(pos + 1);\n                } else {\n                    first = elem;\n                    second = \"\";\n                }\n\n                std::string message = plugin->processArgs(first, second, SourceLocation());\n\n                if (!message.empty()) {\n                    if (first.compare(\"log\") == 0) {\n\n                        logger = std::unique_ptr<MemSafeLogger>(new MemSafeLogger(CI));\n                        PrintColor(llvm::outs(), \"Enable dump and process logger\");\n\n                    } else if (first.compare(\"circleref-disable\") == 0) {\n\n                        if (!m_shared_read.empty() || !m_shared_write.empty()) {\n                            llvm::errs() << \"Only one of the arguments 'circleref-read', 'circleref-write' or 'circleref-disable' is allowed!\\n\";\n                            return false;\n                        }\n                        m_shared_disabled = true;\n\n                    } else if (first.compare(\"circleref-write\") == 0) {\n\n                        if (!m_shared_read.empty() || m_shared_disabled) {\n                            llvm::errs() << \"Only one of the arguments 'circleref-read', 'circleref-write' or 'circleref-disable' is allowed!\\n\";\n                            return false;\n                        }\n\n                        m_shared_write = second.empty() ? MemSafeFile::SHARED_SCAN_FILE_DEFAULT : second;\n\n                    } else if (first.compare(\"circleref-read\") == 0) {\n\n                        if (!m_shared_write.empty() || m_shared_disabled) {\n                            llvm::errs() << \"Only one of the arguments 'circleref-read', 'circleref-write' or 'circleref-disable' is allowed!\\n\";\n                            return false;\n                        }\n\n                        m_shared_read = second.empty() ? MemSafeFile::SHARED_SCAN_FILE_DEFAULT : second;\n\n                    } else {\n                        llvm::errs() << \"Unknown plugin argument: '\" << elem << \"'!\\n\";\n                        return false;\n                    }\n                } else {\n                    if (first.compare(\"level\") == 0) {\n                        // ok\n                    } else {\n                        llvm::errs() << \"The argument '\" << elem << \"' is not supported via command line!\\n\";\n                        return false;\n                    }\n                }\n            }\n\n            return true;\n        }\n    };\n}\n\nstatic ParsedAttrInfoRegistry::Add<MemSafeAttrInfo> A(TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE), \"Memory safety plugin control attribute\");\nstatic FrontendPluginRegistry::Add<MemSafePluginASTAction> S(TO_STR(MEMSAFE_KEYWORD_ATTRIBUTE), \"Memory safety plugin\");\n\n\n"
  },
  {
    "path": "memsafe_plugin.h",
    "content": "#pragma once\n#ifndef INCLUDED_MEMSAFE_PLUGIN_H_\n#define INCLUDED_MEMSAFE_PLUGIN_H_\n\n#include <string>\n#include <vector>\n#include <algorithm>\n#include <unordered_set>\n#include <map>\n\n#include <yaml-cpp/yaml.h>\n#include <stdio.h>\n#include <filesystem>\n#include <fstream>\n#include <chrono>\n\n#include \"memsafe.h\"\n\nnamespace memsafe {\n\n    namespace fs = std::filesystem;\n\n    // Copy-Past form https://github.com/google/googletest\n\n    inline void SplitString(const ::std::string& str, char delimiter,\n            ::std::vector< ::std::string>* dest) {\n        ::std::vector< ::std::string> parsed;\n        ::std::string::size_type pos = 0;\n        while (true) {\n            const ::std::string::size_type colon = str.find(delimiter, pos);\n            if (colon == ::std::string::npos) {\n                parsed.push_back(str.substr(pos));\n                break;\n            } else {\n                parsed.push_back(str.substr(pos, colon - pos));\n                pos = colon + 1;\n            }\n        }\n        dest->swap(parsed);\n    }\n    // Returns true if and only if the wildcard pattern matches the string. Each\n    // pattern consists of regular characters, single-character wildcards (?), and\n    // multi-character wildcards (*).\n    // \n    // This function implements a linear-time string globbing algorithm based on\n    // https://research.swtch.com/glob\n\n    static bool PatternMatchesString(const std::string& name_str,\n            const char* pattern, const char* pattern_end) {\n        const char* name = name_str.c_str();\n        const char* const name_begin = name;\n        const char* const name_end = name + name_str.size();\n\n        const char* pattern_next = pattern;\n        const char* name_next = name;\n\n        while (pattern < pattern_end || name < name_end) {\n            if (pattern < pattern_end) {\n                switch (*pattern) {\n                    default: // Match an ordinary character.\n                        if (name < name_end && *name == *pattern) {\n                            ++pattern;\n                            ++name;\n                            continue;\n                        }\n                        break;\n                    case '?': // Match any single character.\n                        if (name < name_end) {\n                            ++pattern;\n                            ++name;\n                            continue;\n                        }\n                        break;\n                    case '*':\n                        // Match zero or more characters. Start by skipping over the wildcard\n                        // and matching zero characters from name. If that fails, restart and\n                        // match one more character than the last attempt.\n                        pattern_next = pattern;\n                        name_next = name + 1;\n                        ++pattern;\n                        continue;\n                }\n            }\n            // Failed to match a character. Restart if possible.\n            if (name_begin < name_next && name_next <= name_end) {\n                pattern = pattern_next;\n                name = name_next;\n                continue;\n            }\n            return false;\n        }\n        return true;\n    }\n\n    inline bool IsGlobPattern(const std::string& pattern) {\n        return std::any_of(pattern.begin(), pattern.end(),\n                [](const char c) {\n                    return c == '?' || c == '*'; });\n    }\n\n    class StringMatcher {\n    public:\n        StringMatcher() = default;\n\n        // Constructs a filter from a string of patterns separated by `:`.\n\n        explicit StringMatcher(const std::string& filter, const char separator = ';') {\n            Create(filter, separator);\n        }\n\n        void Create(const std::string& filter, const char separator = ';') {\n            Clear();\n            // By design \"\" filter matches \"\" string.\n            std::vector<std::string> all_patterns;\n            SplitString(filter, separator, &all_patterns);\n            const auto exact_match_patterns_begin = std::partition(\n                    all_patterns.begin(), all_patterns.end(), &IsGlobPattern);\n\n            glob_patterns_.reserve(exact_match_patterns_begin - all_patterns.begin());\n            std::move(all_patterns.begin(), exact_match_patterns_begin,\n                    std::inserter(glob_patterns_, glob_patterns_.begin()));\n            std::move(\n                    exact_match_patterns_begin, all_patterns.end(),\n                    std::inserter(exact_match_patterns_, exact_match_patterns_.begin()));\n        }\n\n        // Returns true if and only if name matches at least one of the patterns in\n        // the filter.\n\n        bool MatchesName(const std::string& name) const {\n            return exact_match_patterns_.count(name) > 0 ||\n                    std::any_of(glob_patterns_.begin(), glob_patterns_.end(),\n                    [&name](const std::string & pattern) {\n                        return PatternMatchesString(\n                                name, pattern.c_str(),\n                                pattern.c_str() + pattern.size());\n                    });\n        }\n\n        //        bool MatchesNameColor(std::string& name, const char *start = \"\",, const char *stop = \"\") const {\n        //            if (exact_match_patterns_.count(name)) {\n        //            } else {\n        //            }\n        //            return  ||\n        //                    std::any_of(glob_patterns_.begin(), glob_patterns_.end(),\n        //                    [&name](const std::string & pattern) {\n        //                        return PatternMatchesString(\n        //                                name, pattern.c_str(),\n        //                                pattern.c_str() + pattern.size());\n        //                    });\n        //        }\n\n        bool isEmpty() {\n            return glob_patterns_.empty() && exact_match_patterns_.empty();\n        }\n\n        void Clear() {\n            glob_patterns_.clear();\n            exact_match_patterns_.clear();\n        }\n\n        SCOPE(private) :\n        std::vector<std::string> glob_patterns_;\n        std::unordered_set<std::string> exact_match_patterns_;\n    };\n\n    std::string SeparatorRemove(const std::string_view number) {\n        std::string result(number);\n        auto removed = std::remove(result.begin(), result.end(), '\\'');\n        removed = std::remove(result.begin(), removed, '_');\n        result.erase(removed, result.end());\n        return result;\n    }\n\n    std::string SeparatorInsert(size_t number, const char sep = '\\'') {\n        std::string result = std::to_string(number);\n        size_t pos = 3;\n        while (pos < result.size()) {\n            result = result.insert(result.size() - pos, 1, sep);\n            pos += 4;\n        }\n        return result;\n    }\n\n    /* \n     * The circular reference analysis file provides information about all classes that are defined \n     * in the current translation unit (this means that the same class can be found in several files \n     * (i.e. translation units) at the same time).\n     * \n     * For each class, all parent classes are saved and for fields, \n     * only their types are saved if they are shared (or pointers/references)\n     */\n\n    class MemSafeFile {\n    public:\n\n        typedef std::map<std::string, std::string> ListType;\n\n        struct ClassRead {\n            std::string comment;\n            ListType parents;\n            ListType fields;\n        };\n        typedef std::map<std::string, ClassRead> ClassReadType;\n\n        static constexpr const char * SHARED_SCAN_FILE_DEFAULT = \"circleref.memsafe\";\n\n        static constexpr const char * TAG_NAME_MODIFIED = \"modified\";\n\n        static constexpr const char * TAG_NAME_CLASSES = \"classes\";\n        static constexpr const char * TAG_NAME_PARENTS = \"parents\";\n        static constexpr const char * TAG_NAME_FIELDS = \"fields\";\n\n        std::string m_file_name;\n        std::string m_input_file;\n\n        MemSafeFile(std::string_view file, std::string_view input) : m_file_name(file), m_input_file(input) {\n        }\n\n        static std::string & to_string(ListType &list, std::string &result) {\n            for (auto elem : list) {\n                result += elem.first;\n                result += \", \";\n            }\n            if (!list.empty()) {\n                result.resize(result.size() - 2);\n            }\n            return result;\n        }\n\n        static std::string to_string(ClassReadType &classes, std::string separator = \"\\n\") {\n            std::string result;\n            for (auto cls : classes) {\n                result += cls.first;\n                result += \" {\";\n                to_string(cls.second.parents, result);\n                result += \"} fields:{\";\n                to_string(cls.second.fields, result);\n                result += \"}\";\n                result += separator;\n            }\n            return result;\n        }\n\n        void ReadFile(ClassReadType &classes) {\n            YAML::Node file = YAML::LoadFile(m_file_name);\n            for (auto it = file.begin(); it != file.end(); it++) {\n                // Load from all translation units except the current\n                if (it->first.as<std::string>().compare(m_input_file)) {\n                    for (auto cls = it->second.begin(); cls != it->second.end(); cls++) {\n                        // Loading classes from the map\n                        if (cls->first.as<std::string>().compare(TAG_NAME_CLASSES) == 0) {\n                            for (auto name = cls->second.begin(); name != cls->second.end(); name++) {\n                                if (classes.find(name->first.as<std::string>()) == classes.end()) {\n                                    classes[name->first.as<std::string>()] = {};\n                                    //@todo Check the structure of classes written in different translation units?\n                                }\n                                for (auto inner = name->second.begin(); inner != name->second.end(); inner++) {\n                                    if (inner->first.as<std::string>().compare(TAG_NAME_PARENTS) == 0) {\n                                        for (auto parent = inner->second.begin(); parent != inner->second.end(); parent++) {\n                                            classes[name->first.as<std::string>()].parents[parent->first.as<std::string>()] = parent->second.as<std::string>();\n                                        }\n                                    } else if (inner->first.as<std::string>().compare(TAG_NAME_FIELDS) == 0) {\n                                        for (auto field = inner->second.begin(); field != inner->second.end(); field++) {\n                                            classes[name->first.as<std::string>()].fields[field->first.as<std::string>()] = field->second.as<std::string>();\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        void WriteFile(ClassReadType &classes) {\n\n            YAML::Emitter writer;\n            write_help(writer);\n\n            writer << YAML::DoubleQuoted;\n            writer << YAML::BeginMap;\n\n            std::string input_modified;\n            try {\n                input_modified = std::format(\"{}\", fs::last_write_time(m_input_file));\n            } catch (std::exception &ex) {\n                input_modified = ex.what();\n            }\n\n\n            if (fs::exists(fs::path(m_file_name))) {\n                YAML::Node old = YAML::LoadFile(m_file_name);\n\n                for (auto it = old.begin(); it != old.end(); it++) {\n\n                    // File names at the top level of the map\n                    if (it->first.as<std::string>().compare(m_input_file)) {\n                        // Copy all except current file name\n                        writer << YAML::Key << it->first.as<std::string>();\n                        writer << YAML::Value << it->second;\n                        writer << YAML::Newline;\n                        writer << YAML::Newline;\n                    }\n\n                }\n\n                fs::path old_name(m_file_name);\n                old_name += \".bak\";\n                fs::rename(fs::path(m_file_name), old_name);\n            }\n\n            {\n                writer << YAML::Key << m_input_file;\n                writer << YAML::Value;\n\n                writer << YAML::BeginMap;\n                {\n                    writer << YAML::Key << TAG_NAME_MODIFIED;\n                    writer << YAML::Value << input_modified;\n\n                    writer << YAML::Key << TAG_NAME_CLASSES;\n                    writer << YAML::Value;\n\n                    writer << YAML::BeginMap;\n                    for (auto &cls : classes) {\n                        writer << YAML::Key << cls.first;\n                        writer << YAML::Value;\n\n                        writer << YAML::Comment(cls.second.comment);\n\n                        writer << YAML::BeginMap;\n                        writer << YAML::Key << TAG_NAME_PARENTS;\n                        writer << YAML::Value;\n                        {\n                            writer << YAML::BeginMap;\n                            for (auto &elem : cls.second.parents) {\n                                writer << YAML::Key << elem.first;\n                                writer << YAML::Value << elem.second;\n                            }\n                            writer << YAML::EndMap;\n                        }\n                        writer << YAML::Key << TAG_NAME_FIELDS;\n                        writer << YAML::Value;\n                        {\n                            writer << YAML::BeginMap;\n                            for (auto &elem : cls.second.fields) {\n                                writer << YAML::Key << elem.first;\n                                writer << YAML::Value << elem.second;\n                            }\n                            writer << YAML::EndMap;\n                        }\n                        writer << YAML::EndMap;\n\n                    }\n                    writer << YAML::EndMap;\n                }\n                writer << YAML::EndMap;\n            }\n            writer << YAML::EndMap;\n            writer << YAML::Newline;\n\n            std::ofstream file(m_file_name);\n            file << writer.c_str();\n            file.close();\n        }\n\n    protected:\n\n        void write_help(YAML::Emitter & emit) {\n\n            emit << YAML::Comment(\"\") << YAML::Newline;\n            emit << YAML::Comment(\"This file is created automatically for circular reference analysis\") << YAML::Newline;\n            emit << YAML::Comment(\"by the memsafe plugin https://github.com/rsashka/memsafe \") << YAML::Newline;\n            emit << YAML::Comment(\"when the C++ compiler uses multiple translation units.\") << YAML::Newline;\n\n            emit << YAML::Comment(\"\") << YAML::Newline;\n            emit << YAML::Comment(\"-------------------------------------------------------\") << YAML::Newline;\n            emit << YAML::Comment(\"\") << YAML::Newline;\n\n            emit << YAML::Comment(\"Since C++ compiles files separately, and the class (data structure)\") << YAML::Newline;\n            emit << YAML::Comment(\"definition may be in another translation unit due to a forward declaration,\") << YAML::Newline;\n            emit << YAML::Comment(\"two passes are required for the cyclic reference analyzer to work correctly.\") << YAML::Newline;\n            emit << YAML::Comment(\"\") << YAML::Newline;\n            emit << YAML::Comment(\"During the first pass, the plugin analyzes the file only for strong references\") << YAML::Newline;\n            emit << YAML::Comment(\"in all base classes whose definition is present during the AST analysis.\") << YAML::Newline;\n            emit << YAML::Comment(\"\") << YAML::Newline;\n            emit << YAML::Comment(\"All results of the first analyzer pass are collected in one file\") << YAML::Newline;\n            emit << YAML::Comment(\"each in its own section individually for each translation unit.\") << YAML::Newline;\n            emit << YAML::Comment(\"This section contains a list of analyzed classes with a list of reference data types.\") << YAML::Newline;\n            emit << YAML::Comment(\"(a list of class definitions that were found during the AST analysis).\") << YAML::Newline;\n            emit << YAML::Comment(\"\") << YAML::Newline;\n            emit << YAML::Comment(\"During the second pass, the analyzer loads one file and forms from it\") << YAML::Newline;\n            emit << YAML::Comment(\"a list of classes, each with its own list of reference data types\") << YAML::Newline;\n            emit << YAML::Comment(\"(it must be complete after the first pass is completed for all translation units).\") << YAML::Newline;\n\n            emit << YAML::Comment(\"\") << YAML::Newline;\n            emit << YAML::Comment(\"-------------------------------------------------------\") << YAML::Newline;\n            emit << YAML::Comment(\"\") << YAML::Newline;\n        }\n    };\n}\n#endif // INCLUDED_MEMSAFE_PLUGIN_H_\n"
  },
  {
    "path": "memsafe_test.cpp",
    "content": "#ifdef BUILD_UNITTEST\n\n#include <gtest/gtest.h>\n\n#include <iostream>\n#include <fstream>\n#include <sstream>\n#include <filesystem>\n#include <chrono>\n\n#include \"memsafe.h\"\n#include \"memsafe_plugin.h\"\n\nusing namespace memsafe;\nusing namespace std::chrono_literals;\nnamespace fs = std::filesystem;\n\nTEST(MemSafe, Sizes) {\n\n    EXPECT_EQ(32, sizeof (std::string));\n    EXPECT_EQ(32, sizeof (std::wstring));\n    EXPECT_EQ(40, sizeof (std::variant<std::string>));\n    EXPECT_EQ(40, sizeof (std::variant<std::string, std::wstring>));\n\n    EXPECT_EQ(16, sizeof (std::runtime_error));\n    EXPECT_EQ(16, sizeof (memsafe_error));\n\n    class TestClassV0 {\n\n        void func() {\n        }\n    };\n\n    class TestClassV1 {\n\n        virtual void func() {\n        }\n    };\n\n    class TestClassV2 {\n\n        virtual void func1() {\n        }\n\n        virtual void func2() {\n        }\n    };\n\n    class TestClassV3 {\n\n        TestClassV3() {\n        }\n\n        virtual void func1() {\n        }\n\n        virtual void func2() {\n        }\n\n        virtual TestClassV3 & operator=(TestClassV3 &) = 0;\n\n        virtual ~TestClassV3() {\n        }\n    };\n\n    class TestClass1 : std::shared_ptr<int> {\n    };\n\n    class TestClass2 : std::shared_ptr<int>, std::enable_shared_from_this<TestClass2> {\n    };\n\n    class TestClass3 : std::enable_shared_from_this<TestClass3> {\n        int value;\n    };\n\n    class TestClass4 : std::enable_shared_from_this<TestClass4> {\n    };\n\n\n    EXPECT_EQ(1, sizeof (TestClassV0));\n    EXPECT_EQ(8, sizeof (TestClassV1));\n    EXPECT_EQ(8, sizeof (TestClassV2));\n    EXPECT_EQ(8, sizeof (TestClassV3));\n\n    EXPECT_EQ(16, sizeof (TestClass1));\n    EXPECT_EQ(32, sizeof (TestClass2));\n    EXPECT_EQ(4, sizeof (int));\n    EXPECT_EQ(24, sizeof (TestClass3));\n    EXPECT_EQ(16, sizeof (TestClass4));\n\n\n    EXPECT_EQ(16, sizeof (Sync<int>));\n    EXPECT_EQ(24, sizeof (SyncSingleThread<int>));\n    EXPECT_EQ(56, sizeof (SyncTimedMutex<int>));\n    EXPECT_EQ(72, sizeof (SyncTimedShared<int>));\n\n    EXPECT_EQ(16, sizeof (Sync<uint8_t>));\n    EXPECT_EQ(24, sizeof (SyncSingleThread<uint8_t>));\n    EXPECT_EQ(56, sizeof (SyncTimedMutex<uint8_t>));\n    EXPECT_EQ(72, sizeof (SyncTimedShared<uint8_t>));\n\n    EXPECT_EQ(24, sizeof (Sync<uint64_t>));\n    EXPECT_EQ(32, sizeof (SyncSingleThread<uint64_t>));\n    EXPECT_EQ(64, sizeof (SyncTimedMutex<uint64_t>));\n    EXPECT_EQ(80, sizeof (SyncTimedShared<uint64_t>));\n\n    EXPECT_EQ(99, sizeof (std::array<uint8_t, 99 >));\n    EXPECT_EQ(100, sizeof (std::array<uint8_t, 100 >));\n    EXPECT_EQ(101, sizeof (std::array<uint8_t, 101 >));\n\n    EXPECT_EQ(112, sizeof (Sync<std::array<uint8_t, 100 >>));\n    EXPECT_EQ(120, sizeof (SyncSingleThread<std::array<uint8_t, 100 >>));\n    EXPECT_EQ(152, sizeof (SyncTimedMutex<std::array <uint8_t, 100 >>));\n    EXPECT_EQ(168, sizeof (SyncTimedShared<std::array<uint8_t, 100 >>));\n\n    EXPECT_EQ(101, sizeof (std::array<uint8_t, 101 >));\n    EXPECT_EQ(112, sizeof (Sync<std::array<uint8_t, 101 >>));\n    EXPECT_EQ(120, sizeof (SyncSingleThread<std::array<uint8_t, 101 >>));\n    EXPECT_EQ(152, sizeof (SyncTimedMutex<std::array <uint8_t, 101 >>));\n    EXPECT_EQ(168, sizeof (SyncTimedShared<std::array<uint8_t, 101 >>));\n\n\n    EXPECT_EQ(16, sizeof (Shared<int>));\n    EXPECT_EQ(16, sizeof (Shared<int, SyncSingleThread>));\n    EXPECT_EQ(16, sizeof (Shared<int, SyncTimedMutex>));\n    EXPECT_EQ(16, sizeof (Shared<int, SyncTimedShared>));\n\n    EXPECT_EQ(16, sizeof (Shared<uint8_t>));\n    EXPECT_EQ(16, sizeof (Shared<uint8_t, SyncSingleThread>));\n    EXPECT_EQ(16, sizeof (Shared<uint8_t, SyncTimedMutex>));\n    EXPECT_EQ(16, sizeof (Shared<uint8_t, SyncTimedShared>));\n\n    EXPECT_EQ(16, sizeof (Shared<uint8_t>));\n    EXPECT_EQ(16, sizeof (Shared<uint8_t, SyncSingleThread>));\n    EXPECT_EQ(16, sizeof (Shared<uint8_t, SyncTimedMutex>));\n    EXPECT_EQ(16, sizeof (Shared<uint8_t, SyncTimedShared>));\n\n    EXPECT_EQ(16, sizeof (Weak<Shared<int>>));\n    EXPECT_EQ(16, sizeof (Weak<Shared<int, SyncSingleThread>>));\n    EXPECT_EQ(16, sizeof (Weak<Shared<int, SyncTimedMutex>>));\n    EXPECT_EQ(16, sizeof (Weak<Shared<int, SyncTimedShared>>));\n\n    EXPECT_EQ(16, sizeof (Locker<int, Shared<int>>));\n    EXPECT_EQ(16, sizeof (Locker<int, Shared<int, SyncSingleThread>>));\n    EXPECT_EQ(16, sizeof (Locker<int, Shared<int, SyncTimedMutex>>));\n    EXPECT_EQ(16, sizeof (Locker<int, Shared<int, SyncTimedShared>>));\n\n    EXPECT_EQ(8, sizeof (Locker<int, int&>));\n    EXPECT_EQ(8, sizeof (Locker<uint8_t, uint8_t&>));\n    EXPECT_EQ(8, sizeof (Locker<uint16_t, uint16_t&>));\n    EXPECT_EQ(8, sizeof (Locker<uint32_t, uint32_t&>));\n    EXPECT_EQ(8, sizeof (Locker<uint64_t, uint64_t&>));\n}\n\nTEST(MemSafe, Cast) {\n\n    EXPECT_EQ(1, sizeof (bool));\n    EXPECT_EQ(1, sizeof (Value<bool>));\n    EXPECT_EQ(4, sizeof (int32_t));\n    EXPECT_EQ(4, sizeof (Value<int32_t>));\n    EXPECT_EQ(8, sizeof (int64_t));\n    EXPECT_EQ(8, sizeof (Value<int64_t>));\n\n    Value<int> value_int(0);\n    int & take_value = *value_int;\n    Locker<int, int&> take_value2 = value_int.lock();\n\n    Shared<int> shared_int(0);\n\n    //    Auto<int, Shared<int>> take_shared = *shared_int;\n    Locker<int, Shared<int>::SharedType> take_shared1 = shared_int.lock();\n    //    int & take_shared1 = *shared_int;\n\n    ASSERT_EQ(0, *take_shared1);\n    ASSERT_EQ(0, *shared_int.lock());\n    //    ASSERT_EQ(0, **shared_int);\n    *shared_int.lock() = 11;\n    //    **shared_int = 11;\n    //    ASSERT_EQ(11, **shared_int);\n    ASSERT_EQ(11, *shared_int.lock());\n\n    auto var_take_shared = shared_int.lock();\n    int & take_shared2 = *var_take_shared;\n\n\n    Shared<int, SyncSingleThread> sync_int(22);\n    Locker<int, Shared<int, SyncSingleThread>::SharedType> take_sync_int = sync_int.lock();\n    auto auto_sync_int = sync_int.lock();\n    //    auto auto_sync_int = *sync_int;\n\n    ASSERT_EQ(22, *sync_int.lock());\n    //    ASSERT_EQ(22, **sync_int);\n\n    *auto_sync_int = 33;\n    ASSERT_EQ(33, *auto_sync_int);\n    ASSERT_EQ(33, *sync_int.lock());\n    //    ASSERT_EQ(33, **sync_int);\n\n    int temp_sync = *sync_int.lock();\n    *sync_int.lock() = 44;\n    //    **sync_int = 44;\n\n    ASSERT_EQ(33, temp_sync);\n    ASSERT_EQ(44, *auto_sync_int);\n    //    ASSERT_EQ(44, **sync_int);\n    ASSERT_EQ(44, *sync_int.lock());\n\n\n    auto weak_shared(shared_int.weak());\n    Weak<Shared<int>> weak_shared1(shared_int.weak());\n    Weak<Shared<int>> weak_shared2 = weak_shared1;\n    auto weak_shared3 = shared_int.weak();\n\n    Weak<Shared<int>> weak_shared4 = shared_int.weak();\n\n\n    ASSERT_EQ(3, sync_int.use_count()) << sync_int.use_count();\n    ASSERT_NO_THROW(sync_int.weak());\n    Weak<Shared<int, SyncSingleThread>> weak_sync1 = sync_int.weak();\n    //\n    //    //    std::cout << \"weak_guard1: \" << guard_int.shared_this.use_count() << \"\\n\";\n    //\n    auto weak_sync2(sync_int.weak());\n    //\n    //    //    std::cout << \"weak_guard2: \" << guard_int.shared_this.use_count() << \"\\n\";\n    //\n    auto weak_sync3 = sync_int.weak();\n\n    //    std::cout << \"weak_guard3: \" << guard_int.shared_this.use_count() << \"\\n\";\n\n\n    //template <typename V, typename T = V, typename W = std::weak_ptr<T>> class VarWeak;\n    //    ASSERT_NO_THROW(**weak_shared1);\n    ASSERT_NO_THROW(*weak_shared1.lock());\n\n    Locker<int, Shared<int>::SharedType> auto_shared(weak_shared1.lock());\n    ASSERT_EQ(3, sync_int.use_count());\n\n    //    auto auto_guard1(weak_guard1.take());\n\n    //    ASSERT_NO_THROW(**sync_int);\n    ASSERT_NO_THROW(*sync_int.lock());\n    {\n        auto taken = sync_int.lock();\n    }\n\n    //    VarAuto<int, VarGuard<int, VarGuardData<int>>> auto_guard2(weak_guard1.take());\n    //    std::cout << \"auto_guard: \" << guard_int.shared_this.use_count() << \"\\n\";\n\n    //    int & take_weak_shared = *auto_shared;\n    //    int & take_weak_guard = *auto_guard;\n\n}\n\n#pragma clang attribute push\n#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n\nclass TestClass1 {\npublic:\n\n    Class<TestClass1> field;\n    Class<TestClass1> field_2;\n\n    Shared<TestClass1> m_shared;\n    Shared<TestClass1, SyncSingleThread> m_single;\n    Shared<TestClass1, SyncTimedMutex> m_mutex;\n    Shared<TestClass1, SyncTimedShared> m_recursive;\n\n    TestClass1() : field(*this, this->field), field_2(*this, this->field_2) {\n    }\n};\n\n#pragma clang attribute pop\n\nTEST(MemSafe, Class) {\n\n    TestClass1 cls;\n\n\n    // Ignore warning only for unit test from field Shared<TestClass1>\n#pragma clang attribute push\n#pragma clang diagnostic ignored \"-Winvalid-offsetof\"\n\n    ASSERT_EQ(0, offsetof(TestClass1, field));\n    ASSERT_NE(0, offsetof(TestClass1, field_2));\n\n    ASSERT_EQ((size_t) cls.field.m_instance, (size_t) & cls);\n    ASSERT_EQ((size_t) cls.field.m_offset, offsetof(TestClass1, field)) << offsetof(TestClass1, field);\n\n    ASSERT_EQ((size_t) cls.field_2.m_instance, (size_t) & cls);\n    ASSERT_EQ(cls.field_2.m_offset, offsetof(TestClass1, field_2)) << offsetof(TestClass1, field_2);\n\n#pragma clang attribute pop\n\n\n    ASSERT_FALSE(cls.field.m_field.get());\n    cls.field = new TestClass1();\n    ASSERT_TRUE(cls.field.m_field.get());\n\n    ASSERT_FALSE((*cls.field).field.m_field.get());\n    ASSERT_ANY_THROW(\n            (*cls.field).field = cls.field; // circular reference\n            );\n    ASSERT_TRUE(cls.field.m_field.get());\n\n    ASSERT_FALSE((*cls.field).field.m_field.get());\n    ASSERT_ANY_THROW(\n            (*cls.field).field = cls.field.m_field.get(); // circular reference\n            );\n    ASSERT_TRUE(cls.field.m_field.get());\n\n    ASSERT_FALSE(cls.field_2.m_field.get());\n    ASSERT_ANY_THROW(\n            cls.field_2 = cls.field; // Copy of another field\n            );\n    ASSERT_FALSE(cls.field_2.m_field.get());\n\n};\n\nTEST(MemSafe, Threads) {\n\n    {\n        unsigned long long g_count = 0;\n        std::thread t1([&]() {\n            for (auto i = 0; i < 1'000'000; ++i)\n                ++g_count;\n        });\n        std::thread t2([&]() {\n            for (auto i = 0; i < 1'000'000; ++i)\n                ++g_count;\n        });\n        t1.join();\n        t2.join();\n\n        EXPECT_NE(2'000'000, g_count);\n    }\n\n    {\n        std::atomic<unsigned long long> a_count{ 0};\n        std::thread t3([&]() {\n            for (auto i = 0; i < 1'000'000; ++i)\n                a_count.fetch_add(1);\n        });\n\n        std::thread t4([&]() {\n            for (auto i = 0; i < 1'000'000; ++i)\n                a_count.fetch_add(1);\n        });\n\n        t3.join();\n        t4.join();\n\n        EXPECT_EQ(2'000'000, a_count);\n    }\n\n    {\n        memsafe::Shared<int, SyncSingleThread> var_single(0);\n        bool catched = false;\n\n        std::thread other([&]() {\n            try {\n                var_single.lock();\n            } catch (...) {\n                catched = true;\n            }\n\n        });\n        other.join();\n\n        ASSERT_TRUE(catched);\n    }\n\n    {\n        memsafe::Shared<int, SyncTimedMutex> var_mutex(0);\n        bool catched = false;\n\n        std::chrono::duration<double, std::milli> elapsed;\n\n        std::thread other([&]() {\n            try {\n\n                const auto start = std::chrono::high_resolution_clock::now();\n                std::this_thread::sleep_for(100ms);\n                elapsed = std::chrono::high_resolution_clock::now() - start;\n                var_mutex.lock();\n            } catch (...) {\n                catched = true;\n            }\n\n        });\n        ASSERT_TRUE(other.joinable());\n        other.join();\n\n        ASSERT_TRUE(elapsed <= 200.0ms);\n\n        ASSERT_FALSE(catched);\n    }\n\n    {\n        memsafe::Shared<int, SyncTimedShared> var_recursive(0);\n        bool not_catched = true;\n\n        std::thread read([&]() {\n            try {\n                auto a1 = var_recursive.lock_const();\n                auto a2 = var_recursive.lock_const();\n                auto a3 = var_recursive.lock_const();\n            } catch (...) {\n                not_catched = false;\n            }\n\n        });\n        read.join();\n\n        ASSERT_TRUE(not_catched);\n\n        std::thread write([&]() {\n            try {\n                auto a1 = var_recursive.lock();\n                auto a2 = var_recursive.lock();\n                auto a3 = var_recursive.lock();\n            } catch (...) {\n                not_catched = false;\n            }\n\n        });\n        write.join();\n\n        ASSERT_FALSE(not_catched);\n\n    }\n\n}\n\nTEST(MemSafe, Depend) {\n    {\n        std::vector<int> vect(100000, 0);\n        auto b = vect.begin();\n        auto e = vect.end();\n\n        EXPECT_EQ(8, sizeof (b));\n        EXPECT_EQ(8, sizeof (e));\n\n        vect = {};\n        //        vect.shrink_to_fit();\n        std::sort(b, e);\n\n    }\n    {\n        std::vector<int> vect(100000, 0);\n\n        auto b = LazyCaller<decltype(vect), decltype(std::declval<decltype(vect)>().begin())>(vect, &decltype(vect)::begin);\n        auto e = LAZYCALL(vect, end);\n        auto c = LAZYCALL(vect, clear);\n        auto s = LAZYCALL(vect, size);\n\n        EXPECT_EQ(32, sizeof (b));\n        EXPECT_EQ(32, sizeof (e));\n\n        ASSERT_EQ(100000, vect.size());\n        ASSERT_EQ(100000, *s);\n\n        *c;\n\n        ASSERT_EQ(0, vect.size());\n        ASSERT_EQ(0, *s);\n\n        // std::vector<int> data(1, 1);\n        // auto reserve = LAZYCALL(vect, reserve, 10UL);\n        // *reserve;\n        //\n        // auto db = LAZYCALL(data, begin);\n        // auto de = LAZYCALL(data, end);\n        //\n        // ASSERT_EQ(1, data[0]);\n        // // @todo variadic tempalte as variadic template argument\n        // auto call = LAZYCALL(vect, assign, db, de);\n\n        // data.clear();\n        // data.shrink_to_fit();\n        // *call;\n\n        // ASSERT_EQ(1, vect.size());\n        // ASSERT_EQ(1, *s);\n        //\n        // ASSERT_EQ(1, data[0]);\n        // ASSERT_EQ(1, vect[0]);\n\n        vect.shrink_to_fit();\n        std::sort(*b, *e);\n    }\n}\n\nTEST(MemSafe, ApplyAttr) {\n\n    memsafe::Value<int> var_value(1);\n    static memsafe::Value<int> var_static(1);\n\n    var_static = var_value;\n    {\n        var_static = var_value;\n        {\n            var_static = var_value;\n        }\n    }\n\n    memsafe::Shared<int> var_shared1(0);\n    memsafe::Shared<int> var_shared2(1);\n\n    ASSERT_TRUE(var_shared1);\n    ASSERT_TRUE(var_shared2);\n\n    var_shared1 = var_shared2;\n    {\n        var_shared1 = var_shared2;\n        {\n            var_shared1 = var_shared2;\n        }\n    }\n\n    memsafe::Shared<int, SyncSingleThread> var_none(1);\n    ASSERT_TRUE(var_none);\n\n    memsafe::Shared<int, SyncTimedMutex> var_mutex(1);\n    ASSERT_TRUE(var_mutex);\n\n    memsafe::Shared<int, SyncTimedShared> var_shared(1);\n    ASSERT_TRUE(var_shared);\n\n}\n\nTEST(MemSafe, Separartor) {\n    ASSERT_STREQ(\"\", SeparatorRemove(\"\").c_str());\n    ASSERT_STREQ(\"0\", SeparatorRemove(\"0\").c_str());\n    ASSERT_STREQ(\"00\", SeparatorRemove(\"0'0\").c_str());\n    ASSERT_STREQ(\"0000\", SeparatorRemove(\"0000\").c_str());\n    ASSERT_STREQ(\"000000\", SeparatorRemove(\"0_00_000\").c_str());\n    ASSERT_STREQ(\"00000000\", SeparatorRemove(\"0'0'0'0'0'0'0'0\").c_str());\n\n    EXPECT_STREQ(\"0\", SeparatorInsert(0).c_str());\n    EXPECT_STREQ(\"1\", SeparatorInsert(1).c_str());\n    EXPECT_STREQ(\"111\", SeparatorInsert(111).c_str());\n    EXPECT_STREQ(\"1'111\", SeparatorInsert(1'111).c_str());\n    EXPECT_STREQ(\"11'111\", SeparatorInsert(11'111).c_str());\n    EXPECT_STREQ(\"111'111\", SeparatorInsert(111'111).c_str());\n    EXPECT_STREQ(\"111_111_111_111\", SeparatorInsert(111'111'111'111, '_').c_str());\n}\n\nTEST(MemSafe, MemSafeFile) {\n\n    std::string filename = \"unittest-circleref.memsafe\";\n\n    fs::remove(filename);\n    ASSERT_FALSE(fs::exists(filename));\n\n    MemSafeFile::ClassReadType classes;\n\n    {\n        MemSafeFile file(filename, \"file_empty.cpp\");\n\n        file.WriteFile(classes);\n\n        ASSERT_TRUE(fs::exists(filename));\n        MemSafeFile::ClassReadType readed;\n        ASSERT_NO_THROW(file.ReadFile(readed));\n        ASSERT_TRUE(readed.empty());\n    }\n    {\n        MemSafeFile file(filename, \"file1.cpp\");\n\n        classes[\"class0\"] = {};\n\n        classes[\"class1\"].parents = {\n            {\n                \"ns::class1\", \"filepos:1\"\n            },\n            {\n                \"ns::class2\", \"filepos:2\"\n            },\n        };\n        classes[\"class1\"].fields = {\n            {\n                \"ns::field1\", \"filepos:1\"\n            },\n            {\n                \"ns::field2\", \"filepos:2\"\n            },\n        };\n\n        file.WriteFile(classes);\n\n        ASSERT_TRUE(fs::exists(filename));\n\n        {\n            MemSafeFile file(filename, \"file_read.cpp\");\n\n            MemSafeFile::ClassReadType readed;\n\n            ASSERT_NO_THROW(file.ReadFile(readed));\n\n            ASSERT_EQ(2, readed.size());\n            ASSERT_EQ(0, readed[\"class0\"].parents.size());\n            ASSERT_EQ(0, readed[\"class0\"].fields.size());\n            ASSERT_EQ(2, readed[\"class1\"].parents.size());\n            ASSERT_EQ(2, readed[\"class1\"].fields.size());\n\n            ASSERT_STREQ(\"filepos:1\", readed[\"class1\"].parents[\"ns::class1\"].c_str());\n            ASSERT_STREQ(\"filepos:2\", readed[\"class1\"].parents[\"ns::class2\"].c_str());\n            ASSERT_STREQ(\"filepos:1\", readed[\"class1\"].fields[\"ns::field1\"].c_str());\n            ASSERT_STREQ(\"filepos:2\", readed[\"class1\"].fields[\"ns::field2\"].c_str());\n        }\n    }\n    {\n        MemSafeFile file(filename, \"file2.cpp\");\n\n        ASSERT_TRUE(fs::exists(filename));\n\n\n        classes.erase(classes.find(\"class0\"));\n\n        classes[\"class1\"].parents = {\n            {\n                \"ns::class1\", \"filepos:111\"\n            },\n            {\n                \"ns::class2\", \"filepos:222\"\n            },\n        };\n        classes[\"class1\"].fields = {\n            {\n                \"ns::field1\", \"filepos:111\"\n            },\n            {\n                \"ns::field2\", \"filepos:222\"\n            },\n        };\n\n\n        file.WriteFile(classes);\n\n        ASSERT_TRUE(fs::exists(filename));\n\n        MemSafeFile::ClassReadType readed;\n\n        ASSERT_NO_THROW(file.ReadFile(readed));\n\n        ASSERT_EQ(2, readed.size());\n        ASSERT_EQ(0, readed[\"class0\"].parents.size());\n        ASSERT_EQ(0, readed[\"class0\"].fields.size());\n        ASSERT_EQ(2, readed[\"class1\"].parents.size());\n        ASSERT_EQ(2, readed[\"class1\"].fields.size());\n\n        ASSERT_STREQ(\"filepos:1\", readed[\"class1\"].parents[\"ns::class1\"].c_str());\n        ASSERT_STREQ(\"filepos:2\", readed[\"class1\"].parents[\"ns::class2\"].c_str());\n        ASSERT_STREQ(\"filepos:1\", readed[\"class1\"].fields[\"ns::field1\"].c_str());\n        ASSERT_STREQ(\"filepos:2\", readed[\"class1\"].fields[\"ns::field2\"].c_str());\n    }\n    fs::remove(filename);\n    filename += \".bak\";\n    fs::remove(filename);\n}\n\nTEST(MemSafe, WeakList) {\n\n    LinkedWeakList<int> int_list;\n\n    ASSERT_TRUE(int_list.empty());\n    ASSERT_STREQ(\"nullptr\", int_list.to_string().c_str()) << int_list.to_string();\n    ASSERT_EQ(0, int_list.size());\n    int_list.push_back(1);\n    ASSERT_STREQ(\"1 -> \", int_list.to_string().c_str()) << int_list.to_string();\n    ASSERT_EQ(1, int_list.size());\n    int_list.push_back(2);\n    ASSERT_STREQ(\"1 -> 2 -> \", int_list.to_string().c_str()) << int_list.to_string();\n    ASSERT_EQ(2, int_list.size());\n    int_list.push_back(3);\n    ASSERT_STREQ(\"1 -> 2 -> 3 -> \", int_list.to_string().c_str()) << int_list.to_string();\n    ASSERT_EQ(3, int_list.size());\n    int_list.push_front(0);\n    int_list.push_front(0);\n    ASSERT_STREQ(\"0 -> 0 -> 1 -> 2 -> 3 -> \", int_list.to_string().c_str()) << int_list.to_string();\n    ASSERT_EQ(5, int_list.size());\n    int_list.pop_front();\n    ASSERT_STREQ(\"0 -> 1 -> 2 -> 3 -> \", int_list.to_string().c_str()) << int_list.to_string();\n    ASSERT_EQ(4, int_list.size());\n    int_list.pop_back();\n    ASSERT_STREQ(\"0 -> 1 -> 2 -> \", int_list.to_string().c_str()) << int_list.to_string();\n    ASSERT_EQ(3, int_list.size());\n    ASSERT_FALSE(int_list.empty());\n}\n\nTEST(MemSafe, Plugin) {\n\n    // Example of running a plugin to compile a file\n\n    /* The plugin operation is checked as follows.\n     * A specific file with examples of template usage from the metsafe/ file is compiled\n     * The example file contains correct C++ code, \n     * but the variables in it are used both correctly and with violations of the rules.\n     * \n     * When compiling a file with an analyzer plugin, the debug output is written to a file.\n     * This file is read in the test and debug messages of the plugin \n     * are searched for in it (both successful and unsuccessful checks).\n     * \n     * If all check messages are found, the test is considered successful.\n     */\n\n    std::string cmd = \"clang-20\";\n    cmd += \" -std=c++20 -ferror-limit=500 \";\n    cmd += \" -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe \";\n    cmd += \" -Xclang -plugin-arg-memsafe -Xclang log \";\n    cmd += \" -Xclang -plugin-arg-memsafe -Xclang circleref-disable\";\n    cmd += \" -c _example.cpp > _example.cpp.log\";\n\n    const char * file_log = \"_example.cpp.log\";\n    fs::remove(file_log);\n\n    int err = std::system(cmd.c_str());\n\n    ASSERT_TRUE(fs::exists(file_log));\n    std::ifstream log_file(file_log);\n\n    ASSERT_TRUE(log_file.is_open());\n\n    std::stringstream log_buffer;\n    log_buffer << log_file.rdbuf();\n\n    std::string log_output = log_buffer.str();\n    log_file.close();\n\n\n    ASSERT_TRUE(!log_output.empty());\n\n    ASSERT_TRUE(log_output.find(\"Enable dump and process logger\") != std::string::npos &&\n            log_output.find(\"unprocessed attribute!\") == std::string::npos)\n            << log_output;\n\n\n    std::vector<std::string> diag({\n        \"#log #201\",\n        \"#log #201\",\n        \"#log #202\",\n        \"#log #202\",\n        \"#log #202\",\n        \"#err #204\",\n        \"#err #204\",\n        \"#log #207\",\n        \"#log #207\",\n        \"#log #208\",\n        \"#err #209\",\n        \"#log #209\",\n        \"#warn #208\",\n        \"#err #209\",\n        \"#log #301\",\n        \"#log #302\",\n        \"#warn #301\",\n        \"#warn #302\",\n        \"#err #303\",\n        \"#log #303\",\n        \"#log #401\",\n        \"#log #402\",\n        \"#log #901\",\n        \"#log #903\",\n        \"#log #1001\",\n        \"#log #1002\",\n        \"#log #1003\",\n        \"#log #2003\",\n        \"#log #2004\",\n        \"#err #3002\",\n        \"#log #3002\",\n        \"#err #3003\",\n        \"#log #3003\",\n        \"#log #3003\",\n        \"#log #4101\",\n        \"#log #4103\",\n        \"#log #4105\",\n        \"#log #4201\",\n        \"#log #4202\",\n        \"#log #4302\",\n        \"#log #4401\",\n        \"#log #4501\",\n        \"#log #4513\",\n        \"#log #4603\",\n        \"#err #7003\",\n        \"#log #7003\",\n        \"#log #7004\",\n        \"#log #7005\",\n        \"#log #7009\",\n\n        //bugfix_11()\n        \"#log #900011002\",\n        \"#log #900011002\",\n        \"#log #900011003\",\n        \"#warn #900011003\",\n        \"#err #900011004\",\n        \"#log #900011004\",\n\n        //bugfix_12()\n        \"#log #900012002\",\n        \"#log #900012003\",\n        \"#warn #900012003\",\n        \"#err #900012004\",\n    });\n\n    size_t pos = log_output.find(MEMSAFE_KEYWORD_START_LOG);\n    ASSERT_TRUE(pos != std::string::npos);\n    std::string log_str = log_output.substr(pos + strlen(MEMSAFE_KEYWORD_START_LOG), log_output.find(\"\\n\\n\", pos + strlen(MEMSAFE_KEYWORD_START_LOG)) - pos - strlen(MEMSAFE_KEYWORD_START_LOG));\n\n    //    std::cout << \"\\n\" << log_str << \"\\n\\n\";\n\n    std::vector< std::string> log;\n    SplitString(log_str, '\\n', &log);\n\n    ASSERT_TRUE(log.size()) << log_str;\n\n    while (!log.empty() && !diag.empty()) {\n\n        if (log.front().find(diag.front()) != std::string::npos) {\n            log.erase(log.begin());\n            diag.erase(diag.begin());\n        } else {\n\n            ASSERT_TRUE(diag.front().find(\" #\") != std::string::npos) << diag.front();\n\n            size_t diag_line = atoi(diag.front().data() + diag.front().find(\" #\") + 2);\n            ASSERT_TRUE(diag_line) << diag.front();\n\n            size_t skip = log.front().find(\" #\");\n            ASSERT_TRUE(skip != std::string::npos) << log.front();\n\n            ASSERT_TRUE(log.front().find(\" #\", skip + 2) != std::string::npos) << log.front();\n\n            size_t log_line = atoi(log.front().data() + log.front().find(\" #\", skip + 2) + 2);\n            ASSERT_TRUE(log_line) << log.front();\n\n            if (log_line > diag_line) {\n                ADD_FAILURE() << \"In log not found: \" << log.front();\n                log.erase(log.begin());\n            } else if (log_line < diag_line) {\n                ADD_FAILURE() << \"In diag not found: \" << diag.front();\n                diag.erase(diag.begin());\n            } else {\n                ADD_FAILURE() << \"Diag expected: \\\"\" << diag.front() << \"\\\" but found \\\"\" << log.front() << \"\\\"\";\n                log.erase(log.begin());\n                diag.erase(diag.begin());\n            }\n        }\n    }\n\n    for (auto &elem : log) {\n        ADD_FAILURE() << \"Log not found: \" << elem;\n    }\n    for (auto &elem : diag) {\n        ADD_FAILURE() << \"Diag not found: \" << elem;\n    }\n\n}\n\nTEST(MemSafe, Cycles) {\n\n    const std::string cmd_base = \"clang-20 -std=c++20 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang log \";\n\n\n    fs::remove(MemSafeFile::SHARED_SCAN_FILE_DEFAULT);\n\n    const char * file_log = \"_cycles.cpp.log\";\n    fs::remove(file_log);\n\n    std::system(std::format(\"{} -c _cycles.cpp > _cycles.cpp.log\", cmd_base).c_str());\n\n\n    ASSERT_TRUE(fs::exists(file_log));\n    std::ifstream log_file(file_log);\n\n    ASSERT_TRUE(log_file.is_open());\n\n    std::stringstream log_buffer;\n    log_buffer << log_file.rdbuf();\n\n    std::string log_output = log_buffer.str();\n    log_file.close();\n\n\n    ASSERT_TRUE(log_output.find(\"not found in current translation unit.\") != std::string::npos);\n\n    ASSERT_FALSE(fs::exists(MemSafeFile::SHARED_SCAN_FILE_DEFAULT));\n    fs::remove(\"_example.cpp.log\");\n\n    std::system(std::format(\"{} -Xclang -plugin-arg-memsafe -Xclang circleref-write -fsyntax-only _example.cpp > _example.cpp.log\", cmd_base).c_str());\n\n    ASSERT_TRUE(fs::exists(\"_example.cpp.log\"));\n    ASSERT_TRUE(fs::exists(MemSafeFile::SHARED_SCAN_FILE_DEFAULT));\n\n\n    std::ifstream example_file(\"_example.cpp.log\");\n    ASSERT_TRUE(example_file.is_open());\n\n    std::stringstream example_file_buffer;\n    example_file_buffer << example_file.rdbuf();\n\n    std::string example_log = example_file_buffer.str();\n    example_file.close();\n\n    ASSERT_TRUE(example_log.size() > 100);\n    ASSERT_TRUE(example_log.find(\"The circular reference analyzer requires two passes.\") == std::string::npos);\n\n    std::system(std::format(\"{} -Xclang -plugin-arg-memsafe -Xclang circleref-read -c _cycles.cpp > _cycles.cpp.log\", cmd_base).c_str());\n\n\n    ASSERT_TRUE(fs::exists(file_log));\n    std::ifstream log_file2(file_log);\n\n    ASSERT_TRUE(log_file2.is_open());\n\n    std::stringstream log_buffer2;\n    log_buffer2 << log_file2.rdbuf();\n\n    std::string log_output2 = log_buffer2.str();\n    log_file2.close();\n\n\n\n    ASSERT_TRUE(log_output2.size() > 100);\n    ASSERT_TRUE(log_output2.find(\"The circular reference analyzer requires two passes.\") == std::string::npos);\n\n\n    ASSERT_TRUE(!log_output2.empty());\n\n    ASSERT_TRUE(log_output2.find(\"Enable dump and process logger\") != std::string::npos &&\n            log_output2.find(\"unprocessed attribute!\") == std::string::npos)\n            << log_output2;\n\n\n    std::vector<std::string> diag({\n        \"#log #102\",\n        \"#log #103\",\n        \"#log #102\",\n        \"#log #1003\",\n        \"#log #1002\",\n        \"#err #1003\",\n        \"#err #1003\",\n        \"#log #1006\",\n        \"#err #1007\",\n        \"#log #1011\",\n        \"#log #1010\",\n        \"#log #1003\",\n        \"#err #1003\",\n        \"#warn #1011\",\n        \"#log #1014\",\n        \"#err #1007\",\n        \"#log #2009\",\n        \"#log #2002\",\n        \"#log #2005\",\n        \"#err #2005\",\n        \"#log #2005\",\n        \"#log #2004\",\n        \"#log #2009\",\n        \"#err #2009\",\n        \"#err #2005\",\n        \"#log #2009\",\n        \"#log #2008\",\n        \"#log #2005\",\n        \"#err #2005\",\n        \"#err #2009\",\n        \"#log #2013\",\n        \"#log #2012\",\n        \"#log #2009\",\n        \"#log #2012\",\n        \"#warn #2013\",\n        \"#log #2017\",\n        \"#log #2016\",\n        \"#log #2005\",\n        \"#log #2016\",\n        \"#warn #2017\",\n        \"#log #3002\",\n        \"#log #3002\",\n        \"#log #3005\",\n        \"#log #3005\",\n        \"#log #4002\",\n        \"#log #4002\",\n        \"#log #4005\",\n        \"#log #4005\",\n        \"#log #5003\",\n        \"#log #5003\",\n        \"#log #5006\",\n        \"#log #5006\",\n        \"#log #5009\",\n        \"#log #5009\",\n        \"#log #10002\",\n        \"#log #10007\",\n    });\n\n    size_t pos = log_output2.find(MEMSAFE_KEYWORD_START_LOG);\n    ASSERT_TRUE(pos != std::string::npos);\n    std::string log_str = log_output2.substr(pos + strlen(MEMSAFE_KEYWORD_START_LOG), log_output2.find(\"\\n\\n\", pos + strlen(MEMSAFE_KEYWORD_START_LOG)) - pos - strlen(MEMSAFE_KEYWORD_START_LOG));\n\n    //    std::cout << \"\\n\" << log_str << \"\\n\\n\";\n\n    std::vector< std::string> log;\n    SplitString(log_str, '\\n', &log);\n\n    ASSERT_TRUE(log.size()) << log_str;\n\n    while (!log.empty() && !diag.empty()) {\n\n        if (log.front().find(diag.front()) != std::string::npos) {\n            log.erase(log.begin());\n            diag.erase(diag.begin());\n        } else {\n\n            ASSERT_TRUE(diag.front().find(\" #\") != std::string::npos) << diag.front();\n\n            size_t diag_line = atoi(diag.front().data() + diag.front().find(\" #\") + 2);\n            ASSERT_TRUE(diag_line) << diag.front();\n\n            size_t skip = log.front().find(\" #\");\n            ASSERT_TRUE(skip != std::string::npos) << log.front();\n\n            ASSERT_TRUE(log.front().find(\" #\", skip + 2) != std::string::npos) << log.front();\n\n            size_t log_line = atoi(log.front().data() + log.front().find(\" #\", skip + 2) + 2);\n            ASSERT_TRUE(log_line) << log.front();\n\n            if (log_line > diag_line) {\n                ADD_FAILURE() << \"In log not found: \" << log.front();\n                log.erase(log.begin());\n            } else if (log_line < diag_line) {\n                ADD_FAILURE() << \"In diag not found: \" << diag.front();\n                diag.erase(diag.begin());\n            } else {\n                ADD_FAILURE() << \"Diag expected: \\\"\" << diag.front() << \"\\\" but found \\\"\" << log.front() << \"\\\"\";\n                log.erase(log.begin());\n                diag.erase(diag.begin());\n            }\n        }\n    }\n\n    for (auto &elem : log) {\n        ADD_FAILURE() << \"Log not found: \" << elem;\n    }\n    for (auto &elem : diag) {\n        ADD_FAILURE() << \"Diag not found: \" << elem;\n    }\n\n    std::string temp_memsafe = \"unittest-all.memsafe\";\n\n    fs::remove(temp_memsafe);\n    ASSERT_TRUE(!fs::exists(temp_memsafe));\n\n    std::system(std::format(\"{} -Xclang -plugin-arg-memsafe -Xclang circleref-write={} -fsyntax-only _example.cpp > _example.second.log\", cmd_base, temp_memsafe).c_str());\n    std::system(std::format(\"{} -Xclang -plugin-arg-memsafe -Xclang circleref-write={} -fsyntax-only _cycles.cpp > _cycles.second.log\", cmd_base, temp_memsafe).c_str());\n\n    ASSERT_TRUE(fs::exists(temp_memsafe));\n\n    MemSafeFile file(temp_memsafe, \"unit_test.not_file\");\n\n    MemSafeFile::ClassReadType readed;\n\n    ASSERT_NO_THROW(file.ReadFile(readed));\n\n    std::string shared = MemSafeFile::to_string(readed);\n\n    ASSERT_STREQ(\"cycles::ArraySharedInt {std::vector} fields:{}\\ncycles::CircleSelf {} fields:{cycles::CircleSelf}\\ncycles::CircleSelfUnsafe {} fields:{cycles::CircleSelf}\\ncycles::CircleShared {} fields:{cycles::CircleShared}\\ncycles::CircleSharedUnsafe {} fields:{cycles::CircleShared}\\ncycles::ExtExt {ns::Ext} fields:{}\\ncycles::ExtExtExt {cycles::ExtExt} fields:{}\\ncycles::SharedArrayInt {std::vector} fields:{}\\ncycles::SharedCross {} fields:{cycles::SharedCross2}\\ncycles::SharedCross2 {} fields:{cycles::SharedCross}\\ncycles::SharedCross2Unsafe {} fields:{cycles::SharedCross}\\ncycles::SharedCrossUnsafe {} fields:{cycles::SharedCross2}\\ncycles::SharedSingle {} fields:{}\\ncycles::SharedSingleInt {} fields:{}\\ncycles::SharedSingleIntField {} fields:{cycles::SharedSingleInt}\\nns::A {} fields:{ns::Ext}\\nns::Ext {} fields:{ns::A}\\n\", shared.c_str()) << shared;\n\n    fs::remove(\"_example.second.log\");\n    fs::remove(\"_cycles.second.log\");\n    fs::remove(temp_memsafe);\n}\n\n#endif\n"
  },
  {
    "path": "nbproject/Makefile-Debug.mk",
    "content": "#\n# Generated Makefile - do not edit!\n#\n# Edit the Makefile in the project folder instead (../Makefile). Each target\n# has a -pre and a -post target defined where you can add customized code.\n#\n# This makefile implements configuration specific macros and targets.\n\n\n# Environment\nMKDIR=mkdir\nCP=cp\nGREP=grep\nNM=nm\nCCADMIN=CCadmin\nRANLIB=ranlib\nCC=gcc\nCCC=g++\nCXX=g++\nFC=gfortran\nAS=as\n\n# Macros\nCND_PLATFORM=GNU-Linux\nCND_DLIB_EXT=so\nCND_CONF=Debug\nCND_DISTDIR=dist\nCND_BUILDDIR=build\n\n# Include project Makefile\ninclude Makefile\n\n# Object Directory\nOBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}\n\n# Object Files\nOBJECTFILES= \\\n\t${OBJECTDIR}/_cycles.o \\\n\t${OBJECTDIR}/_example.o \\\n\t${OBJECTDIR}/memsafe_clang.o \\\n\t${OBJECTDIR}/memsafe_test.o\n\n\n# C Compiler Flags\nCFLAGS=\n\n# CC Compiler Flags\nCCFLAGS=\nCXXFLAGS=\n\n# Fortran Compiler Flags\nFFLAGS=\n\n# Assembler Flags\nASFLAGS=\n\n# Link Libraries and Options\nLDLIBSOPTIONS=\n\n# Build Targets\n.build-conf: ${BUILD_SUBPROJECTS}\n\t\"${MAKE}\"  -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memsafe\n\n${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memsafe: ${OBJECTFILES}\n\t${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}\n\t${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memsafe ${OBJECTFILES} ${LDLIBSOPTIONS}\n\n${OBJECTDIR}/_cycles.o: _cycles.cpp nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -g -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/_cycles.o _cycles.cpp\n\n${OBJECTDIR}/_example.o: _example.cpp nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -g -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/_example.o _example.cpp\n\n${OBJECTDIR}/memsafe_clang.o: memsafe_clang.cpp nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -g -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/memsafe_clang.o memsafe_clang.cpp\n\n${OBJECTDIR}/memsafe_test.o: memsafe_test.cpp nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -g -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/memsafe_test.o memsafe_test.cpp\n\n# Subprojects\n.build-subprojects:\n\n# Clean Targets\n.clean-conf: ${CLEAN_SUBPROJECTS}\n\t${RM} -r ${CND_BUILDDIR}/${CND_CONF}\n\n# Subprojects\n.clean-subprojects:\n\n# Enable dependency checking\n.dep.inc: .depcheck-impl\n\ninclude .dep.inc\n"
  },
  {
    "path": "nbproject/Makefile-Release.mk",
    "content": "#\n# Generated Makefile - do not edit!\n#\n# Edit the Makefile in the project folder instead (../Makefile). Each target\n# has a -pre and a -post target defined where you can add customized code.\n#\n# This makefile implements configuration specific macros and targets.\n\n\n# Environment\nMKDIR=mkdir\nCP=cp\nGREP=grep\nNM=nm\nCCADMIN=CCadmin\nRANLIB=ranlib\nCC=gcc\nCCC=g++\nCXX=g++\nFC=gfortran\nAS=as\n\n# Macros\nCND_PLATFORM=GNU-Linux\nCND_DLIB_EXT=so\nCND_CONF=Release\nCND_DISTDIR=dist\nCND_BUILDDIR=build\n\n# Include project Makefile\ninclude Makefile\n\n# Object Directory\nOBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}\n\n# Object Files\nOBJECTFILES= \\\n\t${OBJECTDIR}/_cycles.o \\\n\t${OBJECTDIR}/_example.o \\\n\t${OBJECTDIR}/memsafe_clang.o \\\n\t${OBJECTDIR}/memsafe_test.o\n\n\n# C Compiler Flags\nCFLAGS=\n\n# CC Compiler Flags\nCCFLAGS=\nCXXFLAGS=\n\n# Fortran Compiler Flags\nFFLAGS=\n\n# Assembler Flags\nASFLAGS=\n\n# Link Libraries and Options\nLDLIBSOPTIONS=\n\n# Build Targets\n.build-conf: ${BUILD_SUBPROJECTS}\n\t\"${MAKE}\"  -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memsafe\n\n${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memsafe: ${OBJECTFILES}\n\t${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}\n\t${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memsafe ${OBJECTFILES} ${LDLIBSOPTIONS}\n\n${OBJECTDIR}/_cycles.o: _cycles.cpp nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -O2 -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/_cycles.o _cycles.cpp\n\n${OBJECTDIR}/_example.o: _example.cpp nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -O2 -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/_example.o _example.cpp\n\n${OBJECTDIR}/memsafe_clang.o: memsafe_clang.cpp nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -O2 -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/memsafe_clang.o memsafe_clang.cpp\n\n${OBJECTDIR}/memsafe_test.o: memsafe_test.cpp nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -O2 -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/memsafe_test.o memsafe_test.cpp\n\n# Subprojects\n.build-subprojects:\n\n# Clean Targets\n.clean-conf: ${CLEAN_SUBPROJECTS}\n\t${RM} -r ${CND_BUILDDIR}/${CND_CONF}\n\n# Subprojects\n.clean-subprojects:\n\n# Enable dependency checking\n.dep.inc: .depcheck-impl\n\ninclude .dep.inc\n"
  },
  {
    "path": "nbproject/Makefile-UNITTEST.mk",
    "content": "#\n# Generated Makefile - do not edit!\n#\n# Edit the Makefile in the project folder instead (../Makefile). Each target\n# has a -pre and a -post target defined where you can add customized code.\n#\n# This makefile implements configuration specific macros and targets.\n\n\n# Environment\nMKDIR=mkdir\nCP=cp\nGREP=grep\nNM=nm\nCCADMIN=CCadmin\nRANLIB=ranlib\nCC=clang-20\nCCC=clang++-20\nCXX=clang++-20\nFC=gfortran\nAS=lld-20\n\n# Macros\nCND_PLATFORM=CLang-20-Linux\nCND_DLIB_EXT=so\nCND_CONF=UNITTEST\nCND_DISTDIR=dist\nCND_BUILDDIR=build\n\n# Include project Makefile\ninclude Makefile\n\n# Object Directory\nOBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}\n\n# Object Files\nOBJECTFILES= \\\n\t${OBJECTDIR}/_cycles.o \\\n\t${OBJECTDIR}/_example.o \\\n\t${OBJECTDIR}/memsafe_test.o\n\n\n# C Compiler Flags\nCFLAGS=\n\n# CC Compiler Flags\nCCFLAGS=-std=c++20\nCXXFLAGS=-std=c++20\n\n# Fortran Compiler Flags\nFFLAGS=\n\n# Assembler Flags\nASFLAGS=\n\n# Link Libraries and Options\nLDLIBSOPTIONS=-lpthread -lgtest -lgtest_main -lyaml-cpp\n\n# Build Targets\n.build-conf: ${BUILD_SUBPROJECTS}\n\t\"${MAKE}\"  -f nbproject/Makefile-${CND_CONF}.mk memsafe_unittest\n\nmemsafe_unittest: ${OBJECTFILES}\n\t${LINK.cc} -o memsafe_unittest ${OBJECTFILES} ${LDLIBSOPTIONS}\n\n${OBJECTDIR}/_cycles.o: _cycles.cpp memsafe_clang.so circleref.memsafe nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -g -DBUILD_UNITTEST -I. -std=c++20 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang log -Xclang -plugin-arg-memsafe -Xclang level=warning -Xclang -plugin-arg-memsafe -Xclang circleref-read -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/_cycles.o _cycles.cpp\n\n${OBJECTDIR}/_example.o: _example.cpp memsafe_clang.so nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -g -DBUILD_UNITTEST -I. -std=c++20 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang log -Xclang -plugin-arg-memsafe -Xclang level=warning -Xclang -plugin-arg-memsafe -Xclang circleref-disable -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/_example.o _example.cpp\n\ncircleref.memsafe: circleref.memsafe memsafe_clang.so _example.cpp nbproject/Makefile-${CND_CONF}.mk\n\t@echo \"\\033[1;46;34m\"Building circleref.memsafe\"\\033[0m\"\n\tclang-20 -std=c++20 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang level=warning -Xclang -plugin-arg-memsafe -Xclang circleref-write -fsyntax-only _example.cpp\n\nmemsafe_clang.so: memsafe_clang.cpp memsafe_plugin.h nbproject/Makefile-${CND_CONF}.mk\n\t@echo \"\\033[1;46;34m\"Building a plugin memsafe_clang.so\"\\033[0m\"\n\tclang-20 -fPIC -shared -o memsafe_clang.so memsafe_clang.cpp `llvm-config-20 --cppflags --ldflags --system-libs --libs all` -std=c++20  -lyaml-cpp\n\n${OBJECTDIR}/memsafe_test.o: memsafe_test.cpp memsafe_clang.so nbproject/Makefile-${CND_CONF}.mk\n\t${MKDIR} -p ${OBJECTDIR}\n\t${RM} \"$@.d\"\n\t$(COMPILE.cc) -g -DBUILD_UNITTEST -I. -MMD -MP -MF \"$@.d\" -o ${OBJECTDIR}/memsafe_test.o memsafe_test.cpp\n\n# Subprojects\n.build-subprojects:\n\n# Clean Targets\n.clean-conf: ${CLEAN_SUBPROJECTS}\n\t${RM} -r ${CND_BUILDDIR}/${CND_CONF}\n\t${RM} circleref.memsafe\n\t${RM} memsafe_clang.so\n\n# Subprojects\n.clean-subprojects:\n\n# Enable dependency checking\n.dep.inc: .depcheck-impl\n\ninclude .dep.inc\n"
  },
  {
    "path": "nbproject/Makefile-impl.mk",
    "content": "# \n# Generated Makefile - do not edit! \n# \n# Edit the Makefile in the project folder instead (../Makefile). Each target\n# has a pre- and a post- target defined where you can add customization code.\n#\n# This makefile implements macros and targets common to all configurations.\n#\n# NOCDDL\n\n\n# Building and Cleaning subprojects are done by default, but can be controlled with the SUB\n# macro. If SUB=no, subprojects will not be built or cleaned. The following macro\n# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf\n# and .clean-reqprojects-conf unless SUB has the value 'no'\nSUB_no=NO\nSUBPROJECTS=${SUB_${SUB}}\nBUILD_SUBPROJECTS_=.build-subprojects\nBUILD_SUBPROJECTS_NO=\nBUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}\nCLEAN_SUBPROJECTS_=.clean-subprojects\nCLEAN_SUBPROJECTS_NO=\nCLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}\n\n\n# Project Name\nPROJECTNAME=memsafe\n\n# Active Configuration\nDEFAULTCONF=UNITTEST\nCONF=${DEFAULTCONF}\n\n# All Configurations\nALLCONFS=UNITTEST Debug Release \n\n\n# build\n.build-impl: .build-pre .validate-impl .depcheck-impl\n\t@#echo \"=> Running $@... Configuration=$(CONF)\"\n\t\"${MAKE}\" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf\n\n\n# clean\n.clean-impl: .clean-pre .validate-impl .depcheck-impl\n\t@#echo \"=> Running $@... Configuration=$(CONF)\"\n\t\"${MAKE}\" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf\n\n\n# clobber \n.clobber-impl: .clobber-pre .depcheck-impl\n\t@#echo \"=> Running $@...\"\n\tfor CONF in ${ALLCONFS}; \\\n\tdo \\\n\t    \"${MAKE}\" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \\\n\tdone\n\n# all \n.all-impl: .all-pre .depcheck-impl\n\t@#echo \"=> Running $@...\"\n\tfor CONF in ${ALLCONFS}; \\\n\tdo \\\n\t    \"${MAKE}\" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \\\n\tdone\n\n# build tests\n.build-tests-impl: .build-impl .build-tests-pre\n\t@#echo \"=> Running $@... Configuration=$(CONF)\"\n\t\"${MAKE}\" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf\n\n# run tests\n.test-impl: .build-tests-impl .test-pre\n\t@#echo \"=> Running $@... Configuration=$(CONF)\"\n\t\"${MAKE}\" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf\n\n# dependency checking support\n.depcheck-impl:\n\t@echo \"# This code depends on make tool being used\" >.dep.inc\n\t@if [ -n \"${MAKE_VERSION}\" ]; then \\\n\t    echo \"DEPFILES=\\$$(wildcard \\$$(addsuffix .d, \\$${OBJECTFILES} \\$${TESTOBJECTFILES}))\" >>.dep.inc; \\\n\t    echo \"ifneq (\\$${DEPFILES},)\" >>.dep.inc; \\\n\t    echo \"include \\$${DEPFILES}\" >>.dep.inc; \\\n\t    echo \"endif\" >>.dep.inc; \\\n\telse \\\n\t    echo \".KEEP_STATE:\" >>.dep.inc; \\\n\t    echo \".KEEP_STATE_FILE:.make.state.\\$${CONF}\" >>.dep.inc; \\\n\tfi\n\n# configuration validation\n.validate-impl:\n\t@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \\\n\tthen \\\n\t    echo \"\"; \\\n\t    echo \"Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}\"; \\\n\t    echo \"See 'make help' for details.\"; \\\n\t    echo \"Current directory: \" `pwd`; \\\n\t    echo \"\"; \\\n\tfi\n\t@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \\\n\tthen \\\n\t    exit 1; \\\n\tfi\n\n\n# help\n.help-impl: .help-pre\n\t@echo \"This makefile supports the following configurations:\"\n\t@echo \"    ${ALLCONFS}\"\n\t@echo \"\"\n\t@echo \"and the following targets:\"\n\t@echo \"    build  (default target)\"\n\t@echo \"    clean\"\n\t@echo \"    clobber\"\n\t@echo \"    all\"\n\t@echo \"    help\"\n\t@echo \"\"\n\t@echo \"Makefile Usage:\"\n\t@echo \"    make [CONF=<CONFIGURATION>] [SUB=no] build\"\n\t@echo \"    make [CONF=<CONFIGURATION>] [SUB=no] clean\"\n\t@echo \"    make [SUB=no] clobber\"\n\t@echo \"    make [SUB=no] all\"\n\t@echo \"    make help\"\n\t@echo \"\"\n\t@echo \"Target 'build' will build a specific configuration and, unless 'SUB=no',\"\n\t@echo \"    also build subprojects.\"\n\t@echo \"Target 'clean' will clean a specific configuration and, unless 'SUB=no',\"\n\t@echo \"    also clean subprojects.\"\n\t@echo \"Target 'clobber' will remove all built files from all configurations and,\"\n\t@echo \"    unless 'SUB=no', also from subprojects.\"\n\t@echo \"Target 'all' will will build all configurations and, unless 'SUB=no',\"\n\t@echo \"    also build subprojects.\"\n\t@echo \"Target 'help' prints this message.\"\n\t@echo \"\"\n\n"
  },
  {
    "path": "nbproject/Makefile-variables.mk",
    "content": "#\n# Generated - do not edit!\n#\n# NOCDDL\n#\nCND_BASEDIR=`pwd`\nCND_BUILDDIR=build\nCND_DISTDIR=dist\n# UNITTEST configuration\nCND_PLATFORM_UNITTEST=CLang-20-Linux\nCND_ARTIFACT_DIR_UNITTEST=\nCND_ARTIFACT_NAME_UNITTEST=memsafe_unittest\nCND_ARTIFACT_PATH_UNITTEST=memsafe_unittest\nCND_PACKAGE_DIR_UNITTEST=dist/UNITTEST/CLang-20-Linux/package\nCND_PACKAGE_NAME_UNITTEST=memsafe.tar\nCND_PACKAGE_PATH_UNITTEST=dist/UNITTEST/CLang-20-Linux/package/memsafe.tar\n# Debug configuration\nCND_PLATFORM_Debug=GNU-Linux\nCND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux\nCND_ARTIFACT_NAME_Debug=memsafe\nCND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux/memsafe\nCND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux/package\nCND_PACKAGE_NAME_Debug=memsafe.tar\nCND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux/package/memsafe.tar\n# Release configuration\nCND_PLATFORM_Release=GNU-Linux\nCND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux\nCND_ARTIFACT_NAME_Release=memsafe\nCND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux/memsafe\nCND_PACKAGE_DIR_Release=dist/Release/GNU-Linux/package\nCND_PACKAGE_NAME_Release=memsafe.tar\nCND_PACKAGE_PATH_Release=dist/Release/GNU-Linux/package/memsafe.tar\n#\n# include compiler specific variables\n#\n# dmake command\nROOT:sh = test -f nbproject/private/Makefile-variables.mk || \\\n\t(mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)\n#\n# gmake command\n.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk))\n#\ninclude nbproject/private/Makefile-variables.mk\n"
  },
  {
    "path": "nbproject/Package-Debug.bash",
    "content": "#!/bin/bash -x\n\n#\n# Generated - do not edit!\n#\n\n# Macros\nTOP=`pwd`\nCND_PLATFORM=GNU-Linux\nCND_CONF=Debug\nCND_DISTDIR=dist\nCND_BUILDDIR=build\nCND_DLIB_EXT=so\nNBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging\nTMPDIRNAME=tmp-packaging\nOUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memsafe\nOUTPUT_BASENAME=memsafe\nPACKAGE_TOP_DIR=memsafe/\n\n# Functions\nfunction checkReturnCode\n{\n    rc=$?\n    if [ $rc != 0 ]\n    then\n        exit $rc\n    fi\n}\nfunction makeDirectory\n# $1 directory path\n# $2 permission (optional)\n{\n    mkdir -p \"$1\"\n    checkReturnCode\n    if [ \"$2\" != \"\" ]\n    then\n      chmod $2 \"$1\"\n      checkReturnCode\n    fi\n}\nfunction copyFileToTmpDir\n# $1 from-file path\n# $2 to-file path\n# $3 permission\n{\n    cp \"$1\" \"$2\"\n    checkReturnCode\n    if [ \"$3\" != \"\" ]\n    then\n        chmod $3 \"$2\"\n        checkReturnCode\n    fi\n}\n\n# Setup\ncd \"${TOP}\"\nmkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package\nrm -rf ${NBTMPDIR}\nmkdir -p ${NBTMPDIR}\n\n# Copy files and create directories and links\ncd \"${TOP}\"\nmakeDirectory \"${NBTMPDIR}/memsafe/bin\"\ncopyFileToTmpDir \"${OUTPUT_PATH}\" \"${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}\" 0755\n\n\n# Generate tar file\ncd \"${TOP}\"\nrm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memsafe.tar\ncd ${NBTMPDIR}\ntar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memsafe.tar *\ncheckReturnCode\n\n# Cleanup\ncd \"${TOP}\"\nrm -rf ${NBTMPDIR}\n"
  },
  {
    "path": "nbproject/Package-Release.bash",
    "content": "#!/bin/bash -x\n\n#\n# Generated - do not edit!\n#\n\n# Macros\nTOP=`pwd`\nCND_PLATFORM=GNU-Linux\nCND_CONF=Release\nCND_DISTDIR=dist\nCND_BUILDDIR=build\nCND_DLIB_EXT=so\nNBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging\nTMPDIRNAME=tmp-packaging\nOUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memsafe\nOUTPUT_BASENAME=memsafe\nPACKAGE_TOP_DIR=memsafe/\n\n# Functions\nfunction checkReturnCode\n{\n    rc=$?\n    if [ $rc != 0 ]\n    then\n        exit $rc\n    fi\n}\nfunction makeDirectory\n# $1 directory path\n# $2 permission (optional)\n{\n    mkdir -p \"$1\"\n    checkReturnCode\n    if [ \"$2\" != \"\" ]\n    then\n      chmod $2 \"$1\"\n      checkReturnCode\n    fi\n}\nfunction copyFileToTmpDir\n# $1 from-file path\n# $2 to-file path\n# $3 permission\n{\n    cp \"$1\" \"$2\"\n    checkReturnCode\n    if [ \"$3\" != \"\" ]\n    then\n        chmod $3 \"$2\"\n        checkReturnCode\n    fi\n}\n\n# Setup\ncd \"${TOP}\"\nmkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package\nrm -rf ${NBTMPDIR}\nmkdir -p ${NBTMPDIR}\n\n# Copy files and create directories and links\ncd \"${TOP}\"\nmakeDirectory \"${NBTMPDIR}/memsafe/bin\"\ncopyFileToTmpDir \"${OUTPUT_PATH}\" \"${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}\" 0755\n\n\n# Generate tar file\ncd \"${TOP}\"\nrm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memsafe.tar\ncd ${NBTMPDIR}\ntar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memsafe.tar *\ncheckReturnCode\n\n# Cleanup\ncd \"${TOP}\"\nrm -rf ${NBTMPDIR}\n"
  },
  {
    "path": "nbproject/Package-UNITTEST.bash",
    "content": "#!/bin/bash -x\n\n#\n# Generated - do not edit!\n#\n\n# Macros\nTOP=`pwd`\nCND_PLATFORM=CLang-20-Linux\nCND_CONF=UNITTEST\nCND_DISTDIR=dist\nCND_BUILDDIR=build\nCND_DLIB_EXT=so\nNBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging\nTMPDIRNAME=tmp-packaging\nOUTPUT_PATH=memsafe_unittest\nOUTPUT_BASENAME=memsafe_unittest\nPACKAGE_TOP_DIR=memsafe/\n\n# Functions\nfunction checkReturnCode\n{\n    rc=$?\n    if [ $rc != 0 ]\n    then\n        exit $rc\n    fi\n}\nfunction makeDirectory\n# $1 directory path\n# $2 permission (optional)\n{\n    mkdir -p \"$1\"\n    checkReturnCode\n    if [ \"$2\" != \"\" ]\n    then\n      chmod $2 \"$1\"\n      checkReturnCode\n    fi\n}\nfunction copyFileToTmpDir\n# $1 from-file path\n# $2 to-file path\n# $3 permission\n{\n    cp \"$1\" \"$2\"\n    checkReturnCode\n    if [ \"$3\" != \"\" ]\n    then\n        chmod $3 \"$2\"\n        checkReturnCode\n    fi\n}\n\n# Setup\ncd \"${TOP}\"\nmkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package\nrm -rf ${NBTMPDIR}\nmkdir -p ${NBTMPDIR}\n\n# Copy files and create directories and links\ncd \"${TOP}\"\nmakeDirectory \"${NBTMPDIR}/memsafe/bin\"\ncopyFileToTmpDir \"${OUTPUT_PATH}\" \"${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}\" 0755\n\n\n# Generate tar file\ncd \"${TOP}\"\nrm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memsafe.tar\ncd ${NBTMPDIR}\ntar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memsafe.tar *\ncheckReturnCode\n\n# Cleanup\ncd \"${TOP}\"\nrm -rf ${NBTMPDIR}\n"
  },
  {
    "path": "nbproject/configurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configurationDescriptor version=\"100\">\n  <logicalFolder name=\"root\" displayName=\"root\" projectFiles=\"true\" kind=\"ROOT\">\n    <logicalFolder name=\"SourceFiles\"\n                   displayName=\"Исходные файлы\"\n                   projectFiles=\"true\">\n      <itemPath>_cycles.cpp</itemPath>\n      <itemPath>_example.cpp</itemPath>\n      <itemPath>memsafe_clang.cpp</itemPath>\n      <itemPath>memsafe_test.cpp</itemPath>\n    </logicalFolder>\n    <logicalFolder name=\"HeaderFiles\"\n                   displayName=\"Файлы заголовков\"\n                   projectFiles=\"true\">\n      <itemPath>memsafe.h</itemPath>\n      <itemPath>memsafe_plugin.h</itemPath>\n    </logicalFolder>\n    <logicalFolder name=\"ResourceFiles\"\n                   displayName=\"Файлы ресурсов\"\n                   projectFiles=\"true\">\n      <itemPath>circleref.memsafe</itemPath>\n    </logicalFolder>\n    <logicalFolder name=\"TestFiles\"\n                   displayName=\"Файлы тестов\"\n                   projectFiles=\"false\"\n                   kind=\"TEST_LOGICAL_FOLDER\">\n    </logicalFolder>\n    <logicalFolder name=\"ExternalFiles\"\n                   displayName=\"Важные файлы\"\n                   projectFiles=\"false\"\n                   kind=\"IMPORTANT_FILES_FOLDER\">\n      <itemPath>CHANGELOG.md</itemPath>\n      <itemPath>LICENSE</itemPath>\n      <itemPath>Makefile</itemPath>\n      <itemPath>README.md</itemPath>\n    </logicalFolder>\n  </logicalFolder>\n  <projectmakefile>Makefile</projectmakefile>\n  <confs>\n    <conf name=\"UNITTEST\" type=\"1\">\n      <toolsSet>\n        <compilerSet>CLang-20|CLang</compilerSet>\n        <dependencyChecking>true</dependencyChecking>\n        <rebuildPropChanged>true</rebuildPropChanged>\n      </toolsSet>\n      <compileType>\n        <cTool>\n          <preprocessorList>\n            <Elem>BUILD_UNITTEST</Elem>\n          </preprocessorList>\n        </cTool>\n        <ccTool>\n          <incDir>\n            <pElem>.</pElem>\n          </incDir>\n          <commandLine>-std=c++20</commandLine>\n          <preprocessorList>\n            <Elem>BUILD_UNITTEST</Elem>\n          </preprocessorList>\n        </ccTool>\n        <linkerTool>\n          <output>memsafe_unittest</output>\n          <linkerLibItems>\n            <linkerLibStdlibItem>PosixThreads</linkerLibStdlibItem>\n            <linkerLibLibItem>gtest</linkerLibLibItem>\n            <linkerLibLibItem>gtest_main</linkerLibLibItem>\n            <linkerLibLibItem>yaml-cpp</linkerLibLibItem>\n          </linkerLibItems>\n        </linkerTool>\n      </compileType>\n      <item path=\"_cycles.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n        <ccTool>\n          <commandLine>-std=c++20 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang log -Xclang -plugin-arg-memsafe -Xclang level=warning -Xclang -plugin-arg-memsafe -Xclang circleref-read</commandLine>\n          <additionalDep>memsafe_clang.so circleref.memsafe</additionalDep>\n        </ccTool>\n      </item>\n      <item path=\"_example.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n        <ccTool>\n          <commandLine>-std=c++20 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang log -Xclang -plugin-arg-memsafe -Xclang level=warning -Xclang -plugin-arg-memsafe -Xclang circleref-disable</commandLine>\n          <additionalDep>memsafe_clang.so</additionalDep>\n        </ccTool>\n      </item>\n      <item path=\"circleref.memsafe\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n        <customTool>\n          <customToolCommandline>clang-20 -std=c++20 -ferror-limit=500 -Xclang -load -Xclang ./memsafe_clang.so -Xclang -add-plugin -Xclang memsafe -Xclang -plugin-arg-memsafe -Xclang level=warning -Xclang -plugin-arg-memsafe -Xclang circleref-write -fsyntax-only _example.cpp</customToolCommandline>\n          <customToolDescription>\"\\033[1;46;34m\"Building circleref.memsafe\"\\033[0m\"</customToolDescription>\n          <customToolOutputs>circleref.memsafe</customToolOutputs>\n          <customToolAdditionalDep>memsafe_clang.so _example.cpp</customToolAdditionalDep>\n        </customTool>\n      </item>\n      <item path=\"memsafe.h\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe_clang.cpp\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n        <customTool>\n          <customToolCommandline>clang-20 -fPIC -shared -o memsafe_clang.so memsafe_clang.cpp `llvm-config-20 --cppflags --ldflags --system-libs --libs all` -std=c++20  -lyaml-cpp</customToolCommandline>\n          <customToolDescription>\"\\033[1;46;34m\"Building a plugin memsafe_clang.so\"\\033[0m\"</customToolDescription>\n          <customToolOutputs>memsafe_clang.so</customToolOutputs>\n          <customToolAdditionalDep>memsafe_plugin.h</customToolAdditionalDep>\n        </customTool>\n      </item>\n      <item path=\"memsafe_plugin.h\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe_test.cpp\" ex=\"false\" tool=\"1\" flavor2=\"9\">\n        <ccTool>\n          <additionalDep>memsafe_clang.so</additionalDep>\n        </ccTool>\n      </item>\n    </conf>\n    <conf name=\"Debug\" type=\"1\">\n      <toolsSet>\n        <compilerSet>default</compilerSet>\n        <dependencyChecking>true</dependencyChecking>\n        <rebuildPropChanged>true</rebuildPropChanged>\n      </toolsSet>\n      <compileType>\n      </compileType>\n      <item path=\"_cycles.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n      </item>\n      <item path=\"_example.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n      </item>\n      <item path=\"circleref.memsafe\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe.h\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe_clang.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe_plugin.h\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe_test.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n      </item>\n    </conf>\n    <conf name=\"Release\" type=\"1\">\n      <toolsSet>\n        <compilerSet>default</compilerSet>\n        <dependencyChecking>true</dependencyChecking>\n        <rebuildPropChanged>true</rebuildPropChanged>\n      </toolsSet>\n      <compileType>\n        <cTool>\n          <developmentMode>5</developmentMode>\n        </cTool>\n        <ccTool>\n          <developmentMode>5</developmentMode>\n        </ccTool>\n        <fortranCompilerTool>\n          <developmentMode>5</developmentMode>\n        </fortranCompilerTool>\n        <asmTool>\n          <developmentMode>5</developmentMode>\n        </asmTool>\n      </compileType>\n      <item path=\"_cycles.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n      </item>\n      <item path=\"_example.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n      </item>\n      <item path=\"circleref.memsafe\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe.h\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe_clang.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe_plugin.h\" ex=\"false\" tool=\"3\" flavor2=\"0\">\n      </item>\n      <item path=\"memsafe_test.cpp\" ex=\"false\" tool=\"1\" flavor2=\"0\">\n      </item>\n    </conf>\n  </confs>\n</configurationDescriptor>\n"
  },
  {
    "path": "nbproject/project.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://www.netbeans.org/ns/project/1\">\n    <type>org.netbeans.modules.cnd.makeproject</type>\n    <configuration>\n        <data xmlns=\"http://www.netbeans.org/ns/make-project/1\">\n            <name>memsafe</name>\n            <c-extensions/>\n            <cpp-extensions>cpp</cpp-extensions>\n            <header-extensions>h</header-extensions>\n            <sourceEncoding>UTF-8</sourceEncoding>\n            <make-dep-projects/>\n            <sourceRootList/>\n            <confList>\n                <confElem>\n                    <name>UNITTEST</name>\n                    <type>1</type>\n                </confElem>\n                <confElem>\n                    <name>Debug</name>\n                    <type>1</type>\n                </confElem>\n                <confElem>\n                    <name>Release</name>\n                    <type>1</type>\n                </confElem>\n            </confList>\n            <formatting>\n                <project-formatting-style>false</project-formatting-style>\n            </formatting>\n        </data>\n    </configuration>\n</project>\n"
  }
]