Skip to content

Commit

Permalink
fix: clang format correction
Browse files Browse the repository at this point in the history
  • Loading branch information
LucioDonda committed Dec 10, 2024
1 parent 54e4f50 commit 72baa17
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ namespace configuration
/// @return The corresponding size_t value.
/// @throws std::invalid_argument if the string does not represent a valid size unit.
/// @details This function parses a string representing a size unit and returns the equivalent size_t
/// value. The size unit can be expressed in Bytes (e.g. "1B"), Mega bytes (e.g. "1M" or "1MB"), kilo bytes (e.g.
/// "1K" or "1KB"). If no unit is specified, the value is assumed to be in Bytes
/// value. The size unit can be expressed in Bytes (e.g. "1B"), Mega bytes (e.g. "1M" or "1MB"), kilo bytes
/// (e.g. "1K" or "1KB"). If no unit is specified, the value is assumed to be in Bytes
std::size_t ParseSizeUnit(const std::string& option) const;

public:
Expand Down
10 changes: 6 additions & 4 deletions src/agent/multitype_queue/include/imultitype_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>
#include <variant>
#include <vector>

/**
* @brief Interface for a multi-type message queue.
*
Expand Down Expand Up @@ -66,10 +67,11 @@ class IMultiTypeQueue
* @param moduleType The type of the module requesting the messages.
* @return boost::asio::awaitable<std::vector<Message>> Awaitable object representing the next N messages.
*/
virtual boost::asio::awaitable<std::vector<Message>> getNextNAwaitable(MessageType type,
std::variant<const int, const size_t> messageQuantity,
const std::string moduleName = "",
const std::string moduleType = "") = 0;
virtual boost::asio::awaitable<std::vector<Message>>
getNextNAwaitable(MessageType type,
std::variant<const int, const size_t> messageQuantity,
const std::string moduleName = "",
const std::string moduleType = "") = 0;

/**
* @brief Retrieves the next N messages from the queue.
Expand Down
9 changes: 4 additions & 5 deletions src/agent/multitype_queue/include/persistence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <nlohmann/json.hpp>

#include <string>
#include <vector>
#include <variant>
#include <vector>

/**
* @brief Interface for persistence storage.
Expand Down Expand Up @@ -91,7 +91,6 @@ class Persistence
*/
virtual int GetElementCount(const std::string& queueName, const std::string& moduleName = "") = 0;


/**
* @brief Get the bytes occupied by elements stored in the specified queue.
*
Expand All @@ -110,7 +109,7 @@ class Persistence
* @return nlohmann::json The retrieved JSON messages.
*/
virtual nlohmann::json RetrieveBySize(size_t n,
const std::string& queueName,
const std::string& moduleName = "",
const std::string& moduleType = "") = 0;
const std::string& queueName,
const std::string& moduleName = "",
const std::string& moduleType = "") = 0;
};
4 changes: 2 additions & 2 deletions src/agent/multitype_queue/src/multitype_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ std::vector<Message> MultiTypeQueue::getNextN(MessageType type,
sizeRequested = availableSize;
}
LogInfo("Requesting {}B of {}B", sizeRequested, availableSize);
arrayData = m_persistenceDest->RetrieveBySize(
sizeRequested, m_mapMessageTypeName.at(type), moduleName, moduleType);
arrayData =
m_persistenceDest->RetrieveBySize(sizeRequested, m_mapMessageTypeName.at(type), moduleName, moduleType);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/agent/multitype_queue/src/sqlitestorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class SQLiteStorage : public Persistence

/**
* @brief Intermediate function for processing Retrieve queries.
*/
*/
nlohmann::json ProcessRequest(SQLite::Statement& sqlStatementQuery, size_t maxSize = 0);

/**
Expand Down
1 change: 0 additions & 1 deletion src/agent/tests/message_queue_utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ TEST_F(MessageQueueUtilsTest, GetMessagesFromQueueMetadataTest)
nlohmann::json metadata;
metadata["agent"] = "test";


// NOLINTBEGIN(cppcoreguidelines-avoid-capturing-lambda-coroutines)
EXPECT_CALL(*mockQueue, getNextNAwaitable(MessageType::STATELESS, MinMessagesSize, "", ""))
.WillOnce([&testMessages]() -> boost::asio::awaitable<std::vector<Message>> { co_return testMessages; });
Expand Down

0 comments on commit 72baa17

Please sign in to comment.