Skip to content

Commit 870a437

Browse files
committed
added gemc_unit namespace
1 parent a001645 commit 870a437

5 files changed

Lines changed: 194 additions & 180 deletions

File tree

guts/examples/string_vector_from_string.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ using namespace std;
88

99

1010
/**
11-
* @file string_vector_from_string.cc
12-
* @brief Example program demonstrating tokenization via gutilities helpers.
11+
* \file string_vector_from_string.cc
12+
* \brief Example program demonstrating tokenization via gutilities helpers.
1313
*
1414
* This example reads a single command-line argument containing a whitespace-separated list
1515
* of tokens (typically provided in quotes) and prints each token on its own line.
@@ -25,7 +25,7 @@ using namespace std;
2525
*/
2626

2727
/**
28-
* @brief Program entry point.
28+
* \brief Program entry point.
2929
*
3030
* Expected usage:
3131
* - Exactly one argument containing a whitespace-separated list of tokens.
@@ -34,9 +34,9 @@ using namespace std;
3434
* - If the argument count is incorrect, prints a fatal-style message and returns failure.
3535
* - Otherwise tokenizes the string and prints each resulting token.
3636
*
37-
* @param argc Argument count.
38-
* @param argv Argument vector.
39-
* @return \c EXIT_SUCCESS on success, \c EXIT_FAILURE on incorrect usage.
37+
* \param argc Argument count.
38+
* \param argv Argument vector.
39+
* \return \c EXIT_SUCCESS on success, \c EXIT_FAILURE on incorrect usage.
4040
*/
4141
int main(int argc, char* argv[]) {
4242
if (argc != 2) {

guts/gthreads.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <thread>
1111

1212
/**
13-
* @file gthreads.h
14-
* @brief Small compatibility wrapper providing a jthread-like type.
13+
* \file gthreads.h
14+
* \brief Small compatibility wrapper providing a jthread-like type.
1515
*
1616
* This header defines \c jthread_alias, which maps to:
1717
* - \c std::jthread when the standard library provides it (C++20 and library support), or
@@ -32,7 +32,7 @@
3232

3333
/**
3434
* @typedef jthread_alias
35-
* @brief Alias to \c std::jthread when available.
35+
* \brief Alias to \c std::jthread when available.
3636
*
3737
* When \c std::jthread exists, it provides automatic joining and cooperative cancellation
3838
* (via stop tokens) in the standard way.
@@ -46,7 +46,7 @@ using jthread_alias = std::jthread;
4646

4747
/**
4848
* @class jthread_alias
49-
* @brief Fallback RAII "join-on-destruction" thread wrapper.
49+
* \brief Fallback RAII "join-on-destruction" thread wrapper.
5050
*
5151
* This class is used when \c std::jthread is not available in the standard library.
5252
*
@@ -72,7 +72,7 @@ using jthread_alias = std::jthread;
7272
class jthread_alias
7373
{
7474
/**
75-
* @brief Owned thread instance.
75+
* \brief Owned thread instance.
7676
*
7777
* Invariant: \c t_ is either default-constructed (not joinable), moved-from (not joinable),
7878
* or represents a running/finished thread that may be joinable.
@@ -81,19 +81,19 @@ class jthread_alias
8181

8282
public:
8383
/**
84-
* @brief Construct an empty (non-joinable) wrapper.
84+
* \brief Construct an empty (non-joinable) wrapper.
8585
*
8686
* After default construction, \ref jthread_alias::joinable "joinable()" returns @c false.
8787
*/
8888
jthread_alias() noexcept = default;
8989

9090
/**
91-
* @brief Start a new thread by forwarding arguments to the underlying \c std::thread.
91+
* \brief Start a new thread by forwarding arguments to the underlying \c std::thread.
9292
*
9393
* @tparam F Callable type.
9494
* @tparam Args Argument pack forwarded to @p f.
95-
* @param f Callable to run in the new thread.
96-
* @param args Arguments passed to @p f.
95+
* \param f Callable to run in the new thread.
96+
* \param args Arguments passed to @p f.
9797
*
9898
* @note This constructor is \c explicit to avoid accidental implicit thread starts.
9999
*/
@@ -109,7 +109,7 @@ class jthread_alias
109109
jthread_alias& operator=(const jthread_alias&) = delete;
110110

111111
/**
112-
* @brief Join the underlying thread on destruction if still joinable.
112+
* \brief Join the underlying thread on destruction if still joinable.
113113
*
114114
* This mirrors the "safe by default" behavior typically sought with \c std::jthread.
115115
*
@@ -118,13 +118,13 @@ class jthread_alias
118118
~jthread_alias() { if (t_.joinable()) t_.join(); }
119119

120120
/**
121-
* @brief Check whether the underlying thread can be joined.
122-
* @return @c true if joinable, @c false otherwise.
121+
* \brief Check whether the underlying thread can be joined.
122+
* \return @c true if joinable, @c false otherwise.
123123
*/
124124
bool joinable() const noexcept { return t_.joinable(); }
125125

126126
/**
127-
* @brief Join the underlying thread.
127+
* \brief Join the underlying thread.
128128
*
129129
* Preconditions match \c std::thread::join.
130130
*
@@ -134,30 +134,30 @@ class jthread_alias
134134
void join() { t_.join(); }
135135

136136
/**
137-
* @brief Detach the underlying thread.
137+
* \brief Detach the underlying thread.
138138
*
139139
* After detaching, the wrapper no longer represents a joinable thread, and the destructor
140140
* will not join.
141141
*/
142142
void detach() { t_.detach(); }
143143

144144
/**
145-
* @brief Get the underlying thread id.
146-
* @return The \c std::thread::id of the owned thread.
145+
* \brief Get the underlying thread id.
146+
* \return The \c std::thread::id of the owned thread.
147147
*/
148148
std::thread::id get_id() const noexcept { return t_.get_id(); }
149149

150150
/**
151-
* @brief Access the native handle of the underlying thread.
152-
* @return Native handle as returned by \c std::thread::native_handle.
151+
* \brief Access the native handle of the underlying thread.
152+
* \return Native handle as returned by \c std::thread::native_handle.
153153
*
154154
* @note This is provided for integration with low-level platform APIs when needed.
155155
*/
156156
auto native_handle() { return t_.native_handle(); }
157157

158158
/**
159-
* @brief Swap the underlying thread with another wrapper.
160-
* @param other Wrapper to swap with.
159+
* \brief Swap the underlying thread with another wrapper.
160+
* \param other Wrapper to swap with.
161161
*
162162
* After swapping, each wrapper owns the other's prior thread.
163163
*/

guts/gutilities.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
// Numbers / strings with units / io interface to CLHEP units
66
#include "CLHEP/Units/PhysicalConstants.h"
77

8+
// geant4
9+
#include "G4UImanager.hh"
10+
11+
812
// c++
913
// algorithm for 'transform'
1014
#include <algorithm>
@@ -172,7 +176,7 @@ string fillDigits(const string& word, const string& c, int ndigits) {
172176
#include <locale.h> // strtod_l / _strtod_l
173177

174178
/**
175-
* @brief Parse an entire numeric string as a double using the "C" numeric locale.
179+
* \brief Parse an entire numeric string as a double using the "C" numeric locale.
176180
*
177181
* This translation-unit local helper exists to make numeric parsing robust against the
178182
* process locale (for example when a user's environment uses a comma decimal separator).
@@ -181,9 +185,9 @@ string fillDigits(const string& word, const string& c, int ndigits) {
181185
* - Parsing succeeds only if the entire input is consumed (no trailing characters).
182186
* - The conversion uses the "C" numeric locale, independent of the process locale.
183187
*
184-
* @param sv String view containing the numeric text.
185-
* @param out Parsed value on success.
186-
* @return @c true when the full string was successfully parsed; @c false otherwise.
188+
* \param sv String view containing the numeric text.
189+
* \param out Parsed value on success.
190+
* \return @c true when the full string was successfully parsed; @c false otherwise.
187191
*
188192
* @note This is a private helper function. Refer to it textually as \c parse_double_clocale
189193
* (no \ref to private symbols).

0 commit comments

Comments
 (0)