Skip to content

Commit

Permalink
Remove @brief and @details and reflow comments to try to adhere to se…
Browse files Browse the repository at this point in the history
…ntence per line (#113)

The docs style was inconsistent, try to maintain this style from now on.
(I wish there were a doxygen autoformatter)
  • Loading branch information
TrentHouliston authored Aug 12, 2024
1 parent 8f1b8c9 commit d595e0d
Show file tree
Hide file tree
Showing 132 changed files with 1,269 additions and 1,368 deletions.
7 changes: 3 additions & 4 deletions docs/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ The template is used to have multiple static contexts.

using task_ptr = std::unique_ptr<threading::ReactionTask>;

/// @brief our queue which sorts tasks by priority
/// Our queue which sorts tasks by priority
static std::priority_queue<task_ptr> queue;
/// @brief how many tasks are currently running
/// How many tasks are currently running
static volatile bool running;
/// @brief a mutex to ensure data consistency
/// A mutex to ensure data consistency
static std::mutex mutex;

Now we define the `reschedule` to interrupt any new tasks if we are currently running. Recall that NUClear is
Expand Down Expand Up @@ -218,4 +218,3 @@ We need to instantiate our static members outside the class definition.

template <typename SyncGroup>
std::mutex Sync<SyncGroup>::mutex;

4 changes: 2 additions & 2 deletions src/Configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
namespace NUClear {

/**
* @brief This class holds the configuration for a PowerPlant.
* This class holds the configuration for a PowerPlant.
*/
struct Configuration {
/// @brief The number of threads the system will use
/// The number of threads the system will use
size_t thread_count = std::thread::hardware_concurrency() == 0 ? 2 : std::thread::hardware_concurrency();
};

Expand Down
13 changes: 5 additions & 8 deletions src/Environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ class Reactor;
class PowerPlant;

/**
* @brief
* Environment defines variables that are passed from the installing PowerPlant context
* into a Reactor.
* Environment defines variables that are passed from the installing PowerPlant context into a Reactor.
*
* @details
* The Environment is used to provide information from the PowerPlant to Reactors.
* Each Reactor owns it's own environment and can use it to access useful information.
* The Environment is used to provide information from the PowerPlant to Reactors.
* Each Reactor owns it's own environment and can use it to access useful information.
*/
class Environment {
public:
Expand All @@ -51,9 +48,9 @@ class Environment {
friend class PowerPlant;
friend class Reactor;

/// @brief The PowerPlant to use in this reactor
/// The PowerPlant to use in this reactor
PowerPlant& powerplant;
/// @brief The name of the reactor
/// The name of the reactor
std::string reactor_name;
};

Expand Down
64 changes: 24 additions & 40 deletions src/LogLevel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,83 +32,67 @@
namespace NUClear {

/**
* @brief LogLevel defines the different levels log messages can be set to.
* LogLevel defines the different levels log messages can be set to.
*
* @details
* Log levels are used to provide different levels of detail on a per-reactor basis.
* The logging level of a reactor can be changed by setting it in the install function.
* Log levels are used to provide different levels of detail on a per-reactor basis.
* The logging level of a reactor can be changed by setting it in the install function.
*/
enum LogLevel {
/**
* @brief
* Don't use this log level when emitting logs, it is for setting reactor log level from non reactor sources.
* Don't use this log level when emitting logs, it is for setting reactor log level from non reactor sources.
*
* Specifically when a NUClear::log is called from code that is not running in a reaction (even transitively) then
* the reactor_level will be set to UNKNOWN.
*/
UNKNOWN,

/**
* @brief
* The Trace level contains messages that are used to trace the exact flow of execution.
* The Trace level contains messages that are used to trace the exact flow of execution.
*
* @details
* This level is extremely verbose and often has a message per line of code.
* This level is extremely verbose and often has a message per line of code.
*/
TRACE,

/**
* @brief
* Debug contains messages that represent the inputs and outputs of different
* computation units.
* Debug contains messages that represent the inputs and outputs of different computation units.
*
* @details
* If you have a function that performs three steps to do something
* then it's likely that you will have a message for the input and output of those
* three steps. Additionally you would likely have messages that check if it hit
* different branches.
* If you have a function that performs three steps to do something then it's likely that you will have a message
* for the input and output of those three steps.
* Additionally you would likely have messages that check if it hit different branches.
*/
DEBUG,

/**
* @brief
* The info level is used to provide high level goal messages such as function start
* or successful completion.
* The info level is used to provide high level goal messages such as function start or successful completion.
*
* @details
* This shows when key user-facing functionality is executed and tells us that everything
* is working without getting into the details.
* This shows when key user-facing functionality is executed and tells us that everything is working without getting
* into the details.
*/
INFO,

/**
* @brief The warning level is used to notify us that everything might not be working perfectly.
* The warning level is used to notify us that everything might not be working perfectly.
*
* @details
* Warnings are errors or inconsistencies that aren't fatal and generally do not completely
* break the system. However a warning message should require action from someone and should
* point to a section of the system that needs attention.
* Warnings are errors or inconsistencies that aren't fatal and generally do not completely break the system.
* However a warning message should require action and should point to a section of the system that needs attention.
*/
WARN,

/**
* @brief
* The error level is used to report unexpected behavior.
* The error level is used to report unexpected behavior.
* @details
* This level doesn't need to prefix a program-crashing issue but should be used to report major
* unexpected branches in logic or other constraint breaking problems such as failed assertions.
* All errors should require action from someone and should be addressed immediately.
* This level doesn't need to prefix a program-crashing issue but should be used to report major unexpected branches
* in logic or other constraint breaking problems such as failed assertions.
* All errors should require action from someone and should be addressed immediately.
*/
ERROR,

/**
* @brief Fatal is a program destroying error that needs to be addressed immediately.
* Fatal is a program destroying error that needs to be addressed immediately.
*
* @details
* If a fatal message is sent it should point to something that should never ever happen and
* ideally provide as much information as possible as to why it crashed. Fatal messages
* require action immediately and should always be addressed.
* If a fatal message is sent it should point to something that should never ever happen and ideally provide as much
* information as possible as to why it crashed.
* Fatal messages require action immediately and should always be addressed.
*/
FATAL
};
Expand Down
Loading

0 comments on commit d595e0d

Please sign in to comment.