Skip to content

Commit

Permalink
add comments to factory functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vovatrykoz committed Dec 24, 2024
1 parent 7636c53 commit 79c91c5
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions include/setup/Factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,55 @@ namespace factory {

using namespace e2e::io;

/**
* @brief Creates a logger of the specified type.
*
* This function creates a logger based on the provided type, which
* must be derived from `ILogger`. Any necessary arguments to the
* constructor of the logger type can be passed directly into this function.
*
* @tparam LoggerType The type of the logger. Must inherit from `ILogger`.
* @tparam Args Any additional arguments for the logger constructor.
* @param args Arguments forwarded to the constructor of the logger type.
* @return A unique pointer to the created logger instance.
*/
template <typename LoggerType, typename... Args>
std::unique_ptr<ILogger> makeLogger(Args... args)
requires std::is_base_of_v<ILogger, LoggerType>;

/**
* @brief Creates a task instance reader of the specified type.
*
* This function creates a task instance reader based on the provided type,
* which must be derived from `ITaskInstanceReader`. Any arguments
* required for the constructor of the reader type can be passed directly into
* this function.
*
* @tparam TaskInstanceReaderType The type of the task instance reader. Must
* inherit from `ITaskInstanceReader`.
* @tparam Args Any additional arguments for the task instance reader
* constructor.
* @param args Arguments forwarded to the constructor of the task instance
* reader type.
* @return A unique pointer to the created task instance reader.
*/
template <typename TaskInstanceReaderType, typename... Args>
std::unique_ptr<ITaskInstanceReader> makeTaskInstanceReader(Args... args)
requires std::is_base_of_v<ITaskInstanceReader, TaskInstanceReaderType>;

/**
* @brief Creates a task reader of the specified type.
*
* This function creates a task reader based on the provided type, which must
* be derived from `ITaskReader`. Any necessary arguments for
* the constructor of the reader type can be passed directly into this function.
*
* @tparam TaskReaderType The type of the task reader. Must inherit from
* `ITaskReader`.
* @tparam Args Any additional arguments for the task reader constructor.
* @param args Arguments forwarded to the constructor of the task reader type.
* @return A unique pointer to the created task reader.
*/
template <typename TaskReaderType, typename... Args>
std::unique_ptr<ITaskReader> makeTaskReader(Args... args)
requires std::is_base_of_v<ITaskReader, TaskReaderType>;
Expand Down

0 comments on commit 79c91c5

Please sign in to comment.