Merge pull request #906 from a1346054/master

Minor cleanup
pull/915/head
Tim Stack 3 years ago committed by GitHub
commit 283cdf7ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -66,7 +66,7 @@ ACKNOWLEDGEMENTS
The xterm color database was copied from: The xterm color database was copied from:
http://jonasjacek.github.io/colors/ https://jonasjacek.github.io/colors/
SEE ALSO SEE ALSO
@ -74,4 +74,4 @@ SEE ALSO
The lnav website: The lnav website:
http://lnav.org https://lnav.org

@ -3,7 +3,7 @@
[![Coverage Status](https://coveralls.io/repos/github/tstack/lnav/badge.svg?branch=master)](https://coveralls.io/github/tstack/lnav?branch=master) [![Coverage Status](https://coveralls.io/repos/github/tstack/lnav/badge.svg?branch=master)](https://coveralls.io/github/tstack/lnav?branch=master)
[![lnav](https://snapcraft.io//lnav/badge.svg)](https://snapcraft.io/lnav) [![lnav](https://snapcraft.io//lnav/badge.svg)](https://snapcraft.io/lnav)
_This is the source repository for **lnav**, visit [http://lnav.org](http://lnav.org) for a high level overview._ _This is the source repository for **lnav**, visit [https://lnav.org](https://lnav.org) for a high level overview._
# LNAV -- The Logfile Navigator # LNAV -- The Logfile Navigator

@ -140,7 +140,7 @@ check_error_output() {
# #
# Grep for a string in the output generated by a run_test() call. # Grep for a string in the output generated by a run_test() call.
# #
# Usage: grep_output_for <string> <fail maessage> # Usage: grep_output_for <string> <fail message>
# #
# Example: # Example:
# #

@ -11,7 +11,7 @@ The following options are available for installing **lnav**:
## Linux ## Linux
<!-- markdown-link-check-disable-next-line --> <!-- markdown-link-check-disable-next-line -->
Download a [statically linked 64-bit binary](https://github.com/tstack/lnav/releases/download/v{{site.version}}/lnav-{{site.version}}-musl-64bit.zip). Download a [statically linked 64-bit binary](https://github.com/tstack/lnav/releases/download/v{{site.version}}/lnav-{{site.version}}-musl-64bit.zip).
Install from the [Snap Store](https://snapcraft.io/lnav): Install from the [Snap Store](https://snapcraft.io/lnav):

@ -8,7 +8,7 @@
# For technical reasons, this file is *NOT* reloaded automatically when you use # For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process. # 'bundle exec jekyll serve'. If you change this file, please restart the server process.
# #
# If you need help with YAML syntax, here are some quick references for you: # If you need help with YAML syntax, here are some quick references for you:
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml # https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
# https://learnxinyminutes.com/docs/yaml/ # https://learnxinyminutes.com/docs/yaml/
# #

@ -37,7 +37,7 @@ parser will also look for pairs separated by a colon. If there are no clearly
demarcated pairs, then the parser will extract anything that looks like data demarcated pairs, then the parser will extract anything that looks like data
values and assign them keys of the form 'col_N'. For example, two data values, values and assign them keys of the form 'col_N'. For example, two data values,
an IPv4 address and a symbol, will be extracted from the following log an IPv4 address and a symbol, will be extracted from the following log
messsage:: message::
Apr 29 08:13:43 sample-centos5 avahi-daemon[2467]: Registering new address record for 10.1.10.62 on eth0. Apr 29 08:13:43 sample-centos5 avahi-daemon[2467]: Registering new address record for 10.1.10.62 on eth0.
@ -83,30 +83,30 @@ following results are received::
log_line log_part log_time log_idle_msecs log_level log_hostname log_procname log_pid col_0 col_1 log_line log_part log_time log_idle_msecs log_level log_hostname log_procname log_pid col_0 col_1
292 p.0 2013-04-11T16:42:51.000 0 info localhost avahi-daemon 2480 fe80::a00:27ff:fe98:7f6e eth0 292 p.0 2013-04-11T16:42:51.000 0 info localhost avahi-daemon 2480 fe80::a00:27ff:fe98:7f6e eth0
293 p.0 2013-04-11T16:42:51.000 0 info localhost avahi-daemon 2480 10.0.2.15 eth0 293 p.0 2013-04-11T16:42:51.000 0 info localhost avahi-daemon 2480 10.0.2.15 eth0
330 p.0 2013-04-11T16:47:02.000 0 info localhost avahi-daemon 2480 fe80::a00:27ff:fe98:7f6e eth0 330 p.0 2013-04-11T16:47:02.000 0 info localhost avahi-daemon 2480 fe80::a00:27ff:fe98:7f6e eth0
336 p.0 2013-04-11T16:47:02.000 0 info localhost avahi-daemon 2480 10.1.10.75 eth0 336 p.0 2013-04-11T16:47:02.000 0 info localhost avahi-daemon 2480 10.1.10.75 eth0
343 p.0 2013-04-11T16:47:02.000 0 info localhost avahi-daemon 2480 10.1.10.75 eth0 343 p.0 2013-04-11T16:47:02.000 0 info localhost avahi-daemon 2480 10.1.10.75 eth0
370 p.0 2013-04-11T16:59:39.000 0 info localhost avahi-daemon 2480 10.1.10.75 eth0 370 p.0 2013-04-11T16:59:39.000 0 info localhost avahi-daemon 2480 10.1.10.75 eth0
377 p.0 2013-04-11T16:59:39.000 0 info localhost avahi-daemon 2480 10.1.10.75 eth0 377 p.0 2013-04-11T16:59:39.000 0 info localhost avahi-daemon 2480 10.1.10.75 eth0
382 p.0 2013-04-11T16:59:41.000 0 info localhost avahi-daemon 2480 fe80::a00:27ff:fe98:7f6e eth0 382 p.0 2013-04-11T16:59:41.000 0 info localhost avahi-daemon 2480 fe80::a00:27ff:fe98:7f6e eth0
401 p.0 2013-04-11T17:20:45.000 0 info localhost avahi-daemon 4247 fe80::a00:27ff:fe98:7f6e eth0 401 p.0 2013-04-11T17:20:45.000 0 info localhost avahi-daemon 4247 fe80::a00:27ff:fe98:7f6e eth0
402 p.0 2013-04-11T17:20:45.000 0 info localhost avahi-daemon 4247 10.1.10.75 eth0 402 p.0 2013-04-11T17:20:45.000 0 info localhost avahi-daemon 4247 10.1.10.75 eth0
735 p.0 2013-04-11T17:41:46.000 0 info sample-centos5 avahi-daemon 2465 fe80::a00:27ff:fe98:7f6e eth0 735 p.0 2013-04-11T17:41:46.000 0 info sample-centos5 avahi-daemon 2465 fe80::a00:27ff:fe98:7f6e eth0
736 p.0 2013-04-11T17:41:46.000 0 info sample-centos5 avahi-daemon 2465 10.1.10.75 eth0 736 p.0 2013-04-11T17:41:46.000 0 info sample-centos5 avahi-daemon 2465 10.1.10.75 eth0
781 p.0 2013-04-12T03:32:30.000 0 info sample-centos5 avahi-daemon 2465 10.1.10.64 eth0 781 p.0 2013-04-12T03:32:30.000 0 info sample-centos5 avahi-daemon 2465 10.1.10.64 eth0
788 p.0 2013-04-12T03:32:30.000 0 info sample-centos5 avahi-daemon 2465 10.1.10.64 eth0 788 p.0 2013-04-12T03:32:30.000 0 info sample-centos5 avahi-daemon 2465 10.1.10.64 eth0
1166 p.0 2013-04-25T10:56:00.000 0 info sample-centos5 avahi-daemon 2467 fe80::a00:27ff:fe98:7f6e eth0 1166 p.0 2013-04-25T10:56:00.000 0 info sample-centos5 avahi-daemon 2467 fe80::a00:27ff:fe98:7f6e eth0
1167 p.0 2013-04-25T10:56:00.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.111 eth0 1167 p.0 2013-04-25T10:56:00.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.111 eth0
1246 p.0 2013-04-26T06:06:25.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.49 eth0 1246 p.0 2013-04-26T06:06:25.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.49 eth0
1253 p.0 2013-04-26T06:06:25.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.49 eth0 1253 p.0 2013-04-26T06:06:25.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.49 eth0
1454 p.0 2013-04-28T06:53:55.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.103 eth0 1454 p.0 2013-04-28T06:53:55.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.103 eth0
1461 p.0 2013-04-28T06:53:55.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.103 eth0 1461 p.0 2013-04-28T06:53:55.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.103 eth0
1497 p.0 2013-04-29T08:13:43.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.62 eth0 1497 p.0 2013-04-29T08:13:43.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.62 eth0
1504 p.0 2013-04-29T08:13:43.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.62 eth0 1504 p.0 2013-04-29T08:13:43.000 0 info sample-centos5 avahi-daemon 2467 10.1.10.62 eth0
Note that **lnav** is not returning results for all messages that are in this Note that **lnav** is not returning results for all messages that are in this
syslog file. Rather, it searches for messages that match the format for the syslog file. Rather, it searches for messages that match the format for the
@ -125,14 +125,14 @@ The results for this query are::
col_0 count(*) col_0 count(*)
10.0.2.15 1 10.0.2.15 1
10.1.10.49 2 10.1.10.49 2
10.1.10.62 2 10.1.10.62 2
10.1.10.64 2 10.1.10.64 2
10.1.10.75 6 10.1.10.75 6
10.1.10.103 2 10.1.10.103 2
10.1.10.111 1 10.1.10.111 1
fe80::a00:27ff:fe98:7f6e 6 fe80::a00:27ff:fe98:7f6e 6
Since this type of query is fairly common, **lnav** includes a "summarize" Since this type of query is fairly common, **lnav** includes a "summarize"
command that will compute the frequencies of identifiers as well as min, max, command that will compute the frequencies of identifiers as well as min, max,

@ -83,7 +83,7 @@ Spatial Navigation
- Next/previous file - Next/previous file
* - :kbd:`u` * - :kbd:`u`
- :kbd:`Shift` + :kbd:`u` - :kbd:`Shift` + :kbd:`u`
- -
- Next/previous bookmark - Next/previous bookmark
* - :kbd:`o` * - :kbd:`o`
- :kbd:`Shift` + :kbd:`o` - :kbd:`Shift` + :kbd:`o`
@ -181,7 +181,7 @@ Display
* - :kbd:`i` * - :kbd:`i`
- Switch to/from the histogram view - Switch to/from the histogram view
* - :kbd:`Shift` + :kbd:`i` * - :kbd:`Shift` + :kbd:`i`
- Switch to/from the histogram view - Switch to/from the histogram view
* - :kbd:`v` * - :kbd:`v`
- Switch to/from the SQL result view - Switch to/from the SQL result view
* - :kbd:`Shift` + :kbd:`v` * - :kbd:`Shift` + :kbd:`v`

@ -1,13 +1,13 @@
#! /bin/sh #!/bin/sh
# Wrapper for various clipboard I/O on Linux desktop environments and Windows emulations thereof # Wrapper for various clipboard I/O on Linux desktop environments and Windows emulations thereof
if [ -z "$STDIN_COPY_COMMAND" ] || [ -z "$STDOUT_PASTE_COMMAND" ] if [ -z "$STDIN_COPY_COMMAND" ] || [ -z "$STDOUT_PASTE_COMMAND" ]
then then
if [ $WAYLAND_DISPLAY ] if [ -n "$WAYLAND_DISPLAY" ]
then then
STDIN_COPY_COMMAND="wl-copy --foreground --type text/plain" STDIN_COPY_COMMAND="wl-copy --foreground --type text/plain"
STDOUT_PASTE_COMMAND="wl-paste --no-newline" STDOUT_PASTE_COMMAND="wl-paste --no-newline"
elif [ $DISPLAY ] elif [ -n "$DISPLAY" ]
then then
if command -v xclip if command -v xclip
then then
@ -34,7 +34,7 @@ then
then then
STDIN_COPY_COMMAND="clip.exe" STDIN_COPY_COMMAND="clip.exe"
STDOUT_PASTE_COMMAND=":" STDOUT_PASTE_COMMAND=":"
elif [ $TMUX ] elif [ -n "$TMUX" ]
then then
STDIN_COPY_COMMAND="tmux load-buffer -" STDIN_COPY_COMMAND="tmux load-buffer -"
STDOUT_PASTE_COMMAND="tmux save-buffer -" STDOUT_PASTE_COMMAND="tmux save-buffer -"
@ -44,7 +44,7 @@ then
fi > /dev/null fi > /dev/null
fi fi
case "$1" in case $1 in
copy) exec $STDIN_COPY_COMMAND > /dev/null 2>/dev/null ;; copy) exec $STDIN_COPY_COMMAND > /dev/null 2>/dev/null ;;
paste) exec $STDOUT_PASTE_COMMAND < /dev/null 2>/dev/null ;; paste) exec $STDOUT_PASTE_COMMAND < /dev/null 2>/dev/null ;;
"") # Try to guess intention "") # Try to guess intention

@ -1,4 +1,4 @@
#! /bin/bash #!/usr/bin/env bash
# #
# An example script that converts messages in a syslog file into a # An example script that converts messages in a syslog file into a
@ -8,7 +8,7 @@
# #
# NOTE: lnav is going to save some state in $HOME; you might want to change # NOTE: lnav is going to save some state in $HOME; you might want to change
# $HOME to something else... # $HOME to something else...
# #
# NOTE 2: Unfortunately, this is pretty inefficient right now since lnav # NOTE 2: Unfortunately, this is pretty inefficient right now since lnav
# is going to store the entire log file in memory when processing the # is going to store the entire log file in memory when processing the
# result of the SQL SELECT. # result of the SQL SELECT.
@ -20,28 +20,28 @@ if test $# -lt 1; then
exit 1 exit 1
fi fi
if test ! -f $1; then if test ! -f "$1"; then
echo "error: expecting a log file as the first argument" echo "error: expecting a log file as the first argument"
exit 1 exit 1
fi fi
# Figure out a unique file name. # Figure out a unique file name.
out_file_base="$(basename $1)" out_file_base=$(basename "$1")
counter=0 counter=0
while test -e "${out_file_base}.${counter}.csv"; do while test -e "${out_file_base}.${counter}.csv"; do
counter=`expr ${counter} + 1` counter=$((counter + 1))
done done
export OUT_FILE="${out_file_base}.${counter}.csv" export OUT_FILE="${out_file_base}.${counter}.csv"
# Here's a quick summary of what this is doing: # Here's a quick summary of what this is doing:
# #
# 1. ':load-session' will load the session data which stores which lines # 1. ':load-session' will load the session data which stores which lines
# are bookmarked in a file. We're using bookmarks to keep track of the # are bookmarked in a file. We're using bookmarks to keep track of the
# last line that we converted in a previous run of this script. # last line that we converted in a previous run of this script.
# 2. ';CREATE TABLE helper' creates a temporary table that we use to store # 2. ';CREATE TABLE helper' creates a temporary table that we use to store
# the range of messages that we'll be converting. # the range of messages that we'll be converting.
# 3. ';INSERT INTO helper' will figure out the range of lines in syslog file # 3. ';INSERT INTO helper' will figure out the range of lines in syslog file
# to convert. # to convert.
# 4. ';UPDATE syslog_log' will set a bookmark on the last line of the range # 4. ';UPDATE syslog_log' will set a bookmark on the last line of the range
# we computed in the previous step. # we computed in the previous step.
# 5. ';SELECT *' will pull all of the log messages in the computed range. # 5. ';SELECT *' will pull all of the log messages in the computed range.
@ -63,4 +63,4 @@ lnav -nq -d /tmp/lnav.err \
SELECT start_line FROM helper) and (SELECT max_line FROM helper)" \ SELECT start_line FROM helper) and (SELECT max_line FROM helper)" \
-c ':write-csv-to $OUT_FILE' \ -c ':write-csv-to $OUT_FILE' \
-c ":save-session" \ -c ":save-session" \
$1 "$1"

@ -1,4 +1,4 @@
#! /bin/bash #!/usr/bin/env bash
PAUSE_TIME=0.5 PAUSE_TIME=0.5

@ -6,10 +6,10 @@ fpm --verbose \
-s zip \ -s zip \
-t rpm \ -t rpm \
-n "lnav" \ -n "lnav" \
-v $VERSION \ -v "$VERSION" \
-p /vagrant/ \ -p /vagrant/ \
-a native \ -a native \
--url http://lnav.org \ --url https://lnav.org \
-m 'timothyshanestack@gmail.com' \ -m 'timothyshanestack@gmail.com' \
--description 'A log file viewer and analyzer for the terminal' \ --description 'A log file viewer and analyzer for the terminal' \
--license BSD-2-Clause \ --license BSD-2-Clause \
@ -20,10 +20,10 @@ fpm --verbose \
-s zip \ -s zip \
-t deb \ -t deb \
-n "lnav" \ -n "lnav" \
-v $VERSION \ -v "$VERSION" \
-p /vagrant/ \ -p /vagrant/ \
-a native \ -a native \
--url http://lnav.org \ --url https://lnav.org \
-m 'timothyshanestack@gmail.com' \ -m 'timothyshanestack@gmail.com' \
--description 'A log file viewer and analyzer for the terminal' \ --description 'A log file viewer and analyzer for the terminal' \
--license BSD-2-Clause \ --license BSD-2-Clause \

@ -1,4 +1,4 @@
#! /usr/bin/env bash #!/usr/bin/env bash
OS=$(uname -s) OS=$(uname -s)
if test x"${OS}" != x"FreeBSD"; then if test x"${OS}" != x"FreeBSD"; then
@ -26,7 +26,7 @@ cd ~/github/lnav
git pull git pull
if test -n "$SRC_VERSION"; then if test -n "$SRC_VERSION"; then
git checkout $SRC_VERSION git checkout "$SRC_VERSION"
fi fi
saved_PATH=${PATH} saved_PATH=${PATH}

@ -1,4 +1,4 @@
#! /bin/sh #!/bin/sh
sudo apk update && sudo apk upgrade sudo apk update && sudo apk upgrade
sudo apk add \ sudo apk add \

@ -1,4 +1,4 @@
#! /bin/sh #!/bin/sh
OS=$(uname -s) OS=$(uname -s)
if test x"${OS}" != x"FreeBSD"; then if test x"${OS}" != x"FreeBSD"; then

@ -1,4 +1,4 @@
#! /usr/bin/env bash #!/usr/bin/env bash
OS=$(uname -s) OS=$(uname -s)
if test x"${OS}" != x"FreeBSD"; then if test x"${OS}" != x"FreeBSD"; then
@ -50,7 +50,7 @@ xterm-256color\
cd ~/extract cd ~/extract
for pkg in /vagrant/pkgs/*.tar.gz; do for pkg in /vagrant/pkgs/*.tar.gz; do
tar xfz $pkg tar xfz "$pkg"
done done
(cd make-4.2.1 && ./configure --prefix=${FAKE_ROOT} && make && make install) (cd make-4.2.1 && ./configure --prefix=${FAKE_ROOT} && make && make install)

@ -12,7 +12,7 @@ confinement: strict
apps: apps:
lnav: lnav:
command: lnav command: lnav
plugs: plugs:
- home # optional, allows to read log files from home directory - home # optional, allows to read log files from home directory
- log-observe # required, provide access to system logs in /var/log - log-observe # required, provide access to system logs in /var/log
- network # required, lnav uses sendto() with UNIX domain socket - network # required, lnav uses sendto() with UNIX domain socket
@ -42,7 +42,7 @@ parts:
snapcraftctl pull snapcraftctl pull
"$SNAPCRAFT_STAGE"/scriptlets/selective-checkout --debug --force-snapshot "$SNAPCRAFT_STAGE"/scriptlets/selective-checkout --debug --force-snapshot
build-packages: build-packages:
- build-essential - build-essential
- libarchive-dev - libarchive-dev
- libpcre3-dev - libpcre3-dev

@ -1,12 +1,12 @@
/** /**
* @file accessmode.h * @file accessmode.h
* @author L.-C. C. * @author L.-C. C.
* @brief * @brief
* @version 0.1 * @version 0.1
* @date 2019-01-20 * @date 2019-01-20
* *
* @copyright Copyright (c) 2019 * @copyright Copyright (c) 2019
* *
*/ */
#pragma once #pragma once
@ -46,4 +46,4 @@ namespace safe
static constexpr bool IsReadOnly = true; static constexpr bool IsReadOnly = true;
}; };
#endif // __cplusplus >= 201402L #endif // __cplusplus >= 201402L
} // namespace safe } // namespace safe

@ -1,12 +1,12 @@
/** /**
* @file defaulttypes.h * @file defaulttypes.h
* @author L.-C. C. * @author L.-C. C.
* @brief * @brief
* @version 0.1 * @version 0.1
* @date 2020-01-29 * @date 2020-01-29
* *
* @copyright Copyright (c) 2020 * @copyright Copyright (c) 2020
* *
*/ */
#pragma once #pragma once
@ -20,4 +20,4 @@ namespace safe
using DefaultReadOnlyLock = std::lock_guard<MutexType>; using DefaultReadOnlyLock = std::lock_guard<MutexType>;
template<typename MutexType> template<typename MutexType>
using DefaultReadWriteLock = std::lock_guard<MutexType>; using DefaultReadWriteLock = std::lock_guard<MutexType>;
} // namespace safe } // namespace safe

@ -1,12 +1,12 @@
/** /**
* @file mutableref.h * @file mutableref.h
* @author L.-C. C. * @author L.-C. C.
* @brief * @brief
* @version 0.1 * @version 0.1
* @date 2020-01-03 * @date 2020-01-03
* *
* @copyright Copyright (c) 2020 * @copyright Copyright (c) 2020
* *
*/ */
#pragma once #pragma once
@ -21,7 +21,7 @@ namespace safe
* @brief A helper class that defines a member variable of type * @brief A helper class that defines a member variable of type
* Type. The variable is defined "mutable Type" if Type is not a * Type. The variable is defined "mutable Type" if Type is not a
* reference, the variable is "Type&" if Type is a reference. * reference, the variable is "Type&" if Type is a reference.
* *
* @tparam Type The type of the variable to define. * @tparam Type The type of the variable to define.
*/ */
template<typename Type> template<typename Type>
@ -37,4 +37,4 @@ namespace safe
Type& get; Type& get;
}; };
} // namespace impl } // namespace impl
} // namespace safe } // namespace safe

@ -1,12 +1,12 @@
/** /**
* @file safe.h * @file safe.h
* @author L.-C. C. * @author L.-C. C.
* @brief * @brief
* @version 0.1 * @version 0.1
* @date 2018-09-21 * @date 2018-09-21
* *
* @copyright Copyright (c) 2018 * @copyright Copyright (c) 2018
* *
*/ */
#pragma once #pragma once
@ -34,10 +34,10 @@ namespace safe
*/ */
struct DefaultConstructMutex {}; struct DefaultConstructMutex {};
static constexpr DefaultConstructMutex default_construct_mutex; static constexpr DefaultConstructMutex default_construct_mutex;
/** /**
* @brief Wraps a value together with a mutex. * @brief Wraps a value together with a mutex.
* *
* @tparam ValueType The type of the value to protect. * @tparam ValueType The type of the value to protect.
* @tparam MutexType The type of the mutex. * @tparam MutexType The type of the mutex.
*/ */
@ -53,7 +53,7 @@ namespace safe
/** /**
* @brief Manages a mutex and gives pointer-like access to a value * @brief Manages a mutex and gives pointer-like access to a value
* object. * object.
* *
* @tparam LockType The type of the lock object that manages the * @tparam LockType The type of the lock object that manages the
* mutex, example: std::lock_guard. * mutex, example: std::lock_guard.
* @tparam Mode Determines the access mode of the Access * @tparam Mode Determines the access mode of the Access
@ -83,7 +83,7 @@ namespace safe
* @brief Construct an Access object from a possibly const * @brief Construct an Access object from a possibly const
* reference to the value object and any additionnal argument * reference to the value object and any additionnal argument
* needed to construct the Lock object. * needed to construct the Lock object.
* *
* @tparam LockArgs Deduced from lockArgs. * @tparam LockArgs Deduced from lockArgs.
* @param value Reference to the value. * @param value Reference to the value.
* @param lockArgs Arguments needed to construct the lock object. * @param lockArgs Arguments needed to construct the lock object.
@ -99,12 +99,12 @@ namespace safe
* @brief Construct a read-only Access object from a const * @brief Construct a read-only Access object from a const
* safe::Safe object and any additionnal argument needed to * safe::Safe object and any additionnal argument needed to
* construct the Lock object. * construct the Lock object.
* *
* If needed, you can provide additionnal arguments to construct * If needed, you can provide additionnal arguments to construct
* the lock object (such as std::adopt_lock). The mutex from the * the lock object (such as std::adopt_lock). The mutex from the
* safe::Locakble object is already passed to the lock object's * safe::Locakble object is already passed to the lock object's
* constructor though, you must not provide it. * constructor though, you must not provide it.
* *
* @tparam OtherLockArgs Deduced from otherLockArgs. * @tparam OtherLockArgs Deduced from otherLockArgs.
* @param safe The const Safe object to give protected access to. * @param safe The const Safe object to give protected access to.
* @param otherLockArgs Other arguments needed to construct the lock * @param otherLockArgs Other arguments needed to construct the lock
@ -120,12 +120,12 @@ namespace safe
* @brief Construct a read-write Access object from a * @brief Construct a read-write Access object from a
* safe::Safe object and any additionnal argument needed to * safe::Safe object and any additionnal argument needed to
* construct the Lock object. * construct the Lock object.
* *
* If needed, you can provide additionnal arguments to construct * If needed, you can provide additionnal arguments to construct
* the lock object (such as std::adopt_lock). The mutex from the * the lock object (such as std::adopt_lock). The mutex from the
* safe object is already passed to the lock object's constructor * safe object is already passed to the lock object's constructor
* though, you must not provide it. * though, you must not provide it.
* *
* @tparam OtherLockArgs Deduced from otherLockArgs. * @tparam OtherLockArgs Deduced from otherLockArgs.
* @param safe The Safe object to give protected access to. * @param safe The Safe object to give protected access to.
* @param otherLockArgs Other arguments needed to construct the lock * @param otherLockArgs Other arguments needed to construct the lock
@ -141,7 +141,7 @@ namespace safe
* @brief Construct an Access object from another one. * @brief Construct an Access object from another one.
* OtherLockType must implement release() like std::unique_lock * OtherLockType must implement release() like std::unique_lock
* does. * does.
* *
* @tparam OtherLockType Deduced from otherAccess. * @tparam OtherLockType Deduced from otherAccess.
* @tparam OtherMode Deduced from otherAccess. * @tparam OtherMode Deduced from otherAccess.
* @tparam OtherLockArgs Deduced from otherLockArgs. * @tparam OtherLockArgs Deduced from otherLockArgs.
@ -215,7 +215,7 @@ namespace safe
using ReadAccess = Access<LockType, AccessMode::ReadOnly>; using ReadAccess = Access<LockType, AccessMode::ReadOnly>;
template<template<typename> class LockType=DefaultReadWriteLock> template<template<typename> class LockType=DefaultReadWriteLock>
using WriteAccess = Access<LockType, AccessMode::ReadWrite>; using WriteAccess = Access<LockType, AccessMode::ReadWrite>;
/** /**
* @brief Construct a Safe object * @brief Construct a Safe object
*/ */
@ -225,7 +225,7 @@ namespace safe
* @brief Construct a Safe object with default construction of * @brief Construct a Safe object with default construction of
* the mutex and perfect forwarding of the other arguments to * the mutex and perfect forwarding of the other arguments to
* construct the value object. * construct the value object.
* *
* @tparam ValueArgs Deduced from valueArgs. * @tparam ValueArgs Deduced from valueArgs.
* @param valueArgs Perfect forwarding arguments to construct the value object. * @param valueArgs Perfect forwarding arguments to construct the value object.
* @param tag Indicates that the mutex should be default constructed. * @param tag Indicates that the mutex should be default constructed.
@ -239,7 +239,7 @@ namespace safe
* @brief Construct a Safe object, forwarding the first * @brief Construct a Safe object, forwarding the first
* argument to construct the mutex and the other arguments to * argument to construct the mutex and the other arguments to
* construct the value object. * construct the value object.
* *
* @tparam MutexArg Deduced from mutexArg. * @tparam MutexArg Deduced from mutexArg.
* @tparam ValueArgs Deduced from valueArgs. * @tparam ValueArgs Deduced from valueArgs.
* @param valueArgs Perfect forwarding arguments to construct the * @param valueArgs Perfect forwarding arguments to construct the
@ -296,7 +296,7 @@ namespace safe
/** /**
* @brief Unsafe const accessor to the value. If you use this * @brief Unsafe const accessor to the value. If you use this
* function, you exit the realm of safe! * function, you exit the realm of safe!
* *
* @return ConstValueReferenceType Const reference to the value * @return ConstValueReferenceType Const reference to the value
* object. * object.
*/ */
@ -307,7 +307,7 @@ namespace safe
/** /**
* @brief Unsafe accessor to the value. If you use this function, * @brief Unsafe accessor to the value. If you use this function,
* you exit the realm of safe! * you exit the realm of safe!
* *
* @return ValueReferenceType Reference to the value object. * @return ValueReferenceType Reference to the value object.
*/ */
ValueReferenceType unsafe() noexcept ValueReferenceType unsafe() noexcept
@ -317,7 +317,7 @@ namespace safe
/** /**
* @brief Accessor to the mutex. * @brief Accessor to the mutex.
* *
* @return MutexReferenceType Reference to the mutex. * @return MutexReferenceType Reference to the mutex.
*/ */
MutexReferenceType mutex() const noexcept MutexReferenceType mutex() const noexcept
@ -334,7 +334,7 @@ namespace safe
/** /**
* @brief Type alias for read-only Access. * @brief Type alias for read-only Access.
* *
* @tparam SafeType The type of Safe object to give read-only access to. * @tparam SafeType The type of Safe object to give read-only access to.
* @tparam LockType=DefaultReadOnlyLock The type of lock. * @tparam LockType=DefaultReadOnlyLock The type of lock.
*/ */
@ -345,7 +345,7 @@ namespace safe
/** /**
* @brief Type alias for read-write Access. * @brief Type alias for read-write Access.
* *
* @tparam SafeType The type of Safe object to give read-write access to. * @tparam SafeType The type of Safe object to give read-write access to.
* @tparam LockType=DefaultReadWriteLock The type of lock. * @tparam LockType=DefaultReadWriteLock The type of lock.
*/ */
@ -356,4 +356,4 @@ namespace safe
} // namespace safe } // namespace safe
#undef EXPLICIT_IF_CPP17 #undef EXPLICIT_IF_CPP17
#undef EXPLICITLY_CONSTRUCT_RETURN_TYPE_IF_CPP17 #undef EXPLICITLY_CONSTRUCT_RETURN_TYPE_IF_CPP17

Loading…
Cancel
Save