diff --git a/.clang-format b/.clang-format index 42df3fa66..bfc0cbe27 100644 --- a/.clang-format +++ b/.clang-format @@ -105,6 +105,7 @@ PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Left +QualifierAlignment: Left ReflowComments: true SortIncludes: true SortUsingDeclarations: true diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..111dc9d4e --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,58 @@ +Checks: > + *, + bugprone-*, + cert-*, + concurrency-*, + cppcoreguidelines-*, + misc-*, + performance-*, + -abseil-*, + -altera-*, + -android-*, + -boost-*, + -fuchsia-*, + -google-*, + -hicpp-*, + -llvm-*, + -llvmlibc-*, + -zircon-*, + -bugprone-easily-swappable-parameters, + -cert-err60-cpp, + -cppcoreguidelines-non-private-member-variables-in-classes, + -cppcoreguidelines-use-default-member-init, + -misc-include-cleaner, + -misc-non-private-member-variables-in-classes, + -modernize-pass-by-value, + -modernize-use-trailing-return-type, + -modernize-use-default-member-init, + -modernize-return-braced-init-list, + -modernize-use-scoped-lock, + -modernize-concat-nested-namespaces, + -modernize-use-nodiscard, + -modernize-raw-string-literal, + -performance-avoid-endl, + -performance-enum-size, + -performance-unnecessary-value-param, + -readability-avoid-const-params-in-decls, + -readability-function-cognitive-complexity, + -readability-identifier-length, + -readability-magic-numbers, + -readability-qualified-auto, + -readability-simplify-boolean-expr, + -readability-use-anyofallof, + -readability-use-std-min-max, + -concurrency-mt-unsafe, + -portability-avoid-pragma-once, + -portability-template-virtual-member-function, + -cppcoreguidelines-avoid-const-or-ref-data-members, + -cppcoreguidelines-avoid-do-while, + -cppcoreguidelines-avoid-magic-numbers, + -cppcoreguidelines-macro-usage, + -cppcoreguidelines-special-member-functions, + -cppcoreguidelines-pro-type-vararg, + -cppcoreguidelines-pro-type-member-init, + -cert-err58-cpp, +# (the last -cppcoreguidelines and -cert-err58-cpp lines are temporary) +HeaderFilterRegex: ".*" +CheckOptions: + - { key: performance-unnecessary-value-param.AllowedTypes, value: ((std::shared_ptr)) } diff --git a/.gitignore b/.gitignore index fa2c74069..71aaa392a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/build +/build* !.gitignore *vscode .cache/ @@ -7,3 +7,5 @@ CMakeLists.txt.user __pycache__ !doc/build-with-fetchcontent /dist +clang-tidy-*.yaml +clang-tidy-*.txt diff --git a/3rd_party/websocketpp_utils/base64.hpp b/3rd_party/websocketpp_utils/base64.hpp index 9ef499e69..e2c35d324 100644 --- a/3rd_party/websocketpp_utils/base64.hpp +++ b/3rd_party/websocketpp_utils/base64.hpp @@ -33,14 +33,14 @@ */ -#ifndef _BASE64_EVEREST_HPP_ -#define _BASE64_EVEREST_HPP_ +#ifndef BASE64_EVEREST_HPP_ +#define BASE64_EVEREST_HPP_ #include namespace ocpp { -static std::string const base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +static const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; @@ -62,14 +62,14 @@ static inline bool is_base64(unsigned char c) { * @param len The length of input in bytes * @return A base64 encoded string representing input */ -inline std::string base64_encode(unsigned char const* input, size_t len) { +inline std::string base64_encode(const unsigned char* input, size_t len) { std::string ret; int i = 0; int j = 0; unsigned char char_array_3[3]; unsigned char char_array_4[4]; - while (len--) { + while ((len--) != 0) { char_array_3[i++] = *(input++); if (i == 3) { char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; @@ -84,7 +84,7 @@ inline std::string base64_encode(unsigned char const* input, size_t len) { } } - if (i) { + if (i != 0) { for (j = i; j < 3; j++) { char_array_3[j] = '\0'; } @@ -111,7 +111,7 @@ inline std::string base64_encode(unsigned char const* input, size_t len) { * @param input The input data * @return A base64 encoded string representing input */ -inline std::string base64_encode(std::string const& input) { +inline std::string base64_encode(const std::string& input) { return base64_encode(reinterpret_cast(input.data()), input.size()); } @@ -120,15 +120,16 @@ inline std::string base64_encode(std::string const& input) { * @param input The base64 encoded input data * @return A string representing the decoded raw bytes */ -inline std::string base64_decode(std::string const& input) { +inline std::string base64_decode(const std::string& input) { size_t in_len = input.size(); int i = 0; int j = 0; int in_ = 0; - unsigned char char_array_4[4], char_array_3[3]; + unsigned char char_array_4[4]; + unsigned char char_array_3[3]; std::string ret; - while (in_len-- && (input[in_] != '=') && is_base64(input[in_])) { + while (((in_len--) != 0) && (input[in_] != '=') && is_base64(input[in_])) { char_array_4[i++] = input[in_]; in_++; if (i == 4) { @@ -147,12 +148,14 @@ inline std::string base64_decode(std::string const& input) { } } - if (i) { - for (j = i; j < 4; j++) + if (i != 0) { + for (j = i; j < 4; j++) { char_array_4[j] = 0; + } - for (j = 0; j < 4; j++) + for (j = 0; j < 4; j++) { char_array_4[j] = static_cast(base64_chars.find(char_array_4[j])); + } char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); @@ -168,4 +171,4 @@ inline std::string base64_decode(std::string const& input) { } // namespace ocpp -#endif // _BASE64_HPP_ \ No newline at end of file +#endif // BASE64_EVEREST_HPP_ diff --git a/3rd_party/websocketpp_utils/uri.hpp b/3rd_party/websocketpp_utils/uri.hpp index e61c98517..985a37e33 100644 --- a/3rd_party/websocketpp_utils/uri.hpp +++ b/3rd_party/websocketpp_utils/uri.hpp @@ -29,6 +29,7 @@ #define WEBSOCKETPP_URI_EVEREST_HPP #include +#include #include #include #include @@ -38,20 +39,20 @@ namespace ocpp { // TODO: figure out why this fixes horrible linking errors. /// Default port for ws:// -static uint16_t const uri_default_port = 80; +static const uint16_t uri_default_port = 80; /// Default port for wss:// -static uint16_t const uri_default_secure_port = 443; +static const uint16_t uri_default_secure_port = 443; class uri { public: - explicit uri(std::string const& uri_string) : m_valid(false) { + explicit uri(const std::string& uri_string) : m_valid(false) { std::string::const_iterator it; std::string::const_iterator temp; int state = 0; it = uri_string.begin(); - size_t uri_len = uri_string.length(); + const size_t uri_len = uri_string.length(); if (uri_len >= 7 && std::equal(it, it + 6, "wss://")) { m_secure = true; @@ -95,11 +96,11 @@ class uri { if (temp == uri_string.end()) { return; - } else { - // validate IPv6 literal parts - // can contain numbers, a-f and A-F - m_host.append(it, temp); } + // validate IPv6 literal parts + // can contain numbers, a-f and A-F + m_host.append(it, temp); + it = temp + 1; if (it == uri_string.end()) { state = 2; @@ -120,7 +121,8 @@ class uri { if (it == uri_string.end()) { state = 2; break; - } else if (*it == '/') { + } + if (*it == '/') { state = 2; } else if (*it == ':') { // end hostname start port @@ -141,7 +143,8 @@ class uri { // refactoring // state = 3; break; - } else if (*it == '/') { + } + if (*it == '/') { state = 3; } else { port += *it; @@ -155,7 +158,7 @@ class uri { m_resource.append(it, uri_string.end()); } - uri(bool secure, std::string const& host, uint16_t port, std::string const& resource) : + uri(bool secure, const std::string& host, uint16_t port, const std::string& resource) : m_scheme(secure ? "wss" : "ws"), m_host(host), m_resource(resource.empty() ? "/" : resource), @@ -164,7 +167,7 @@ class uri { m_valid(true) { } - uri(bool secure, std::string const& host, std::string const& resource) : + uri(bool secure, const std::string& host, const std::string& resource) : m_scheme(secure ? "wss" : "ws"), m_host(host), m_resource(resource.empty() ? "/" : resource), @@ -173,12 +176,12 @@ class uri { m_valid(true) { } - uri(bool secure, std::string const& host, std::string const& port, std::string const& resource) : + uri(bool secure, const std::string& host, const std::string& port, const std::string& resource) : m_scheme(secure ? "wss" : "ws"), m_host(host), m_resource(resource.empty() ? "/" : resource), m_secure(secure) { m_port = get_port_from_string(port, m_valid); } - uri(std::string const& scheme, std::string const& host, uint16_t port, std::string const& resource) : + uri(const std::string& scheme, const std::string& host, uint16_t port, const std::string& resource) : m_scheme(scheme), m_host(host), m_resource(resource.empty() ? "/" : resource), @@ -187,7 +190,7 @@ class uri { m_valid(true) { } - uri(std::string scheme, std::string const& host, std::string const& resource) : + uri(std::string scheme, const std::string& host, const std::string& resource) : m_scheme(scheme), m_host(host), m_resource(resource.empty() ? "/" : resource), @@ -196,7 +199,7 @@ class uri { m_valid(true) { } - uri(std::string const& scheme, std::string const& host, std::string const& port, std::string const& resource) : + uri(const std::string& scheme, const std::string& host, const std::string& port, const std::string& resource) : m_scheme(scheme), m_host(host), m_resource(resource.empty() ? "/" : resource), @@ -212,22 +215,21 @@ class uri { return m_secure; } - std::string const& get_scheme() const { + const std::string& get_scheme() const { return m_scheme; } - std::string const& get_host() const { + const std::string& get_host() const { return m_host; } std::string get_host_port() const { if (m_port == (m_secure ? uri_default_secure_port : uri_default_port)) { return m_host; - } else { - std::stringstream p; - p << m_host << ":" << m_port; - return p.str(); } + std::stringstream p; + p << m_host << ":" << m_port; + return p.str(); } std::string get_authority() const { @@ -246,7 +248,7 @@ class uri { return p.str(); } - std::string const& get_resource() const { + const std::string& get_resource() const { return m_resource; } @@ -271,22 +273,21 @@ class uri { * @return query portion of the URI. */ std::string get_query() const { - std::size_t found = m_resource.find('?'); + const std::size_t found = m_resource.find('?'); if (found != std::string::npos) { return m_resource.substr(found + 1); - } else { - return ""; } + return ""; } private: - uint16_t get_port_from_string(std::string const& port, bool& out_valid) const { + uint16_t get_port_from_string(const std::string& port, bool& out_valid) const { out_valid = true; if (port.empty()) { return (m_secure ? uri_default_secure_port : uri_default_port); } - unsigned int t_port = static_cast(atoi(port.c_str())); + const auto t_port = std::stoul(port); if (t_port > 65535) { out_valid = false; @@ -302,9 +303,9 @@ class uri { std::string m_scheme; std::string m_host; std::string m_resource; - uint16_t m_port; - bool m_secure; - bool m_valid; + uint16_t m_port = 0; + bool m_secure = false; + bool m_valid = false; }; } // namespace ocpp diff --git a/include/ocpp/common/aligned_timer.hpp b/include/ocpp/common/aligned_timer.hpp index b3331d1d4..032553d43 100644 --- a/include/ocpp/common/aligned_timer.hpp +++ b/include/ocpp/common/aligned_timer.hpp @@ -15,7 +15,7 @@ class ClockAlignedTimer : private Everest::Timer { private: system_time_point start_point; - std::chrono::seconds call_interval; + std::chrono::seconds call_interval = std::chrono::seconds(0); std::function callback; diff --git a/include/ocpp/common/call_types.hpp b/include/ocpp/common/call_types.hpp index 18b93fd7f..842ff6f8f 100644 --- a/include/ocpp/common/call_types.hpp +++ b/include/ocpp/common/call_types.hpp @@ -10,7 +10,6 @@ #include #include -#include #include #include @@ -49,7 +48,7 @@ enum class MessageTypeId { CALL = 2, CALLRESULT = 3, CALLERROR = 4, - UNKNOWN, + UNKNOWN = 5, }; /// \brief Creates a unique message ID @@ -62,19 +61,15 @@ template struct Call { MessageId uniqueId; /// \brief Creates a new Call message object - Call() { - } + Call() = default; /// \brief Creates a new Call message object with the given OCPP message \p msg - explicit Call(T msg) { - this->msg = msg; + explicit Call(T msg) : msg(msg) { this->uniqueId = create_message_id(); } /// \brief Creates a new Call message object with the given OCPP message \p msg and \p uniqueId - Call(T msg, MessageId uniqueId) { - this->msg = msg; - this->uniqueId = uniqueId; + Call(T msg, MessageId uniqueId) : msg(msg), uniqueId(uniqueId) { } /// \brief Conversion from a given Call message \p c to a given json object \p j @@ -107,13 +102,10 @@ template struct CallResult { MessageId uniqueId; /// \brief Creates a new CallResult message object - CallResult() { - } + CallResult() = default; /// \brief Creates a new CallResult message object with the given OCPP message \p msg and \p uniqueID - CallResult(T msg, MessageId uniqueId) { - this->msg = msg; - this->uniqueId = uniqueId; + CallResult(T msg, MessageId uniqueId) : msg(msg), uniqueId(uniqueId) { } /// \brief Conversion from a given CallResult message \p c to a given json object \p j diff --git a/include/ocpp/common/cistring.hpp b/include/ocpp/common/cistring.hpp index cdd70a091..67d758bc3 100644 --- a/include/ocpp/common/cistring.hpp +++ b/include/ocpp/common/cistring.hpp @@ -36,7 +36,7 @@ template class CiString : public String { /// \brief CaseInsensitive string implementation only allows printable ASCII characters bool is_valid(std::string_view data) { - for (char character : data) { + for (const char& character : data) { // printable ASCII starts at code 0x20 (space) and ends with code 0x7e (tilde) and 0xa (\n) if ((character < 0x20 || character > 0x7e) && character != 0xa) { throw std::runtime_error("CiString can only contain printable ASCII characters"); diff --git a/include/ocpp/common/database/database_handler_common.hpp b/include/ocpp/common/database/database_handler_common.hpp index 268608e5d..5b5160f1c 100644 --- a/include/ocpp/common/database/database_handler_common.hpp +++ b/include/ocpp/common/database/database_handler_common.hpp @@ -40,7 +40,7 @@ class DatabaseHandlerCommon { explicit DatabaseHandlerCommon(std::unique_ptr database, const fs::path& sql_migration_files_path, uint32_t target_schema_version) noexcept; - ~DatabaseHandlerCommon() = default; + virtual ~DatabaseHandlerCommon() = default; /// \brief Opens connection to database file and performs the initialization by calling init_sql() void open_connection(); diff --git a/include/ocpp/common/evse_security.hpp b/include/ocpp/common/evse_security.hpp index 84670dc17..e7afad337 100644 --- a/include/ocpp/common/evse_security.hpp +++ b/include/ocpp/common/evse_security.hpp @@ -17,6 +17,8 @@ namespace ocpp { class EvseSecurity { public: + virtual ~EvseSecurity() = default; + /// \brief Installs the CA \p certificate for the given \p certificate_type . This function respects the /// requirements of OCPP specified for the CSMS initiated message InstallCertificate.req . /// \param certificate PEM formatted CA certificate diff --git a/include/ocpp/common/evse_security_impl.hpp b/include/ocpp/common/evse_security_impl.hpp index 16a424ac3..0a2a0d0ed 100644 --- a/include/ocpp/common/evse_security_impl.hpp +++ b/include/ocpp/common/evse_security_impl.hpp @@ -33,7 +33,7 @@ class EvseSecurityImpl : public EvseSecurity { std::unique_ptr evse_security; public: - explicit EvseSecurityImpl(const SecurityConfiguration& file_paths); + explicit EvseSecurityImpl(const SecurityConfiguration& security_configuration); InstallCertificateResult install_ca_certificate(const std::string& certificate, const CaCertificateType& certificate_type) override; DeleteCertificateResult delete_certificate(const CertificateHashDataType& certificate_hash_data) override; diff --git a/include/ocpp/common/message_dispatcher.hpp b/include/ocpp/common/message_dispatcher.hpp index 20594d507..c9905a9e9 100644 --- a/include/ocpp/common/message_dispatcher.hpp +++ b/include/ocpp/common/message_dispatcher.hpp @@ -13,7 +13,7 @@ namespace ocpp { template class MessageDispatcherInterface { public: - virtual ~MessageDispatcherInterface(){}; + virtual ~MessageDispatcherInterface() = default; /// \brief Dispatches a Call message. /// \param call the OCPP Call message. diff --git a/include/ocpp/common/message_queue.hpp b/include/ocpp/common/message_queue.hpp index bb958e11e..ec1ada552 100644 --- a/include/ocpp/common/message_queue.hpp +++ b/include/ocpp/common/message_queue.hpp @@ -25,12 +25,12 @@ namespace ocpp { template struct MessageQueueConfig { - int transaction_message_attempts; - int transaction_message_retry_interval; // seconds + int transaction_message_attempts = 0; + int transaction_message_retry_interval = 0; // seconds // threshold for the accumulated sizes of the queues; if the queues exceed this limit, // messages are potentially dropped in accordance with OCPP 2.0.1. Specification (cf. QueueAllMessages parameter) - int queues_total_size_threshold; + int queues_total_size_threshold = 0; bool queue_all_messages{false}; // cf. OCPP 2.0.1. "QueueAllMessages" in OCPPCommCtrlr std::set message_types_discard_for_queueing; // allows to discard certain message types for offline queuing (e.g. @@ -50,11 +50,11 @@ template struct MessageQueueConfig { /// \brief Contains a OCPP message in json form with additional information template struct EnhancedMessage { - json message; ///< The OCPP message as json - size_t message_size; ///< size of the json message in bytes - MessageId uniqueId; ///< The unique ID of the json message - M messageType = M::InternalError; ///< The OCPP message type - MessageTypeId messageTypeId; ///< The OCPP message type ID (CALL/CALLRESULT/CALLERROR) + json message; ///< The OCPP message as json + size_t message_size = 0; ///< size of the json message in bytes + MessageId uniqueId; ///< The unique ID of the json message + M messageType = M::InternalError; ///< The OCPP message type + MessageTypeId messageTypeId = MessageTypeId::UNKNOWN; ///< The OCPP message type ID (CALL/CALLRESULT/CALLERROR) json call_message; ///< If the message is a CALLRESULT or CALLERROR this can contain the original CALL message bool offline = false; ///< A flag indicating if the connection to the central system is offline }; @@ -218,8 +218,8 @@ template class MessageQueue { return MessageId(json_message.at(MESSAGE_ID).get()); } MessageTypeId getMessageTypeId(const json::array_t& json_message) { - if (json_message.size() > 0) { - auto messageTypeId = json_message.at(MESSAGE_TYPE_ID); + if (not json_message.empty()) { + const auto& messageTypeId = json_message.at(MESSAGE_TYPE_ID); if (messageTypeId == MessageTypeId::CALL) { return MessageTypeId::CALL; } @@ -243,7 +243,7 @@ template class MessageQueue { void add_to_normal_message_queue(std::shared_ptr> message) { EVLOG_debug << "Adding message to normal message queue"; { - std::lock_guard lk(this->message_mutex); + const std::lock_guard lk(this->message_mutex); // A BootNotification message should always jump the queue if (message->messageType == M::BootNotification) { this->normal_message_queue.push_front(message); @@ -251,7 +251,7 @@ template class MessageQueue { this->normal_message_queue.push_back(message); } if (this->config.check_queue(message->messageType)) { - ocpp::common::DBTransactionMessage db_message{ + const ocpp::common::DBTransactionMessage db_message{ message->message, messagetype_to_string(message->messageType), message->message_attempts, message->timestamp, message->uniqueId()}; try { @@ -269,11 +269,11 @@ template class MessageQueue { void add_to_transaction_message_queue(std::shared_ptr> message) { EVLOG_debug << "Adding message to transaction message queue"; { - std::lock_guard lk(this->message_mutex); + const std::lock_guard lk(this->message_mutex); this->transaction_message_queue.push_back(message); - ocpp::common::DBTransactionMessage db_message{message->message, messagetype_to_string(message->messageType), - message->message_attempts, message->timestamp, - message->uniqueId()}; + const ocpp::common::DBTransactionMessage db_message{ + message->message, messagetype_to_string(message->messageType), message->message_attempts, + message->timestamp, message->uniqueId()}; try { this->database_handler->insert_message_queue_message(db_message); } catch (const everest::db::QueryExecutionException& e) { @@ -309,8 +309,8 @@ template class MessageQueue { void drop_messages_from_normal_message_queue() { // try to drop approx 10% of the allowed size (at least 1) - int number_of_dropped_messages = std::min((int)this->normal_message_queue.size(), - std::max(this->config.queues_total_size_threshold / 10, 1)); + const int number_of_dropped_messages = std::min((int)this->normal_message_queue.size(), + std::max(this->config.queues_total_size_threshold / 10, 1)); EVLOG_warning << "Dropping " << number_of_dropped_messages << " messages from normal message queue."; @@ -366,15 +366,14 @@ template class MessageQueue { if (drop_count > 0) { EVLOG_warning << "Dropped " << drop_count << " transactional update messages to reduce queue size."; return true; - } else { - EVLOG_warning << "There are no further transaction update messages to drop!"; - return false; } + EVLOG_warning << "There are no further transaction update messages to drop!"; + return false; } // The public resume() delegates the actual resumption to this method void resume_now(u_int64_t expected_pause_resume_ctr) { - std::lock_guard lk(this->message_mutex); + const std::lock_guard lk(this->message_mutex); if (this->pause_resume_ctr == expected_pause_resume_ctr) { this->paused = false; this->resuming = false; @@ -394,7 +393,7 @@ template class MessageQueue { MessageQueue( const std::function& send_callback, const MessageQueueConfig& config, const std::vector& external_notify, std::shared_ptr database_handler, - const std::function + const std::function& start_transaction_message_retry_callback = [](const std::string& new_message_id, const std::string& old_message_id) {}) : database_handler(std::move(database_handler)), @@ -405,10 +404,9 @@ template class MessageQueue { running(true), new_message(false), is_registration_status_accepted(false), - start_transaction_message_retry_callback(start_transaction_message_retry_callback) { - - this->send_callback = send_callback; - this->in_flight = nullptr; + start_transaction_message_retry_callback(start_transaction_message_retry_callback), + send_callback(send_callback), + in_flight(nullptr) { } MessageQueue(const std::function& send_callback, const MessageQueueConfig& config, @@ -445,9 +443,8 @@ template class MessageQueue { if (this->in_flight != nullptr) { // There already is a message in flight, not progressing further continue; - } else { - EVLOG_debug << "There is no message in flight, checking message queue for a new message."; } + EVLOG_debug << "There is no message in flight, checking message queue for a new message."; // prioritize the message with the oldest timestamp std::shared_ptr> message = nullptr; @@ -504,7 +501,7 @@ template class MessageQueue { } { - std::lock_guard lk(this->next_message_mutex); + const std::lock_guard lk(this->next_message_mutex); if (next_message_to_send.has_value()) { if (next_message_to_send.value() != message->uniqueId()) { EVLOG_debug << "Message with id " << message->uniqueId() @@ -577,13 +574,13 @@ template class MessageQueue { /// \brief Resets next message to send. Can be used in situation when we dont want to reply to a CALL message void reset_next_message_to_send() { - std::lock_guard lk(this->next_message_mutex); + const std::lock_guard lk(this->next_message_mutex); this->next_message_to_send.reset(); } /// \brief Gets all persisted messages of normal message queue and persisted message queue from the database void get_persisted_messages_from_db(bool ignore_security_event_notifications = false) { - std::vector queue_types = {QueueType::Normal, QueueType::Transaction}; + const std::vector queue_types = {QueueType::Normal, QueueType::Transaction}; // do for Normal and Transaction queue for (const auto queue_type : queue_types) { const auto persisted_messages = database_handler->get_message_queue_messages(queue_type); @@ -602,7 +599,7 @@ template class MessageQueue { EVLOG_warning << "Could not delete message from message queue: " << e.what(); } } else { - std::shared_ptr> message = + const std::shared_ptr> message = std::make_shared>(persisted_message.json_message, true); message->messageType = string_to_messagetype(persisted_message.message_type); message->timestamp = persisted_message.timestamp; @@ -657,7 +654,7 @@ template class MessageQueue { } this->send_callback(call_result); { - std::lock_guard lk(this->next_message_mutex); + const std::lock_guard lk(this->next_message_mutex); if (next_message_to_send.has_value()) { if (next_message_to_send.value() == static_cast(call_result.at(MESSAGE_ID))) { next_message_to_send.reset(); @@ -676,7 +673,7 @@ template class MessageQueue { this->send_callback(call_error); { - std::lock_guard lk(this->next_message_mutex); + const std::lock_guard lk(this->next_message_mutex); if (next_message_to_send.has_value()) { if (next_message_to_send.value() == call_error.uniqueId) { next_message_to_send.reset(); @@ -731,7 +728,7 @@ template class MessageQueue { enhanced_message.call_message = enhanced_message.message; { - std::lock_guard lk(this->next_message_mutex); + const std::lock_guard lk(this->next_message_mutex); // save the uid of the message we just received to ensure the next message we send is a response to // this message next_message_to_send.emplace(enhanced_message.uniqueId); @@ -742,7 +739,7 @@ template class MessageQueue { if (enhanced_message.messageTypeId == MessageTypeId::CALLRESULT || enhanced_message.messageTypeId == MessageTypeId::CALLERROR) { { - std::lock_guard lk(this->next_message_mutex); + const std::lock_guard lk(this->next_message_mutex); next_message_to_send.reset(); } // we need to remove Call messages from in_flight if we receive a CallResult OR a CallError @@ -812,9 +809,9 @@ template class MessageQueue { /// \brief Handles a message timeout or a CALLERROR. \p enhanced_message_opt is set only in case of CALLERROR void handle_timeout_or_callerror(const std::optional>& enhanced_message_opt) { - std::lock_guard lk(this->message_mutex); + const std::lock_guard lk(this->message_mutex); // We got a timeout iff enhanced_message_opt is empty. Otherwise, enhanced_message_opt contains the CallError. - bool timeout = !enhanced_message_opt.has_value(); + const bool timeout = !enhanced_message_opt.has_value(); if (timeout) { EVLOG_warning << "Message timeout for: " << this->in_flight->messageType << " (" << this->in_flight->uniqueId() << ")"; @@ -834,8 +831,8 @@ template class MessageQueue { // exponential backoff this->in_flight->timestamp = DateTime(this->in_flight->timestamp.to_time_point() + - std::chrono::seconds(this->config.transaction_message_retry_interval) * - this->in_flight->message_attempts); + (std::chrono::seconds(this->config.transaction_message_retry_interval) * + this->in_flight->message_attempts)); EVLOG_debug << "Retry interval > 0: " << this->config.transaction_message_retry_interval << " attempting to retry message at: " << this->in_flight->timestamp; } else { @@ -926,7 +923,7 @@ template class MessageQueue { /// \brief Pauses the message queue void pause() { EVLOG_debug << "pause()"; - std::lock_guard lk(this->message_mutex); + const std::lock_guard lk(this->message_mutex); this->pause_resume_ctr++; this->resume_timer.stop(); this->paused = true; @@ -938,7 +935,7 @@ template class MessageQueue { /// \brief Resumes the message queue void resume(std::chrono::seconds delay_on_reconnect) { EVLOG_debug << "resume() called"; - std::lock_guard lk(this->message_mutex); + const std::lock_guard lk(this->message_mutex); if (!this->paused) { return; } @@ -947,7 +944,7 @@ template class MessageQueue { if (this->pause_resume_ctr > 1 && delay_on_reconnect > std::chrono::seconds(0)) { this->resuming = true; EVLOG_debug << "Delaying message queue resume by " << delay_on_reconnect.count() << " seconds"; - u_int64_t expected_pause_resume_ctr = this->pause_resume_ctr; + const u_int64_t expected_pause_resume_ctr = this->pause_resume_ctr; this->resume_timer.timeout( [this, expected_pause_resume_ctr] { this->resume_now(expected_pause_resume_ctr); }, delay_on_reconnect); } else { @@ -957,22 +954,22 @@ template class MessageQueue { void set_registration_status_accepted() { { - std::lock_guard lk(this->message_mutex); + const std::lock_guard lk(this->message_mutex); this->is_registration_status_accepted = true; } this->cv.notify_all(); } bool is_transaction_message_queue_empty() { - std::lock_guard lk(this->message_mutex); + const std::lock_guard lk(this->message_mutex); return this->transaction_message_queue.empty(); } - bool contains_transaction_messages(const CiString<36> transaction_id) { - std::lock_guard lk(this->message_mutex); - for (const auto control_message : this->transaction_message_queue) { + bool contains_transaction_messages(const CiString<36>& transaction_id) { + const std::lock_guard lk(this->message_mutex); + for (const auto& control_message : this->transaction_message_queue) { if (control_message->messageType == v2::MessageType::TransactionEvent) { - v2::TransactionEventRequest req = control_message->message.at(CALL_PAYLOAD); + const v2::TransactionEventRequest req = control_message->message.at(CALL_PAYLOAD); if (req.transactionInfo.transactionId == transaction_id) { return true; } @@ -982,10 +979,10 @@ template class MessageQueue { } bool contains_stop_transaction_message(const int32_t transaction_id) { - std::lock_guard lk(this->message_mutex); - for (const auto control_message : this->transaction_message_queue) { + const std::lock_guard lk(this->message_mutex); + for (const auto& control_message : this->transaction_message_queue) { if (control_message->messageType == v16::MessageType::StopTransaction) { - v16::StopTransactionRequest req = control_message->message.at(CALL_PAYLOAD); + const v16::StopTransactionRequest req = control_message->message.at(CALL_PAYLOAD); if (req.transactionId == transaction_id) { return true; } @@ -1018,7 +1015,7 @@ template class MessageQueue { void add_meter_value_message_id(const std::string& start_transaction_message_id, const std::string& meter_value_message_id) { - if (this->start_transaction_mid_meter_values_mid_map.count(start_transaction_message_id)) { + if (this->start_transaction_mid_meter_values_mid_map.count(start_transaction_message_id) != 0) { this->start_transaction_mid_meter_values_mid_map.at(start_transaction_message_id) .push_back(meter_value_message_id); } else { @@ -1034,8 +1031,8 @@ template class MessageQueue { // replace transaction id in meter values if start_transaction_message_id is present in map // this is necessary when the chargepoint queued MeterValue.req for a transaction with unknown transaction_id - std::lock_guard lk(this->message_mutex); - if (this->start_transaction_mid_meter_values_mid_map.count(start_transaction_message_id)) { + const std::lock_guard lk(this->message_mutex); + if (this->start_transaction_mid_meter_values_mid_map.count(start_transaction_message_id) != 0) { for (auto it = this->transaction_message_queue.begin(); it != transaction_message_queue.end(); ++it) { for (const auto& meter_value_message_id : this->start_transaction_mid_meter_values_mid_map.at(start_transaction_message_id)) { diff --git a/include/ocpp/common/ocpp_logging.hpp b/include/ocpp/common/ocpp_logging.hpp index 975acd004..ad158b935 100644 --- a/include/ocpp/common/ocpp_logging.hpp +++ b/include/ocpp/common/ocpp_logging.hpp @@ -91,18 +91,6 @@ class MessageLogging { /// \brief Format the given \p json_str with the given \p message_type FormattedMessageWithType format_message(const std::string& message_type, const std::string& json_str); - /// \brief Add opening html tags to the given stream \p os - void open_html_tags(std::ofstream& os); - - /// \brief Add closing html tags to the given stream \p os - void close_html_tags(std::ofstream& os); - - /// \returns a datetime string in YearMonthDayHourMinuteSecond format - std::string get_datetime_string(); - - /// \returns file size of the given path or 0 if the file does not exist - std::uintmax_t file_size(const std::filesystem::path& path); - /// \brief Rotates the log at the given file \p file_basename and remove oldest file if there are more log files /// than the maximum LogRotationStatus rotate_log(const std::string& file_basename); @@ -158,7 +146,7 @@ class MessageLogging { std::string get_message_log_path(); /// \returns If session logging is active - bool session_logging_active(); + bool session_logging_active() const; }; } // namespace ocpp diff --git a/include/ocpp/common/safe_queue.hpp b/include/ocpp/common/safe_queue.hpp index 5486d0cb7..ea9521cbd 100644 --- a/include/ocpp/common/safe_queue.hpp +++ b/include/ocpp/common/safe_queue.hpp @@ -15,20 +15,20 @@ namespace ocpp { template class SafeQueue { public: /// \return True if the queue is empty - inline bool empty() const { - std::lock_guard lock(mutex); + bool empty() const { + const std::lock_guard lock(mutex); return queue.empty(); } /// \brief We return a copy here, since while might be accessing the /// reference while another thread uses pop and makes the reference stale - inline T front() { - std::lock_guard lock(mutex); + T front() { + const std::lock_guard lock(mutex); return queue.front(); } /// \return retrieves and removes the first element in the queue. Undefined behavior if the queue is empty - inline T pop() { + T pop() { std::unique_lock lock(mutex); T front = std::move(queue.front()); @@ -43,19 +43,19 @@ template class SafeQueue { } /// \brief Queues an element and notifies any threads waiting on the internal conditional variable - inline void push(T&& value) { + void push(T&& value) { { - std::lock_guard lock(mutex); - queue.push(value); + const std::lock_guard lock(mutex); + queue.push(std::move(value)); } notify_waiting_thread(); } /// \brief Queues an element and notifies any threads waiting on the internal conditional variable - inline void push(const T& value) { + void push(const T& value) { { - std::lock_guard lock(mutex); + const std::lock_guard lock(mutex); queue.push(value); } @@ -63,9 +63,9 @@ template class SafeQueue { } /// \brief Clears the queue - inline void clear() { + void clear() { { - std::lock_guard lock(mutex); + const std::lock_guard lock(mutex); std::queue empty; empty.swap(queue); @@ -76,14 +76,14 @@ template class SafeQueue { /// \brief Waits for the queue to receive an element /// \param timeout to wait for an element, pass in a value <= 0 to wait indefinitely - inline void wait_on_queue_element(std::chrono::milliseconds timeout = std::chrono::milliseconds(0)) { + void wait_on_queue_element(std::chrono::milliseconds timeout = std::chrono::milliseconds(0)) { wait_on_queue_element_or_predicate([]() { return false; }, timeout); } /// \brief Same as 'wait_on_queue' but receives an additional predicate to wait upon template - inline void wait_on_queue_element_or_predicate(Predicate pred, - std::chrono::milliseconds timeout = std::chrono::milliseconds(0)) { + void wait_on_queue_element_or_predicate(Predicate pred, + std::chrono::milliseconds timeout = std::chrono::milliseconds(0)) { std::unique_lock lock(mutex); if (timeout.count() > 0) { @@ -96,7 +96,7 @@ template class SafeQueue { /// \brief Waits on the queue for a custom event /// \param timeout to wait for an element, pass in a value <= 0 to wait indefinitely template - inline void wait_on_custom_event(Predicate pred, std::chrono::milliseconds timeout = std::chrono::milliseconds(0)) { + void wait_on_custom_event(Predicate pred, std::chrono::milliseconds timeout = std::chrono::milliseconds(0)) { std::unique_lock lock(mutex); if (timeout.count() > 0) { @@ -107,7 +107,7 @@ template class SafeQueue { } /// \brief Notifies a single waiting thread to wake up - inline void notify_waiting_thread() { + void notify_waiting_thread() { cv.notify_one(); } diff --git a/include/ocpp/common/string.hpp b/include/ocpp/common/string.hpp index eaa71e2ea..3ca86b27e 100644 --- a/include/ocpp/common/string.hpp +++ b/include/ocpp/common/string.hpp @@ -48,10 +48,11 @@ template class String { /// \brief Sets the content of the string to the given \p data void set(const std::string& data, StringTooLarge to_large = StringTooLarge::Throw) { std::string_view view = data; - if (view.length() > this->length) { + if (view.length() > String::length) { if (to_large == StringTooLarge::Throw) { throw StringConversionException("String length (" + std::to_string(view.length()) + - ") exceeds permitted length (" + std::to_string(this->length) + ")"); + ") exceeds permitted length (" + std::to_string(String::length) + + ")"); } // Truncate view = view.substr(0, length); diff --git a/include/ocpp/common/types.hpp b/include/ocpp/common/types.hpp index 753535d0e..d135304b6 100644 --- a/include/ocpp/common/types.hpp +++ b/include/ocpp/common/types.hpp @@ -31,6 +31,7 @@ struct Message { /// \brief Provides the type of the message /// \returns the message type as a string virtual std::string get_type() const = 0; + virtual ~Message() = default; }; /// \brief Exception used when DateTime class is initialized by invalid timepoint string. @@ -81,7 +82,7 @@ class DateTimeImpl { /// \brief Conversion operatpr std::string returns a RFC 3339 compatible string representation of the stored /// DateTime - operator std::string() { + operator std::string() const { return this->to_rfc3339(); } @@ -152,7 +153,7 @@ class StringToEnumException : public EnumConversionException { }; /// \brief Contains the different connection states of the charge point -enum SessionStartedReason { +enum class SessionStartedReason { EVConnected, Authorized }; @@ -292,7 +293,7 @@ struct Powermeter { }; struct StateOfCharge { - float value; ///< State of Charge in percent + float value = 0; ///< State of Charge in percent std::optional location; ///< Location of the State of Charge measurement /// \brief Conversion from a given StateOfCharge \p k to a given json object \p j @@ -307,7 +308,7 @@ struct StateOfCharge { }; struct Temperature { - float value; ///< Temperature in degree Celsius + float value = 0; ///< Temperature in degree Celsius std::optional location; ///< Location of the Temperature measurement /// \brief Conversion from a given Temperature \p k to a given json object \p j @@ -322,7 +323,7 @@ struct Temperature { }; struct RPM { - float value; ///< RPM + float value = 0; ///< RPM std::optional location; ///< Location of the RPM measurement /// \brief Conversion from a given RPM \p k to a given json object \p j @@ -598,9 +599,9 @@ std::string certificate_type_to_string(CertificateType e); CertificateType string_to_certificate_type(const std::string& s); } // namespace conversions -/// \brief Writes the string representation of the given CertificateType \p ceritficate_type to +/// \brief Writes the string representation of the given CertificateType \p certificate_type to /// the given output stream \p os \returns an output stream with the CertificateType written to -std::ostream& operator<<(std::ostream& os, const CertificateType& ceritficate_type); +std::ostream& operator<<(std::ostream& os, const CertificateType& certificate_type); struct CertificateHashDataChain { CertificateHashDataType certificateHashData; @@ -704,7 +705,7 @@ struct CertificateInfo { }; struct GetCertificateInfoResult { - GetCertificateInfoStatus status; + GetCertificateInfoStatus status = GetCertificateInfoStatus::Rejected; std::optional info; }; @@ -768,8 +769,8 @@ firmware_status_notification_to_firmware_status_enum_type(const FirmwareStatusNo namespace security { // The security profiles defined in OCPP 2.0.1 resp. in the OCPP 1.6 security-whitepaper. -enum SecurityProfile { // no "enum class" because values are used in implicit `switch`-comparisons to `int - // security_profile` +// NOLINTNEXTLINE(cppcoreguidelines-use-enum-class): used in implicit `switch`-comparisons to `int security_profile` +enum SecurityProfile { OCPP_1_6_ONLY_UNSECURED_TRANSPORT_WITHOUT_BASIC_AUTHENTICATION = 0, UNSECURED_TRANSPORT_WITH_BASIC_AUTHENTICATION = 1, TLS_WITH_BASIC_AUTHENTICATION = 2, diff --git a/include/ocpp/common/utils.hpp b/include/ocpp/common/utils.hpp index b27bbc2f7..5c0a5f923 100644 --- a/include/ocpp/common/utils.hpp +++ b/include/ocpp/common/utils.hpp @@ -40,6 +40,15 @@ std::vector split_string(const std::string& string_to_split, const /// std::string trim_string(const std::string& string_to_trim); +/// +/// \brief Clamp the value to the maximum value of the given type +/// \param len The value to clamp +/// \return The clamped value +template T constexpr clamp_to(U len) { + return (len <= std::numeric_limits::max()) ? static_cast(len) : std::numeric_limits::max(); +} + +std::size_t convert_to_positive_size_t(float value); } // namespace ocpp #endif diff --git a/include/ocpp/common/websocket/websocket_base.hpp b/include/ocpp/common/websocket/websocket_base.hpp index d7d624760..c87ec14b2 100644 --- a/include/ocpp/common/websocket/websocket_base.hpp +++ b/include/ocpp/common/websocket/websocket_base.hpp @@ -71,7 +71,8 @@ class WebsocketBase { std::optional getAuthorizationHeader(); /// \brief Logs websocket connection error - void log_on_fail(const std::error_code& ec, const boost::system::error_code& transport_ec, const int http_status); + static void log_on_fail(const std::error_code& ec, const boost::system::error_code& transport_ec, + const int http_status); /// \brief Calculates and returns the reconnect interval based on int retry_backoff_random_range_s, /// retry_backoff_repeat_times, int retry_backoff_wait_minimum_s of the WebsocketConnectionOptions diff --git a/include/ocpp/common/websocket/websocket_libwebsockets.hpp b/include/ocpp/common/websocket/websocket_libwebsockets.hpp index b27ca4f61..012e9335a 100644 --- a/include/ocpp/common/websocket/websocket_libwebsockets.hpp +++ b/include/ocpp/common/websocket/websocket_libwebsockets.hpp @@ -25,7 +25,7 @@ class WebsocketLibwebsockets final : public WebsocketBase { explicit WebsocketLibwebsockets(const WebsocketConnectionOptions& connection_options, std::shared_ptr evse_security); - ~WebsocketLibwebsockets(); + ~WebsocketLibwebsockets() override; void set_connection_options(const WebsocketConnectionOptions& connection_options) override; @@ -44,14 +44,12 @@ class WebsocketLibwebsockets final : public WebsocketBase { /// \return True if the websocket is connected or trying to connect, false otherwise bool is_trying_to_connect(); -public: int process_callback(void* wsi_ptr, int callback_reason, void* user, void* in, size_t len); private: bool is_trying_to_connect_internal(); void close_internal(const WebsocketCloseReason code, const std::string& reason); -private: /// \brief Initializes the connection options, including the security info /// \return True if it was successful, false otherwise bool initialize_connection_options(std::shared_ptr& new_connection_data); @@ -98,7 +96,6 @@ class WebsocketLibwebsockets final : public WebsocketBase { /// \brief Clears all messages and message queues both incoming and outgoing void clear_all_queues(); -private: std::shared_ptr evse_security; // Connection related data diff --git a/include/ocpp/common/websocket/websocket_uri.hpp b/include/ocpp/common/websocket/websocket_uri.hpp index 171e05cd4..42ef6732f 100644 --- a/include/ocpp/common/websocket/websocket_uri.hpp +++ b/include/ocpp/common/websocket/websocket_uri.hpp @@ -3,6 +3,7 @@ #ifndef OCPP_WEBSOCKET_URI_HPP #define OCPP_WEBSOCKET_URI_HPP +#include #include #include @@ -10,10 +11,10 @@ namespace ocpp { -typedef ocpp::uri ev_uri; +using ev_uri = ocpp::uri; class Uri { public: - Uri(){}; + Uri() = default; // clang-format off /// \brief parse_and_validate parses the \p uri and checks @@ -46,7 +47,7 @@ class Uri { return this->path_without_chargepoint_id; } - uint16_t get_port() { + uint16_t get_port() const { return this->port; } @@ -70,9 +71,9 @@ class Uri { chargepoint_id(chargepoint_id) { } - bool secure; + bool secure = false; std::string host; - uint16_t port; + uint16_t port = 0; std::string path_without_chargepoint_id; std::string chargepoint_id; }; diff --git a/include/ocpp/v16/charge_point_configuration.hpp b/include/ocpp/v16/charge_point_configuration.hpp index 7f06b3472..7b6149e84 100644 --- a/include/ocpp/v16/charge_point_configuration.hpp +++ b/include/ocpp/v16/charge_point_configuration.hpp @@ -40,8 +40,6 @@ class ChargePointConfiguration { bool isConnectorPhaseRotationValid(std::string str); - bool checkTimeOffset(const std::string& offset); - void setChargepointInformationProperty(json& user_config, const std::string& key, const std::optional& value); diff --git a/include/ocpp/v16/charge_point_impl.hpp b/include/ocpp/v16/charge_point_impl.hpp index deb497dc8..6dca791a6 100644 --- a/include/ocpp/v16/charge_point_impl.hpp +++ b/include/ocpp/v16/charge_point_impl.hpp @@ -225,8 +225,6 @@ class ChargePointImpl : ocpp::ChargingStationBase { std::optional get_latest_meter_value(int32_t connector, std::vector values_of_interest, ReadingContext context); - MeterValue get_signed_meter_value(const std::string& signed_value, const ReadingContext& context, - const ocpp::DateTime& datetime); void send_meter_value(int32_t connector, MeterValue meter_value, bool initiated_by_trigger_message = false); void send_meter_value_on_pricing_trigger(const int32_t connector_number, std::shared_ptr connector, const Measurement& measurement); @@ -264,11 +262,6 @@ class ChargePointImpl : ocpp::ChargingStationBase { void stop_transaction(int32_t connector, Reason reason, std::optional> id_tag_end); - /// \brief Converts the given \p measurands_csv to a vector of Measurands - /// \param measurands_csv - /// \return - std::vector get_measurands_vec(const std::string& measurands_csv); - /// \brief Returns transaction data that can be used to set the transactionData field in StopTransaction.req. /// Filters the meter values of the transaction according to the values set within StopTxnAlignedData and /// StopTxnSampledData @@ -417,8 +410,7 @@ class ChargePointImpl : ocpp::ChargingStationBase { const fs::path& message_log_path, const std::shared_ptr evse_security, const std::optional security_configuration); - ~ChargePointImpl() { - } + ~ChargePointImpl() override = default; /// \brief Allow to update the ChargePoint core information which will be sent in BootNotification.req void update_chargepoint_information(const std::string& vendor, const std::string& model, diff --git a/include/ocpp/v16/database_handler.hpp b/include/ocpp/v16/database_handler.hpp index cbdf64aa3..4de0af63c 100644 --- a/include/ocpp/v16/database_handler.hpp +++ b/include/ocpp/v16/database_handler.hpp @@ -80,7 +80,7 @@ class DatabaseHandler : public ocpp::common::DatabaseHandlerCommon { /// \brief Updates the METER_LAST and METER_LAST_TIME column for the transaction with the given \p session_id in the /// TRANSACTIONS table void update_transaction_meter_value(const std::string& session_id, const int32_t value, - const std::string& timestamp); + const std::string& last_meter_time); /// \brief Returns a list of all transactions in the database. If \p filter_complete is true, only incomplete /// transactions will be return. If \p filter_complete is false, all transactions will be returned diff --git a/include/ocpp/v16/messages/Authorize.hpp b/include/ocpp/v16/messages/Authorize.hpp index 5eb2fb5ef..0f4a2a9a4 100644 --- a/include/ocpp/v16/messages/Authorize.hpp +++ b/include/ocpp/v16/messages/Authorize.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_AUTHORIZE_HPP diff --git a/include/ocpp/v16/messages/BootNotification.hpp b/include/ocpp/v16/messages/BootNotification.hpp index 21ab3c2ee..fbab5c46b 100644 --- a/include/ocpp/v16/messages/BootNotification.hpp +++ b/include/ocpp/v16/messages/BootNotification.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_BOOTNOTIFICATION_HPP diff --git a/include/ocpp/v16/messages/CancelReservation.hpp b/include/ocpp/v16/messages/CancelReservation.hpp index 294d2abf4..147f6e874 100644 --- a/include/ocpp/v16/messages/CancelReservation.hpp +++ b/include/ocpp/v16/messages/CancelReservation.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_CANCELRESERVATION_HPP diff --git a/include/ocpp/v16/messages/CertificateSigned.hpp b/include/ocpp/v16/messages/CertificateSigned.hpp index 4d42fbbaf..d20a6efb9 100644 --- a/include/ocpp/v16/messages/CertificateSigned.hpp +++ b/include/ocpp/v16/messages/CertificateSigned.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_CERTIFICATESIGNED_HPP diff --git a/include/ocpp/v16/messages/ChangeAvailability.hpp b/include/ocpp/v16/messages/ChangeAvailability.hpp index e68d2e42b..02c5405e2 100644 --- a/include/ocpp/v16/messages/ChangeAvailability.hpp +++ b/include/ocpp/v16/messages/ChangeAvailability.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_CHANGEAVAILABILITY_HPP @@ -49,7 +49,8 @@ void to_json(json& j, const ChangeAvailabilityResponse& k); void from_json(const json& j, ChangeAvailabilityResponse& k); /// \brief Writes the string representation of the given ChangeAvailabilityResponse \p k to the given output stream \p -/// os \returns an output stream with the ChangeAvailabilityResponse written to +/// os +/// \returns an output stream with the ChangeAvailabilityResponse written to std::ostream& operator<<(std::ostream& os, const ChangeAvailabilityResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/ChangeConfiguration.hpp b/include/ocpp/v16/messages/ChangeConfiguration.hpp index cea6152b3..b5d9da9d9 100644 --- a/include/ocpp/v16/messages/ChangeConfiguration.hpp +++ b/include/ocpp/v16/messages/ChangeConfiguration.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_CHANGECONFIGURATION_HPP @@ -31,7 +31,8 @@ void to_json(json& j, const ChangeConfigurationRequest& k); void from_json(const json& j, ChangeConfigurationRequest& k); /// \brief Writes the string representation of the given ChangeConfigurationRequest \p k to the given output stream \p -/// os \returns an output stream with the ChangeConfigurationRequest written to +/// os +/// \returns an output stream with the ChangeConfigurationRequest written to std::ostream& operator<<(std::ostream& os, const ChangeConfigurationRequest& k); /// \brief Contains a OCPP ChangeConfigurationResponse message @@ -50,7 +51,8 @@ void to_json(json& j, const ChangeConfigurationResponse& k); void from_json(const json& j, ChangeConfigurationResponse& k); /// \brief Writes the string representation of the given ChangeConfigurationResponse \p k to the given output stream \p -/// os \returns an output stream with the ChangeConfigurationResponse written to +/// os +/// \returns an output stream with the ChangeConfigurationResponse written to std::ostream& operator<<(std::ostream& os, const ChangeConfigurationResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/ClearCache.hpp b/include/ocpp/v16/messages/ClearCache.hpp index caabaec4b..7c653db25 100644 --- a/include/ocpp/v16/messages/ClearCache.hpp +++ b/include/ocpp/v16/messages/ClearCache.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_CLEARCACHE_HPP diff --git a/include/ocpp/v16/messages/ClearChargingProfile.hpp b/include/ocpp/v16/messages/ClearChargingProfile.hpp index 94e92b715..035c5d1d6 100644 --- a/include/ocpp/v16/messages/ClearChargingProfile.hpp +++ b/include/ocpp/v16/messages/ClearChargingProfile.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_CLEARCHARGINGPROFILE_HPP @@ -33,7 +33,8 @@ void to_json(json& j, const ClearChargingProfileRequest& k); void from_json(const json& j, ClearChargingProfileRequest& k); /// \brief Writes the string representation of the given ClearChargingProfileRequest \p k to the given output stream \p -/// os \returns an output stream with the ClearChargingProfileRequest written to +/// os +/// \returns an output stream with the ClearChargingProfileRequest written to std::ostream& operator<<(std::ostream& os, const ClearChargingProfileRequest& k); /// \brief Contains a OCPP ClearChargingProfileResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const ClearChargingProfileResponse& k); void from_json(const json& j, ClearChargingProfileResponse& k); /// \brief Writes the string representation of the given ClearChargingProfileResponse \p k to the given output stream \p -/// os \returns an output stream with the ClearChargingProfileResponse written to +/// os +/// \returns an output stream with the ClearChargingProfileResponse written to std::ostream& operator<<(std::ostream& os, const ClearChargingProfileResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/DataTransfer.hpp b/include/ocpp/v16/messages/DataTransfer.hpp index effd9c477..ae8de021f 100644 --- a/include/ocpp/v16/messages/DataTransfer.hpp +++ b/include/ocpp/v16/messages/DataTransfer.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_DATATRANSFER_HPP diff --git a/include/ocpp/v16/messages/DeleteCertificate.hpp b/include/ocpp/v16/messages/DeleteCertificate.hpp index 36b576b54..9adb90917 100644 --- a/include/ocpp/v16/messages/DeleteCertificate.hpp +++ b/include/ocpp/v16/messages/DeleteCertificate.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_DELETECERTIFICATE_HPP diff --git a/include/ocpp/v16/messages/DiagnosticsStatusNotification.hpp b/include/ocpp/v16/messages/DiagnosticsStatusNotification.hpp index db1b116a5..d576f17e4 100644 --- a/include/ocpp/v16/messages/DiagnosticsStatusNotification.hpp +++ b/include/ocpp/v16/messages/DiagnosticsStatusNotification.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_DIAGNOSTICSSTATUSNOTIFICATION_HPP @@ -29,7 +29,8 @@ void to_json(json& j, const DiagnosticsStatusNotificationRequest& k); void from_json(const json& j, DiagnosticsStatusNotificationRequest& k); /// \brief Writes the string representation of the given DiagnosticsStatusNotificationRequest \p k to the given output -/// stream \p os \returns an output stream with the DiagnosticsStatusNotificationRequest written to +/// stream \p os +/// \returns an output stream with the DiagnosticsStatusNotificationRequest written to std::ostream& operator<<(std::ostream& os, const DiagnosticsStatusNotificationRequest& k); /// \brief Contains a OCPP DiagnosticsStatusNotificationResponse message @@ -47,7 +48,8 @@ void to_json(json& j, const DiagnosticsStatusNotificationResponse& k); void from_json(const json& j, DiagnosticsStatusNotificationResponse& k); /// \brief Writes the string representation of the given DiagnosticsStatusNotificationResponse \p k to the given output -/// stream \p os \returns an output stream with the DiagnosticsStatusNotificationResponse written to +/// stream \p os +/// \returns an output stream with the DiagnosticsStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const DiagnosticsStatusNotificationResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/ExtendedTriggerMessage.hpp b/include/ocpp/v16/messages/ExtendedTriggerMessage.hpp index 11f98a0c0..5411ad563 100644 --- a/include/ocpp/v16/messages/ExtendedTriggerMessage.hpp +++ b/include/ocpp/v16/messages/ExtendedTriggerMessage.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_EXTENDEDTRIGGERMESSAGE_HPP @@ -31,7 +31,8 @@ void to_json(json& j, const ExtendedTriggerMessageRequest& k); void from_json(const json& j, ExtendedTriggerMessageRequest& k); /// \brief Writes the string representation of the given ExtendedTriggerMessageRequest \p k to the given output stream -/// \p os \returns an output stream with the ExtendedTriggerMessageRequest written to +/// \p os +/// \returns an output stream with the ExtendedTriggerMessageRequest written to std::ostream& operator<<(std::ostream& os, const ExtendedTriggerMessageRequest& k); /// \brief Contains a OCPP ExtendedTriggerMessageResponse message @@ -50,7 +51,8 @@ void to_json(json& j, const ExtendedTriggerMessageResponse& k); void from_json(const json& j, ExtendedTriggerMessageResponse& k); /// \brief Writes the string representation of the given ExtendedTriggerMessageResponse \p k to the given output stream -/// \p os \returns an output stream with the ExtendedTriggerMessageResponse written to +/// \p os +/// \returns an output stream with the ExtendedTriggerMessageResponse written to std::ostream& operator<<(std::ostream& os, const ExtendedTriggerMessageResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/FirmwareStatusNotification.hpp b/include/ocpp/v16/messages/FirmwareStatusNotification.hpp index 2ee7a0400..381b0eb14 100644 --- a/include/ocpp/v16/messages/FirmwareStatusNotification.hpp +++ b/include/ocpp/v16/messages/FirmwareStatusNotification.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_FIRMWARESTATUSNOTIFICATION_HPP @@ -29,7 +29,8 @@ void to_json(json& j, const FirmwareStatusNotificationRequest& k); void from_json(const json& j, FirmwareStatusNotificationRequest& k); /// \brief Writes the string representation of the given FirmwareStatusNotificationRequest \p k to the given output -/// stream \p os \returns an output stream with the FirmwareStatusNotificationRequest written to +/// stream \p os +/// \returns an output stream with the FirmwareStatusNotificationRequest written to std::ostream& operator<<(std::ostream& os, const FirmwareStatusNotificationRequest& k); /// \brief Contains a OCPP FirmwareStatusNotificationResponse message @@ -47,7 +48,8 @@ void to_json(json& j, const FirmwareStatusNotificationResponse& k); void from_json(const json& j, FirmwareStatusNotificationResponse& k); /// \brief Writes the string representation of the given FirmwareStatusNotificationResponse \p k to the given output -/// stream \p os \returns an output stream with the FirmwareStatusNotificationResponse written to +/// stream \p os +/// \returns an output stream with the FirmwareStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const FirmwareStatusNotificationResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/GetCompositeSchedule.hpp b/include/ocpp/v16/messages/GetCompositeSchedule.hpp index 8d409a2a9..0f5935a4e 100644 --- a/include/ocpp/v16/messages/GetCompositeSchedule.hpp +++ b/include/ocpp/v16/messages/GetCompositeSchedule.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_GETCOMPOSITESCHEDULE_HPP @@ -32,7 +32,8 @@ void to_json(json& j, const GetCompositeScheduleRequest& k); void from_json(const json& j, GetCompositeScheduleRequest& k); /// \brief Writes the string representation of the given GetCompositeScheduleRequest \p k to the given output stream \p -/// os \returns an output stream with the GetCompositeScheduleRequest written to +/// os +/// \returns an output stream with the GetCompositeScheduleRequest written to std::ostream& operator<<(std::ostream& os, const GetCompositeScheduleRequest& k); /// \brief Contains a OCPP GetCompositeScheduleResponse message @@ -54,7 +55,8 @@ void to_json(json& j, const GetCompositeScheduleResponse& k); void from_json(const json& j, GetCompositeScheduleResponse& k); /// \brief Writes the string representation of the given GetCompositeScheduleResponse \p k to the given output stream \p -/// os \returns an output stream with the GetCompositeScheduleResponse written to +/// os +/// \returns an output stream with the GetCompositeScheduleResponse written to std::ostream& operator<<(std::ostream& os, const GetCompositeScheduleResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/GetConfiguration.hpp b/include/ocpp/v16/messages/GetConfiguration.hpp index 286839f68..f88d93b12 100644 --- a/include/ocpp/v16/messages/GetConfiguration.hpp +++ b/include/ocpp/v16/messages/GetConfiguration.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_GETCONFIGURATION_HPP diff --git a/include/ocpp/v16/messages/GetDiagnostics.hpp b/include/ocpp/v16/messages/GetDiagnostics.hpp index 995375c98..7b4d12f28 100644 --- a/include/ocpp/v16/messages/GetDiagnostics.hpp +++ b/include/ocpp/v16/messages/GetDiagnostics.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_GETDIAGNOSTICS_HPP diff --git a/include/ocpp/v16/messages/GetInstalledCertificateIds.hpp b/include/ocpp/v16/messages/GetInstalledCertificateIds.hpp index ac6c5f4f5..e0d7b67c0 100644 --- a/include/ocpp/v16/messages/GetInstalledCertificateIds.hpp +++ b/include/ocpp/v16/messages/GetInstalledCertificateIds.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_GETINSTALLEDCERTIFICATEIDS_HPP @@ -30,7 +30,8 @@ void to_json(json& j, const GetInstalledCertificateIdsRequest& k); void from_json(const json& j, GetInstalledCertificateIdsRequest& k); /// \brief Writes the string representation of the given GetInstalledCertificateIdsRequest \p k to the given output -/// stream \p os \returns an output stream with the GetInstalledCertificateIdsRequest written to +/// stream \p os +/// \returns an output stream with the GetInstalledCertificateIdsRequest written to std::ostream& operator<<(std::ostream& os, const GetInstalledCertificateIdsRequest& k); /// \brief Contains a OCPP GetInstalledCertificateIdsResponse message @@ -50,7 +51,8 @@ void to_json(json& j, const GetInstalledCertificateIdsResponse& k); void from_json(const json& j, GetInstalledCertificateIdsResponse& k); /// \brief Writes the string representation of the given GetInstalledCertificateIdsResponse \p k to the given output -/// stream \p os \returns an output stream with the GetInstalledCertificateIdsResponse written to +/// stream \p os +/// \returns an output stream with the GetInstalledCertificateIdsResponse written to std::ostream& operator<<(std::ostream& os, const GetInstalledCertificateIdsResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/GetLocalListVersion.hpp b/include/ocpp/v16/messages/GetLocalListVersion.hpp index c34baa90e..3dcc9c5b8 100644 --- a/include/ocpp/v16/messages/GetLocalListVersion.hpp +++ b/include/ocpp/v16/messages/GetLocalListVersion.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_GETLOCALLISTVERSION_HPP @@ -27,7 +27,8 @@ void to_json(json& j, const GetLocalListVersionRequest& k); void from_json(const json& j, GetLocalListVersionRequest& k); /// \brief Writes the string representation of the given GetLocalListVersionRequest \p k to the given output stream \p -/// os \returns an output stream with the GetLocalListVersionRequest written to +/// os +/// \returns an output stream with the GetLocalListVersionRequest written to std::ostream& operator<<(std::ostream& os, const GetLocalListVersionRequest& k); /// \brief Contains a OCPP GetLocalListVersionResponse message @@ -46,7 +47,8 @@ void to_json(json& j, const GetLocalListVersionResponse& k); void from_json(const json& j, GetLocalListVersionResponse& k); /// \brief Writes the string representation of the given GetLocalListVersionResponse \p k to the given output stream \p -/// os \returns an output stream with the GetLocalListVersionResponse written to +/// os +/// \returns an output stream with the GetLocalListVersionResponse written to std::ostream& operator<<(std::ostream& os, const GetLocalListVersionResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/GetLog.hpp b/include/ocpp/v16/messages/GetLog.hpp index f570ab023..f72e7b94d 100644 --- a/include/ocpp/v16/messages/GetLog.hpp +++ b/include/ocpp/v16/messages/GetLog.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_GETLOG_HPP diff --git a/include/ocpp/v16/messages/Heartbeat.hpp b/include/ocpp/v16/messages/Heartbeat.hpp index c8c84f78a..3aabb45c7 100644 --- a/include/ocpp/v16/messages/Heartbeat.hpp +++ b/include/ocpp/v16/messages/Heartbeat.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_HEARTBEAT_HPP diff --git a/include/ocpp/v16/messages/InstallCertificate.hpp b/include/ocpp/v16/messages/InstallCertificate.hpp index 539a85e55..99fd46f46 100644 --- a/include/ocpp/v16/messages/InstallCertificate.hpp +++ b/include/ocpp/v16/messages/InstallCertificate.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_INSTALLCERTIFICATE_HPP @@ -49,7 +49,8 @@ void to_json(json& j, const InstallCertificateResponse& k); void from_json(const json& j, InstallCertificateResponse& k); /// \brief Writes the string representation of the given InstallCertificateResponse \p k to the given output stream \p -/// os \returns an output stream with the InstallCertificateResponse written to +/// os +/// \returns an output stream with the InstallCertificateResponse written to std::ostream& operator<<(std::ostream& os, const InstallCertificateResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/LogStatusNotification.hpp b/include/ocpp/v16/messages/LogStatusNotification.hpp index f0592935f..6139c8e31 100644 --- a/include/ocpp/v16/messages/LogStatusNotification.hpp +++ b/include/ocpp/v16/messages/LogStatusNotification.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_LOGSTATUSNOTIFICATION_HPP @@ -31,7 +31,8 @@ void to_json(json& j, const LogStatusNotificationRequest& k); void from_json(const json& j, LogStatusNotificationRequest& k); /// \brief Writes the string representation of the given LogStatusNotificationRequest \p k to the given output stream \p -/// os \returns an output stream with the LogStatusNotificationRequest written to +/// os +/// \returns an output stream with the LogStatusNotificationRequest written to std::ostream& operator<<(std::ostream& os, const LogStatusNotificationRequest& k); /// \brief Contains a OCPP LogStatusNotificationResponse message @@ -49,7 +50,8 @@ void to_json(json& j, const LogStatusNotificationResponse& k); void from_json(const json& j, LogStatusNotificationResponse& k); /// \brief Writes the string representation of the given LogStatusNotificationResponse \p k to the given output stream -/// \p os \returns an output stream with the LogStatusNotificationResponse written to +/// \p os +/// \returns an output stream with the LogStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const LogStatusNotificationResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/MeterValues.hpp b/include/ocpp/v16/messages/MeterValues.hpp index 437969453..b61b325e6 100644 --- a/include/ocpp/v16/messages/MeterValues.hpp +++ b/include/ocpp/v16/messages/MeterValues.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_METERVALUES_HPP diff --git a/include/ocpp/v16/messages/RemoteStartTransaction.hpp b/include/ocpp/v16/messages/RemoteStartTransaction.hpp index e486b637f..90e0c4ffd 100644 --- a/include/ocpp/v16/messages/RemoteStartTransaction.hpp +++ b/include/ocpp/v16/messages/RemoteStartTransaction.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_REMOTESTARTTRANSACTION_HPP @@ -33,7 +33,8 @@ void to_json(json& j, const RemoteStartTransactionRequest& k); void from_json(const json& j, RemoteStartTransactionRequest& k); /// \brief Writes the string representation of the given RemoteStartTransactionRequest \p k to the given output stream -/// \p os \returns an output stream with the RemoteStartTransactionRequest written to +/// \p os +/// \returns an output stream with the RemoteStartTransactionRequest written to std::ostream& operator<<(std::ostream& os, const RemoteStartTransactionRequest& k); /// \brief Contains a OCPP RemoteStartTransactionResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const RemoteStartTransactionResponse& k); void from_json(const json& j, RemoteStartTransactionResponse& k); /// \brief Writes the string representation of the given RemoteStartTransactionResponse \p k to the given output stream -/// \p os \returns an output stream with the RemoteStartTransactionResponse written to +/// \p os +/// \returns an output stream with the RemoteStartTransactionResponse written to std::ostream& operator<<(std::ostream& os, const RemoteStartTransactionResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/RemoteStopTransaction.hpp b/include/ocpp/v16/messages/RemoteStopTransaction.hpp index 95e2b86b0..72b9790cd 100644 --- a/include/ocpp/v16/messages/RemoteStopTransaction.hpp +++ b/include/ocpp/v16/messages/RemoteStopTransaction.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_REMOTESTOPTRANSACTION_HPP @@ -29,7 +29,8 @@ void to_json(json& j, const RemoteStopTransactionRequest& k); void from_json(const json& j, RemoteStopTransactionRequest& k); /// \brief Writes the string representation of the given RemoteStopTransactionRequest \p k to the given output stream \p -/// os \returns an output stream with the RemoteStopTransactionRequest written to +/// os +/// \returns an output stream with the RemoteStopTransactionRequest written to std::ostream& operator<<(std::ostream& os, const RemoteStopTransactionRequest& k); /// \brief Contains a OCPP RemoteStopTransactionResponse message @@ -48,7 +49,8 @@ void to_json(json& j, const RemoteStopTransactionResponse& k); void from_json(const json& j, RemoteStopTransactionResponse& k); /// \brief Writes the string representation of the given RemoteStopTransactionResponse \p k to the given output stream -/// \p os \returns an output stream with the RemoteStopTransactionResponse written to +/// \p os +/// \returns an output stream with the RemoteStopTransactionResponse written to std::ostream& operator<<(std::ostream& os, const RemoteStopTransactionResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/ReserveNow.hpp b/include/ocpp/v16/messages/ReserveNow.hpp index bd7bde960..6ab81c10e 100644 --- a/include/ocpp/v16/messages/ReserveNow.hpp +++ b/include/ocpp/v16/messages/ReserveNow.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_RESERVENOW_HPP diff --git a/include/ocpp/v16/messages/Reset.hpp b/include/ocpp/v16/messages/Reset.hpp index 8d4427960..b061b43c6 100644 --- a/include/ocpp/v16/messages/Reset.hpp +++ b/include/ocpp/v16/messages/Reset.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_RESET_HPP diff --git a/include/ocpp/v16/messages/SecurityEventNotification.hpp b/include/ocpp/v16/messages/SecurityEventNotification.hpp index dea034102..d7d2c9a49 100644 --- a/include/ocpp/v16/messages/SecurityEventNotification.hpp +++ b/include/ocpp/v16/messages/SecurityEventNotification.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_SECURITYEVENTNOTIFICATION_HPP @@ -32,7 +32,8 @@ void to_json(json& j, const SecurityEventNotificationRequest& k); void from_json(const json& j, SecurityEventNotificationRequest& k); /// \brief Writes the string representation of the given SecurityEventNotificationRequest \p k to the given output -/// stream \p os \returns an output stream with the SecurityEventNotificationRequest written to +/// stream \p os +/// \returns an output stream with the SecurityEventNotificationRequest written to std::ostream& operator<<(std::ostream& os, const SecurityEventNotificationRequest& k); /// \brief Contains a OCPP SecurityEventNotificationResponse message @@ -50,7 +51,8 @@ void to_json(json& j, const SecurityEventNotificationResponse& k); void from_json(const json& j, SecurityEventNotificationResponse& k); /// \brief Writes the string representation of the given SecurityEventNotificationResponse \p k to the given output -/// stream \p os \returns an output stream with the SecurityEventNotificationResponse written to +/// stream \p os +/// \returns an output stream with the SecurityEventNotificationResponse written to std::ostream& operator<<(std::ostream& os, const SecurityEventNotificationResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/SendLocalList.hpp b/include/ocpp/v16/messages/SendLocalList.hpp index 6fca46d54..1b25b1dac 100644 --- a/include/ocpp/v16/messages/SendLocalList.hpp +++ b/include/ocpp/v16/messages/SendLocalList.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_SENDLOCALLIST_HPP diff --git a/include/ocpp/v16/messages/SetChargingProfile.hpp b/include/ocpp/v16/messages/SetChargingProfile.hpp index 0faf19b26..f543dee17 100644 --- a/include/ocpp/v16/messages/SetChargingProfile.hpp +++ b/include/ocpp/v16/messages/SetChargingProfile.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_SETCHARGINGPROFILE_HPP @@ -50,7 +50,8 @@ void to_json(json& j, const SetChargingProfileResponse& k); void from_json(const json& j, SetChargingProfileResponse& k); /// \brief Writes the string representation of the given SetChargingProfileResponse \p k to the given output stream \p -/// os \returns an output stream with the SetChargingProfileResponse written to +/// os +/// \returns an output stream with the SetChargingProfileResponse written to std::ostream& operator<<(std::ostream& os, const SetChargingProfileResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/SignCertificate.hpp b/include/ocpp/v16/messages/SignCertificate.hpp index a63c7b87a..a66cf803f 100644 --- a/include/ocpp/v16/messages/SignCertificate.hpp +++ b/include/ocpp/v16/messages/SignCertificate.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_SIGNCERTIFICATE_HPP diff --git a/include/ocpp/v16/messages/SignedFirmwareStatusNotification.hpp b/include/ocpp/v16/messages/SignedFirmwareStatusNotification.hpp index 169f62f6a..a3cfacc8b 100644 --- a/include/ocpp/v16/messages/SignedFirmwareStatusNotification.hpp +++ b/include/ocpp/v16/messages/SignedFirmwareStatusNotification.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_SIGNEDFIRMWARESTATUSNOTIFICATION_HPP @@ -31,7 +31,8 @@ void to_json(json& j, const SignedFirmwareStatusNotificationRequest& k); void from_json(const json& j, SignedFirmwareStatusNotificationRequest& k); /// \brief Writes the string representation of the given SignedFirmwareStatusNotificationRequest \p k to the given -/// output stream \p os \returns an output stream with the SignedFirmwareStatusNotificationRequest written to +/// output stream \p os +/// \returns an output stream with the SignedFirmwareStatusNotificationRequest written to std::ostream& operator<<(std::ostream& os, const SignedFirmwareStatusNotificationRequest& k); /// \brief Contains a OCPP SignedFirmwareStatusNotificationResponse message @@ -49,7 +50,8 @@ void to_json(json& j, const SignedFirmwareStatusNotificationResponse& k); void from_json(const json& j, SignedFirmwareStatusNotificationResponse& k); /// \brief Writes the string representation of the given SignedFirmwareStatusNotificationResponse \p k to the given -/// output stream \p os \returns an output stream with the SignedFirmwareStatusNotificationResponse written to +/// output stream \p os +/// \returns an output stream with the SignedFirmwareStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const SignedFirmwareStatusNotificationResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/SignedUpdateFirmware.hpp b/include/ocpp/v16/messages/SignedUpdateFirmware.hpp index c5920a36b..e829ac7ea 100644 --- a/include/ocpp/v16/messages/SignedUpdateFirmware.hpp +++ b/include/ocpp/v16/messages/SignedUpdateFirmware.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_SIGNEDUPDATEFIRMWARE_HPP @@ -33,7 +33,8 @@ void to_json(json& j, const SignedUpdateFirmwareRequest& k); void from_json(const json& j, SignedUpdateFirmwareRequest& k); /// \brief Writes the string representation of the given SignedUpdateFirmwareRequest \p k to the given output stream \p -/// os \returns an output stream with the SignedUpdateFirmwareRequest written to +/// os +/// \returns an output stream with the SignedUpdateFirmwareRequest written to std::ostream& operator<<(std::ostream& os, const SignedUpdateFirmwareRequest& k); /// \brief Contains a OCPP SignedUpdateFirmwareResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const SignedUpdateFirmwareResponse& k); void from_json(const json& j, SignedUpdateFirmwareResponse& k); /// \brief Writes the string representation of the given SignedUpdateFirmwareResponse \p k to the given output stream \p -/// os \returns an output stream with the SignedUpdateFirmwareResponse written to +/// os +/// \returns an output stream with the SignedUpdateFirmwareResponse written to std::ostream& operator<<(std::ostream& os, const SignedUpdateFirmwareResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/StartTransaction.hpp b/include/ocpp/v16/messages/StartTransaction.hpp index 6052c929e..76bf214da 100644 --- a/include/ocpp/v16/messages/StartTransaction.hpp +++ b/include/ocpp/v16/messages/StartTransaction.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_STARTTRANSACTION_HPP diff --git a/include/ocpp/v16/messages/StatusNotification.hpp b/include/ocpp/v16/messages/StatusNotification.hpp index ad9113b21..b53999153 100644 --- a/include/ocpp/v16/messages/StatusNotification.hpp +++ b/include/ocpp/v16/messages/StatusNotification.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_STATUSNOTIFICATION_HPP @@ -55,7 +55,8 @@ void to_json(json& j, const StatusNotificationResponse& k); void from_json(const json& j, StatusNotificationResponse& k); /// \brief Writes the string representation of the given StatusNotificationResponse \p k to the given output stream \p -/// os \returns an output stream with the StatusNotificationResponse written to +/// os +/// \returns an output stream with the StatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const StatusNotificationResponse& k); } // namespace v16 diff --git a/include/ocpp/v16/messages/StopTransaction.hpp b/include/ocpp/v16/messages/StopTransaction.hpp index 307d45432..0675e71ab 100644 --- a/include/ocpp/v16/messages/StopTransaction.hpp +++ b/include/ocpp/v16/messages/StopTransaction.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_STOPTRANSACTION_HPP diff --git a/include/ocpp/v16/messages/TriggerMessage.hpp b/include/ocpp/v16/messages/TriggerMessage.hpp index 64b937506..6597b3405 100644 --- a/include/ocpp/v16/messages/TriggerMessage.hpp +++ b/include/ocpp/v16/messages/TriggerMessage.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_TRIGGERMESSAGE_HPP diff --git a/include/ocpp/v16/messages/UnlockConnector.hpp b/include/ocpp/v16/messages/UnlockConnector.hpp index 15c5cdc43..22bfcce8e 100644 --- a/include/ocpp/v16/messages/UnlockConnector.hpp +++ b/include/ocpp/v16/messages/UnlockConnector.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_UNLOCKCONNECTOR_HPP diff --git a/include/ocpp/v16/messages/UpdateFirmware.hpp b/include/ocpp/v16/messages/UpdateFirmware.hpp index a855005b3..458a7d9c5 100644 --- a/include/ocpp/v16/messages/UpdateFirmware.hpp +++ b/include/ocpp/v16/messages/UpdateFirmware.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_UPDATEFIRMWARE_HPP diff --git a/include/ocpp/v16/ocpp_enums.hpp b/include/ocpp/v16/ocpp_enums.hpp index d5ba713f4..570f700d0 100644 --- a/include/ocpp/v16/ocpp_enums.hpp +++ b/include/ocpp/v16/ocpp_enums.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_OCPP_ENUMS_HPP @@ -31,7 +31,8 @@ AuthorizationStatus string_to_authorization_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given AuthorizationStatus \p authorization_status to the given output -/// stream \p os \returns an output stream with the AuthorizationStatus written to +/// stream \p os +/// \returns an output stream with the AuthorizationStatus written to std::ostream& operator<<(std::ostream& os, const AuthorizationStatus& authorization_status); // from: BootNotificationResponse @@ -52,7 +53,8 @@ RegistrationStatus string_to_registration_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given RegistrationStatus \p registration_status to the given output -/// stream \p os \returns an output stream with the RegistrationStatus written to +/// stream \p os +/// \returns an output stream with the RegistrationStatus written to std::ostream& operator<<(std::ostream& os, const RegistrationStatus& registration_status); // from: CancelReservationResponse @@ -72,7 +74,8 @@ CancelReservationStatus string_to_cancel_reservation_status(const std::string& s } // namespace conversions /// \brief Writes the string representation of the given CancelReservationStatus \p cancel_reservation_status to the -/// given output stream \p os \returns an output stream with the CancelReservationStatus written to +/// given output stream \p os +/// \returns an output stream with the CancelReservationStatus written to std::ostream& operator<<(std::ostream& os, const CancelReservationStatus& cancel_reservation_status); // from: CertificateSignedResponse @@ -92,8 +95,8 @@ CertificateSignedStatusEnumType string_to_certificate_signed_status_enum_type(co } // namespace conversions /// \brief Writes the string representation of the given CertificateSignedStatusEnumType \p -/// certificate_signed_status_enum_type to the given output stream \p os \returns an output stream with the -/// CertificateSignedStatusEnumType written to +/// certificate_signed_status_enum_type to the given output stream \p os +/// \returns an output stream with the CertificateSignedStatusEnumType written to std::ostream& operator<<(std::ostream& os, const CertificateSignedStatusEnumType& certificate_signed_status_enum_type); // from: ChangeAvailabilityRequest @@ -113,7 +116,8 @@ AvailabilityType string_to_availability_type(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given AvailabilityType \p availability_type to the given output -/// stream \p os \returns an output stream with the AvailabilityType written to +/// stream \p os +/// \returns an output stream with the AvailabilityType written to std::ostream& operator<<(std::ostream& os, const AvailabilityType& availability_type); // from: ChangeAvailabilityResponse @@ -134,7 +138,8 @@ AvailabilityStatus string_to_availability_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given AvailabilityStatus \p availability_status to the given output -/// stream \p os \returns an output stream with the AvailabilityStatus written to +/// stream \p os +/// \returns an output stream with the AvailabilityStatus written to std::ostream& operator<<(std::ostream& os, const AvailabilityStatus& availability_status); // from: ChangeConfigurationResponse @@ -156,7 +161,8 @@ ConfigurationStatus string_to_configuration_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ConfigurationStatus \p configuration_status to the given output -/// stream \p os \returns an output stream with the ConfigurationStatus written to +/// stream \p os +/// \returns an output stream with the ConfigurationStatus written to std::ostream& operator<<(std::ostream& os, const ConfigurationStatus& configuration_status); // from: ClearCacheResponse @@ -176,7 +182,8 @@ ClearCacheStatus string_to_clear_cache_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ClearCacheStatus \p clear_cache_status to the given output -/// stream \p os \returns an output stream with the ClearCacheStatus written to +/// stream \p os +/// \returns an output stream with the ClearCacheStatus written to std::ostream& operator<<(std::ostream& os, const ClearCacheStatus& clear_cache_status); // from: ClearChargingProfileRequest @@ -197,7 +204,8 @@ ChargingProfilePurposeType string_to_charging_profile_purpose_type(const std::st } // namespace conversions /// \brief Writes the string representation of the given ChargingProfilePurposeType \p charging_profile_purpose_type to -/// the given output stream \p os \returns an output stream with the ChargingProfilePurposeType written to +/// the given output stream \p os +/// \returns an output stream with the ChargingProfilePurposeType written to std::ostream& operator<<(std::ostream& os, const ChargingProfilePurposeType& charging_profile_purpose_type); // from: ClearChargingProfileResponse @@ -217,7 +225,8 @@ ClearChargingProfileStatus string_to_clear_charging_profile_status(const std::st } // namespace conversions /// \brief Writes the string representation of the given ClearChargingProfileStatus \p clear_charging_profile_status to -/// the given output stream \p os \returns an output stream with the ClearChargingProfileStatus written to +/// the given output stream \p os +/// \returns an output stream with the ClearChargingProfileStatus written to std::ostream& operator<<(std::ostream& os, const ClearChargingProfileStatus& clear_charging_profile_status); // from: DataTransferResponse @@ -239,7 +248,8 @@ DataTransferStatus string_to_data_transfer_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given DataTransferStatus \p data_transfer_status to the given output -/// stream \p os \returns an output stream with the DataTransferStatus written to +/// stream \p os +/// \returns an output stream with the DataTransferStatus written to std::ostream& operator<<(std::ostream& os, const DataTransferStatus& data_transfer_status); // from: DeleteCertificateRequest @@ -260,7 +270,8 @@ HashAlgorithmEnumType string_to_hash_algorithm_enum_type(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given HashAlgorithmEnumType \p hash_algorithm_enum_type to the given -/// output stream \p os \returns an output stream with the HashAlgorithmEnumType written to +/// output stream \p os +/// \returns an output stream with the HashAlgorithmEnumType written to std::ostream& operator<<(std::ostream& os, const HashAlgorithmEnumType& hash_algorithm_enum_type); // from: DeleteCertificateResponse @@ -281,8 +292,8 @@ DeleteCertificateStatusEnumType string_to_delete_certificate_status_enum_type(co } // namespace conversions /// \brief Writes the string representation of the given DeleteCertificateStatusEnumType \p -/// delete_certificate_status_enum_type to the given output stream \p os \returns an output stream with the -/// DeleteCertificateStatusEnumType written to +/// delete_certificate_status_enum_type to the given output stream \p os +/// \returns an output stream with the DeleteCertificateStatusEnumType written to std::ostream& operator<<(std::ostream& os, const DeleteCertificateStatusEnumType& delete_certificate_status_enum_type); // from: DiagnosticsStatusNotificationRequest @@ -304,7 +315,8 @@ DiagnosticsStatus string_to_diagnostics_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given DiagnosticsStatus \p diagnostics_status to the given output -/// stream \p os \returns an output stream with the DiagnosticsStatus written to +/// stream \p os +/// \returns an output stream with the DiagnosticsStatus written to std::ostream& operator<<(std::ostream& os, const DiagnosticsStatus& diagnostics_status); // from: ExtendedTriggerMessageRequest @@ -329,7 +341,8 @@ MessageTriggerEnumType string_to_message_trigger_enum_type(const std::string& s) } // namespace conversions /// \brief Writes the string representation of the given MessageTriggerEnumType \p message_trigger_enum_type to the -/// given output stream \p os \returns an output stream with the MessageTriggerEnumType written to +/// given output stream \p os +/// \returns an output stream with the MessageTriggerEnumType written to std::ostream& operator<<(std::ostream& os, const MessageTriggerEnumType& message_trigger_enum_type); // from: ExtendedTriggerMessageResponse @@ -350,8 +363,8 @@ TriggerMessageStatusEnumType string_to_trigger_message_status_enum_type(const st } // namespace conversions /// \brief Writes the string representation of the given TriggerMessageStatusEnumType \p -/// trigger_message_status_enum_type to the given output stream \p os \returns an output stream with the -/// TriggerMessageStatusEnumType written to +/// trigger_message_status_enum_type to the given output stream \p os +/// \returns an output stream with the TriggerMessageStatusEnumType written to std::ostream& operator<<(std::ostream& os, const TriggerMessageStatusEnumType& trigger_message_status_enum_type); // from: FirmwareStatusNotificationRequest @@ -376,7 +389,8 @@ FirmwareStatus string_to_firmware_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given FirmwareStatus \p firmware_status to the given output stream \p -/// os \returns an output stream with the FirmwareStatus written to +/// os +/// \returns an output stream with the FirmwareStatus written to std::ostream& operator<<(std::ostream& os, const FirmwareStatus& firmware_status); // from: GetCompositeScheduleRequest @@ -396,7 +410,8 @@ ChargingRateUnit string_to_charging_rate_unit(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ChargingRateUnit \p charging_rate_unit to the given output -/// stream \p os \returns an output stream with the ChargingRateUnit written to +/// stream \p os +/// \returns an output stream with the ChargingRateUnit written to std::ostream& operator<<(std::ostream& os, const ChargingRateUnit& charging_rate_unit); // from: GetCompositeScheduleResponse @@ -416,7 +431,8 @@ GetCompositeScheduleStatus string_to_get_composite_schedule_status(const std::st } // namespace conversions /// \brief Writes the string representation of the given GetCompositeScheduleStatus \p get_composite_schedule_status to -/// the given output stream \p os \returns an output stream with the GetCompositeScheduleStatus written to +/// the given output stream \p os +/// \returns an output stream with the GetCompositeScheduleStatus written to std::ostream& operator<<(std::ostream& os, const GetCompositeScheduleStatus& get_composite_schedule_status); // from: GetInstalledCertificateIdsRequest @@ -436,7 +452,8 @@ CertificateUseEnumType string_to_certificate_use_enum_type(const std::string& s) } // namespace conversions /// \brief Writes the string representation of the given CertificateUseEnumType \p certificate_use_enum_type to the -/// given output stream \p os \returns an output stream with the CertificateUseEnumType written to +/// given output stream \p os +/// \returns an output stream with the CertificateUseEnumType written to std::ostream& operator<<(std::ostream& os, const CertificateUseEnumType& certificate_use_enum_type); // from: GetInstalledCertificateIdsResponse @@ -456,8 +473,8 @@ GetInstalledCertificateStatusEnumType string_to_get_installed_certificate_status } // namespace conversions /// \brief Writes the string representation of the given GetInstalledCertificateStatusEnumType \p -/// get_installed_certificate_status_enum_type to the given output stream \p os \returns an output stream with the -/// GetInstalledCertificateStatusEnumType written to +/// get_installed_certificate_status_enum_type to the given output stream \p os +/// \returns an output stream with the GetInstalledCertificateStatusEnumType written to std::ostream& operator<<(std::ostream& os, const GetInstalledCertificateStatusEnumType& get_installed_certificate_status_enum_type); @@ -499,7 +516,8 @@ LogStatusEnumType string_to_log_status_enum_type(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given LogStatusEnumType \p log_status_enum_type to the given output -/// stream \p os \returns an output stream with the LogStatusEnumType written to +/// stream \p os +/// \returns an output stream with the LogStatusEnumType written to std::ostream& operator<<(std::ostream& os, const LogStatusEnumType& log_status_enum_type); // from: InstallCertificateResponse @@ -520,8 +538,8 @@ InstallCertificateStatusEnumType string_to_install_certificate_status_enum_type( } // namespace conversions /// \brief Writes the string representation of the given InstallCertificateStatusEnumType \p -/// install_certificate_status_enum_type to the given output stream \p os \returns an output stream with the -/// InstallCertificateStatusEnumType written to +/// install_certificate_status_enum_type to the given output stream \p os +/// \returns an output stream with the InstallCertificateStatusEnumType written to std::ostream& operator<<(std::ostream& os, const InstallCertificateStatusEnumType& install_certificate_status_enum_type); @@ -547,7 +565,8 @@ UploadLogStatusEnumType string_to_upload_log_status_enum_type(const std::string& } // namespace conversions /// \brief Writes the string representation of the given UploadLogStatusEnumType \p upload_log_status_enum_type to the -/// given output stream \p os \returns an output stream with the UploadLogStatusEnumType written to +/// given output stream \p os +/// \returns an output stream with the UploadLogStatusEnumType written to std::ostream& operator<<(std::ostream& os, const UploadLogStatusEnumType& upload_log_status_enum_type); // from: MeterValuesRequest @@ -573,7 +592,8 @@ ReadingContext string_to_reading_context(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ReadingContext \p reading_context to the given output stream \p -/// os \returns an output stream with the ReadingContext written to +/// os +/// \returns an output stream with the ReadingContext written to std::ostream& operator<<(std::ostream& os, const ReadingContext& reading_context); // from: MeterValuesRequest @@ -719,7 +739,8 @@ UnitOfMeasure string_to_unit_of_measure(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given UnitOfMeasure \p unit_of_measure to the given output stream \p -/// os \returns an output stream with the UnitOfMeasure written to +/// os +/// \returns an output stream with the UnitOfMeasure written to std::ostream& operator<<(std::ostream& os, const UnitOfMeasure& unit_of_measure); // from: RemoteStartTransactionRequest @@ -740,7 +761,8 @@ ChargingProfileKindType string_to_charging_profile_kind_type(const std::string& } // namespace conversions /// \brief Writes the string representation of the given ChargingProfileKindType \p charging_profile_kind_type to the -/// given output stream \p os \returns an output stream with the ChargingProfileKindType written to +/// given output stream \p os +/// \returns an output stream with the ChargingProfileKindType written to std::ostream& operator<<(std::ostream& os, const ChargingProfileKindType& charging_profile_kind_type); // from: RemoteStartTransactionRequest @@ -760,7 +782,8 @@ RecurrencyKindType string_to_recurrency_kind_type(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given RecurrencyKindType \p recurrency_kind_type to the given output -/// stream \p os \returns an output stream with the RecurrencyKindType written to +/// stream \p os +/// \returns an output stream with the RecurrencyKindType written to std::ostream& operator<<(std::ostream& os, const RecurrencyKindType& recurrency_kind_type); // from: RemoteStartTransactionResponse @@ -780,7 +803,8 @@ RemoteStartStopStatus string_to_remote_start_stop_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given RemoteStartStopStatus \p remote_start_stop_status to the given -/// output stream \p os \returns an output stream with the RemoteStartStopStatus written to +/// output stream \p os +/// \returns an output stream with the RemoteStartStopStatus written to std::ostream& operator<<(std::ostream& os, const RemoteStartStopStatus& remote_start_stop_status); // from: ReserveNowResponse @@ -803,7 +827,8 @@ ReservationStatus string_to_reservation_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ReservationStatus \p reservation_status to the given output -/// stream \p os \returns an output stream with the ReservationStatus written to +/// stream \p os +/// \returns an output stream with the ReservationStatus written to std::ostream& operator<<(std::ostream& os, const ReservationStatus& reservation_status); // from: ResetRequest @@ -906,7 +931,8 @@ ChargingProfileStatus string_to_charging_profile_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ChargingProfileStatus \p charging_profile_status to the given -/// output stream \p os \returns an output stream with the ChargingProfileStatus written to +/// output stream \p os +/// \returns an output stream with the ChargingProfileStatus written to std::ostream& operator<<(std::ostream& os, const ChargingProfileStatus& charging_profile_status); // from: SignCertificateResponse @@ -926,7 +952,8 @@ GenericStatusEnumType string_to_generic_status_enum_type(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given GenericStatusEnumType \p generic_status_enum_type to the given -/// output stream \p os \returns an output stream with the GenericStatusEnumType written to +/// output stream \p os +/// \returns an output stream with the GenericStatusEnumType written to std::ostream& operator<<(std::ostream& os, const GenericStatusEnumType& generic_status_enum_type); // from: SignedFirmwareStatusNotificationRequest @@ -958,7 +985,8 @@ FirmwareStatusEnumType string_to_firmware_status_enum_type(const std::string& s) } // namespace conversions /// \brief Writes the string representation of the given FirmwareStatusEnumType \p firmware_status_enum_type to the -/// given output stream \p os \returns an output stream with the FirmwareStatusEnumType written to +/// given output stream \p os +/// \returns an output stream with the FirmwareStatusEnumType written to std::ostream& operator<<(std::ostream& os, const FirmwareStatusEnumType& firmware_status_enum_type); // from: SignedUpdateFirmwareResponse @@ -981,8 +1009,8 @@ UpdateFirmwareStatusEnumType string_to_update_firmware_status_enum_type(const st } // namespace conversions /// \brief Writes the string representation of the given UpdateFirmwareStatusEnumType \p -/// update_firmware_status_enum_type to the given output stream \p os \returns an output stream with the -/// UpdateFirmwareStatusEnumType written to +/// update_firmware_status_enum_type to the given output stream \p os +/// \returns an output stream with the UpdateFirmwareStatusEnumType written to std::ostream& operator<<(std::ostream& os, const UpdateFirmwareStatusEnumType& update_firmware_status_enum_type); // from: StatusNotificationRequest @@ -1016,7 +1044,8 @@ ChargePointErrorCode string_to_charge_point_error_code(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ChargePointErrorCode \p charge_point_error_code to the given -/// output stream \p os \returns an output stream with the ChargePointErrorCode written to +/// output stream \p os +/// \returns an output stream with the ChargePointErrorCode written to std::ostream& operator<<(std::ostream& os, const ChargePointErrorCode& charge_point_error_code); // from: StatusNotificationRequest @@ -1043,7 +1072,8 @@ ChargePointStatus string_to_charge_point_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ChargePointStatus \p charge_point_status to the given output -/// stream \p os \returns an output stream with the ChargePointStatus written to +/// stream \p os +/// \returns an output stream with the ChargePointStatus written to std::ostream& operator<<(std::ostream& os, const ChargePointStatus& charge_point_status); // from: StopTransactionRequest @@ -1096,7 +1126,8 @@ MessageTrigger string_to_message_trigger(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MessageTrigger \p message_trigger to the given output stream \p -/// os \returns an output stream with the MessageTrigger written to +/// os +/// \returns an output stream with the MessageTrigger written to std::ostream& operator<<(std::ostream& os, const MessageTrigger& message_trigger); // from: TriggerMessageResponse @@ -1117,7 +1148,8 @@ TriggerMessageStatus string_to_trigger_message_status(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given TriggerMessageStatus \p trigger_message_status to the given -/// output stream \p os \returns an output stream with the TriggerMessageStatus written to +/// output stream \p os +/// \returns an output stream with the TriggerMessageStatus written to std::ostream& operator<<(std::ostream& os, const TriggerMessageStatus& trigger_message_status); // from: UnlockConnectorResponse diff --git a/include/ocpp/v16/ocpp_types.hpp b/include/ocpp/v16/ocpp_types.hpp index 87679c050..e310573cc 100644 --- a/include/ocpp/v16/ocpp_types.hpp +++ b/include/ocpp/v16/ocpp_types.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest +// Copyright 2020 - 2025 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually #ifndef OCPP_V16_OCPP_TYPES_HPP @@ -27,7 +27,7 @@ void to_json(json& j, const IdTagInfo& k); /// \brief Conversion from a given json object \p j to a given IdTagInfo \p k void from_json(const json& j, IdTagInfo& k); -// \brief Writes the string representation of the given IdTagInfo \p k to the given output stream \p os +/// \brief Writes the string representation of the given IdTagInfo \p k to the given output stream \p os /// \returns an output stream with the IdTagInfo written to std::ostream& operator<<(std::ostream& os, const IdTagInfo& k); @@ -43,7 +43,7 @@ void to_json(json& j, const CertificateHashDataType& k); /// \brief Conversion from a given json object \p j to a given CertificateHashDataType \p k void from_json(const json& j, CertificateHashDataType& k); -// \brief Writes the string representation of the given CertificateHashDataType \p k to the given output stream \p os +/// \brief Writes the string representation of the given CertificateHashDataType \p k to the given output stream \p os /// \returns an output stream with the CertificateHashDataType written to std::ostream& operator<<(std::ostream& os, const CertificateHashDataType& k); @@ -58,7 +58,7 @@ void to_json(json& j, const ChargingSchedulePeriod& k); /// \brief Conversion from a given json object \p j to a given ChargingSchedulePeriod \p k void from_json(const json& j, ChargingSchedulePeriod& k); -// \brief Writes the string representation of the given ChargingSchedulePeriod \p k to the given output stream \p os +/// \brief Writes the string representation of the given ChargingSchedulePeriod \p k to the given output stream \p os /// \returns an output stream with the ChargingSchedulePeriod written to std::ostream& operator<<(std::ostream& os, const ChargingSchedulePeriod& k); @@ -75,7 +75,7 @@ void to_json(json& j, const ChargingSchedule& k); /// \brief Conversion from a given json object \p j to a given ChargingSchedule \p k void from_json(const json& j, ChargingSchedule& k); -// \brief Writes the string representation of the given ChargingSchedule \p k to the given output stream \p os +/// \brief Writes the string representation of the given ChargingSchedule \p k to the given output stream \p os /// \returns an output stream with the ChargingSchedule written to std::ostream& operator<<(std::ostream& os, const ChargingSchedule& k); @@ -90,7 +90,7 @@ void to_json(json& j, const KeyValue& k); /// \brief Conversion from a given json object \p j to a given KeyValue \p k void from_json(const json& j, KeyValue& k); -// \brief Writes the string representation of the given KeyValue \p k to the given output stream \p os +/// \brief Writes the string representation of the given KeyValue \p k to the given output stream \p os /// \returns an output stream with the KeyValue written to std::ostream& operator<<(std::ostream& os, const KeyValue& k); @@ -105,7 +105,7 @@ void to_json(json& j, const LogParametersType& k); /// \brief Conversion from a given json object \p j to a given LogParametersType \p k void from_json(const json& j, LogParametersType& k); -// \brief Writes the string representation of the given LogParametersType \p k to the given output stream \p os +/// \brief Writes the string representation of the given LogParametersType \p k to the given output stream \p os /// \returns an output stream with the LogParametersType written to std::ostream& operator<<(std::ostream& os, const LogParametersType& k); @@ -124,7 +124,7 @@ void to_json(json& j, const SampledValue& k); /// \brief Conversion from a given json object \p j to a given SampledValue \p k void from_json(const json& j, SampledValue& k); -// \brief Writes the string representation of the given SampledValue \p k to the given output stream \p os +/// \brief Writes the string representation of the given SampledValue \p k to the given output stream \p os /// \returns an output stream with the SampledValue written to std::ostream& operator<<(std::ostream& os, const SampledValue& k); @@ -138,7 +138,7 @@ void to_json(json& j, const MeterValue& k); /// \brief Conversion from a given json object \p j to a given MeterValue \p k void from_json(const json& j, MeterValue& k); -// \brief Writes the string representation of the given MeterValue \p k to the given output stream \p os +/// \brief Writes the string representation of the given MeterValue \p k to the given output stream \p os /// \returns an output stream with the MeterValue written to std::ostream& operator<<(std::ostream& os, const MeterValue& k); @@ -159,7 +159,7 @@ void to_json(json& j, const ChargingProfile& k); /// \brief Conversion from a given json object \p j to a given ChargingProfile \p k void from_json(const json& j, ChargingProfile& k); -// \brief Writes the string representation of the given ChargingProfile \p k to the given output stream \p os +/// \brief Writes the string representation of the given ChargingProfile \p k to the given output stream \p os /// \returns an output stream with the ChargingProfile written to std::ostream& operator<<(std::ostream& os, const ChargingProfile& k); @@ -173,7 +173,7 @@ void to_json(json& j, const LocalAuthorizationList& k); /// \brief Conversion from a given json object \p j to a given LocalAuthorizationList \p k void from_json(const json& j, LocalAuthorizationList& k); -// \brief Writes the string representation of the given LocalAuthorizationList \p k to the given output stream \p os +/// \brief Writes the string representation of the given LocalAuthorizationList \p k to the given output stream \p os /// \returns an output stream with the LocalAuthorizationList written to std::ostream& operator<<(std::ostream& os, const LocalAuthorizationList& k); @@ -190,7 +190,7 @@ void to_json(json& j, const FirmwareType& k); /// \brief Conversion from a given json object \p j to a given FirmwareType \p k void from_json(const json& j, FirmwareType& k); -// \brief Writes the string representation of the given FirmwareType \p k to the given output stream \p os +/// \brief Writes the string representation of the given FirmwareType \p k to the given output stream \p os /// \returns an output stream with the FirmwareType written to std::ostream& operator<<(std::ostream& os, const FirmwareType& k); @@ -204,7 +204,7 @@ void to_json(json& j, const TransactionData& k); /// \brief Conversion from a given json object \p j to a given TransactionData \p k void from_json(const json& j, TransactionData& k); -// \brief Writes the string representation of the given TransactionData \p k to the given output stream \p os +/// \brief Writes the string representation of the given TransactionData \p k to the given output stream \p os /// \returns an output stream with the TransactionData written to std::ostream& operator<<(std::ostream& os, const TransactionData& k); diff --git a/include/ocpp/v16/profile.hpp b/include/ocpp/v16/profile.hpp index 7b5bdfa9b..090e3a95e 100644 --- a/include/ocpp/v16/profile.hpp +++ b/include/ocpp/v16/profile.hpp @@ -55,7 +55,7 @@ std::vector calculate_start(const DateTime& now, const DateTime& end, const std::optional& session_start, const ChargingProfile& profile); std::vector calculate_profile_entry(const DateTime& now, const DateTime& end, const std::optional& session_start, - const ChargingProfile& profile, std::uint8_t period_index); + const ChargingProfile& profile, std::size_t period_index); std::vector calculate_profile(const DateTime& now, const DateTime& end, const std::optional& session_start, const ChargingProfile& profile); diff --git a/include/ocpp/v16/transaction.hpp b/include/ocpp/v16/transaction.hpp index 7fa935e07..c80a1a21f 100644 --- a/include/ocpp/v16/transaction.hpp +++ b/include/ocpp/v16/transaction.hpp @@ -18,9 +18,7 @@ namespace v16 { struct StampedEnergyWh { ocpp::DateTime timestamp; ///< A timestamp associated with the energy value double energy_Wh; ///< The energy value in Wh - StampedEnergyWh(ocpp::DateTime timestamp, double energy_Wh) { - this->timestamp = timestamp; - this->energy_Wh = energy_Wh; + StampedEnergyWh(ocpp::DateTime timestamp, double energy_Wh) : timestamp(timestamp), energy_Wh(energy_Wh) { } }; @@ -69,7 +67,7 @@ class Transaction { /// \brief Provides the connector of this transaction /// \returns the connector - int32_t get_connector(); + int32_t get_connector() const; /// \brief Provides the authorized id tag of this Transaction /// \returns the authorized id tag @@ -94,7 +92,7 @@ class Transaction { std::optional get_transaction_id(); /// \brief Returns the internal transaction id - int32_t get_internal_transaction_id(); + int32_t get_internal_transaction_id() const; /// \brief Provides the id of this session /// \returns the session_id @@ -124,10 +122,10 @@ class Transaction { /// \brief Indicates if the transaction is active. Active means that the transaction for this session is not null /// and no StopTransaction.req has been pushed to the message queue yet - bool is_active(); + bool is_active() const; /// \brief Indicates if a StopTransaction.req for this transaction has already been pushed to the message queue - bool is_finished(); + bool is_finished() const; /// \brief Sets the finished flag for this transaction. This is done when a StopTransaction.req has been pushed to /// the message queue diff --git a/include/ocpp/v16/types.hpp b/include/ocpp/v16/types.hpp index a4b62bc4c..c087b387b 100644 --- a/include/ocpp/v16/types.hpp +++ b/include/ocpp/v16/types.hpp @@ -117,7 +117,7 @@ MessageType string_to_messagetype(const std::string& s); std::ostream& operator<<(std::ostream& os, const MessageType& message_type); /// \brief Contains the supported OCPP 1.6 feature profiles -enum SupportedFeatureProfiles { +enum class SupportedFeatureProfiles { Internal, Core, CostAndPrice, @@ -145,7 +145,7 @@ SupportedFeatureProfiles string_to_supported_feature_profiles(const std::string& std::ostream& operator<<(std::ostream& os, const SupportedFeatureProfiles& supported_feature_profiles); /// \brief Contains the different connection states of the charge point -enum ChargePointConnectionState { +enum class ChargePointConnectionState { Disconnected, // state when disconnected Connected, // state when ws is connected Booted, // state when ws is connected and BootNotifcation had been Accepted @@ -189,7 +189,7 @@ struct AvailabilityChange { }; /// \brief BootReasonEnum contains the different boot reasons of the charge point (copied from OCPP2.0.1 definition) -enum BootReasonEnum { +enum class BootReasonEnum { ApplicationReset, FirmwareUpdate, LocalReset, diff --git a/include/ocpp/v2/average_meter_values.hpp b/include/ocpp/v2/average_meter_values.hpp index b69948420..e996bf92a 100644 --- a/include/ocpp/v2/average_meter_values.hpp +++ b/include/ocpp/v2/average_meter_values.hpp @@ -16,7 +16,7 @@ namespace v2 { class AverageMeterValues { public: - AverageMeterValues(); + AverageMeterValues() = default; /// @brief Set the meter values into the local object for processing /// @param meter_value MeterValue void set_values(const MeterValue& meter_value); @@ -46,7 +46,6 @@ class AverageMeterValues { MeterValue averaged_meter_values; std::mutex avg_meter_value_mutex; std::map aligned_meter_values; - bool is_avg_meas(const SampledValue& sample); void average_meter_value(); }; } // namespace v2 diff --git a/include/ocpp/v2/charge_point.hpp b/include/ocpp/v2/charge_point.hpp index c645d12ff..1b875ce8d 100644 --- a/include/ocpp/v2/charge_point.hpp +++ b/include/ocpp/v2/charge_point.hpp @@ -443,7 +443,7 @@ class ChargePoint : public ChargePointInterface, private ocpp::ChargingStationBa conversions::messagetype_to_string(expected_response_message_type) + ", got: " + conversions::messagetype_to_string(enhanced_response.messageType)); } - ocpp::CallResult call_result = enhanced_response.message; + const ocpp::CallResult call_result = enhanced_response.message; return call_result.msg; }; } @@ -514,14 +514,14 @@ class ChargePoint : public ChargePointInterface, private ocpp::ChargingStationBa /// @} // End chargepoint 2.0.1 topic - ~ChargePoint(); + ~ChargePoint() override; void start(BootReasonEnum bootreason = BootReasonEnum::PowerUp, bool start_connecting = true) override; void stop() override; void connect_websocket(std::optional network_profile_slot = std::nullopt) override; - virtual void disconnect_websocket() override; + void disconnect_websocket() override; void on_network_disconnected(OCPPInterfaceEnum ocpp_interface) override; diff --git a/include/ocpp/v2/component_state_manager.hpp b/include/ocpp/v2/component_state_manager.hpp index 3b4c73c1c..9fbbe62e8 100644 --- a/include/ocpp/v2/component_state_manager.hpp +++ b/include/ocpp/v2/component_state_manager.hpp @@ -58,7 +58,7 @@ struct FullConnectorStatus { /// \brief Translates the individual state to an Available/Unavailable/Occupied/Reserved/Faulted state /// This does NOT take into account the state of the EVSE or CS, /// and is intended to be used internally by the ComponentStateManagerInterface. - ConnectorStatusEnum to_connector_status(); + ConnectorStatusEnum to_connector_status() const; }; class ComponentStateManagerInterface { @@ -292,42 +292,43 @@ class ComponentStateManager : public ComponentStateManagerInterface { send_connector_status_notification_callback); void set_cs_effective_availability_changed_callback( - const std::function& callback); + const std::function& callback) override; void set_evse_effective_availability_changed_callback( - const std::function& callback); + const std::function& callback) override; void set_connector_effective_availability_changed_callback( const std::function& callback); + const OperationalStatusEnum new_status)>& callback) override; - OperationalStatusEnum get_cs_individual_operational_status(); - OperationalStatusEnum get_evse_individual_operational_status(int32_t evse_id); - OperationalStatusEnum get_connector_individual_operational_status(int32_t evse_id, int32_t connector_id); + OperationalStatusEnum get_cs_individual_operational_status() override; + OperationalStatusEnum get_evse_individual_operational_status(int32_t evse_id) override; + OperationalStatusEnum get_connector_individual_operational_status(int32_t evse_id, int32_t connector_id) override; - OperationalStatusEnum get_cs_persisted_operational_status(); - OperationalStatusEnum get_evse_persisted_operational_status(int32_t evse_id); - OperationalStatusEnum get_connector_persisted_operational_status(int32_t evse_id, int32_t connector_id); + OperationalStatusEnum get_cs_persisted_operational_status() override; + OperationalStatusEnum get_evse_persisted_operational_status(int32_t evse_id) override; + OperationalStatusEnum get_connector_persisted_operational_status(int32_t evse_id, int32_t connector_id) override; - void set_cs_individual_operational_status(OperationalStatusEnum new_status, bool persist); - void set_evse_individual_operational_status(int32_t evse_id, OperationalStatusEnum new_status, bool persist); + void set_cs_individual_operational_status(OperationalStatusEnum new_status, bool persist) override; + void set_evse_individual_operational_status(int32_t evse_id, OperationalStatusEnum new_status, + bool persist) override; void set_connector_individual_operational_status(int32_t evse_id, int32_t connector_id, - OperationalStatusEnum new_status, bool persist); + OperationalStatusEnum new_status, bool persist) override; - OperationalStatusEnum get_evse_effective_operational_status(int32_t evse_id); - OperationalStatusEnum get_connector_effective_operational_status(int32_t evse_id, int32_t connector_id); - ConnectorStatusEnum get_connector_effective_status(int32_t evse_id, int32_t connector_id); + OperationalStatusEnum get_evse_effective_operational_status(int32_t evse_id) override; + OperationalStatusEnum get_connector_effective_operational_status(int32_t evse_id, int32_t connector_id) override; + ConnectorStatusEnum get_connector_effective_status(int32_t evse_id, int32_t connector_id) override; - void set_connector_occupied(int32_t evse_id, int32_t connector_id, bool is_occupied); - void set_connector_reserved(int32_t evse_id, int32_t connector_id, bool is_reserved); - void set_connector_faulted(int32_t evse_id, int32_t connector_id, bool is_faulted); - void set_connector_unavailable(int32_t evse_id, int32_t connector_id, bool is_unavailable); + void set_connector_occupied(int32_t evse_id, int32_t connector_id, bool is_occupied) override; + void set_connector_reserved(int32_t evse_id, int32_t connector_id, bool is_reserved) override; + void set_connector_faulted(int32_t evse_id, int32_t connector_id, bool is_faulted) override; + void set_connector_unavailable(int32_t evse_id, int32_t connector_id, bool is_unavailable) override; - void trigger_all_effective_availability_changed_callbacks(); + void trigger_all_effective_availability_changed_callbacks() override; - void send_status_notification_all_connectors(); - void send_status_notification_changed_connectors(); - void send_status_notification_single_connector(int32_t evse_id, int32_t connector_id); + void send_status_notification_all_connectors() override; + void send_status_notification_changed_connectors() override; + void send_status_notification_single_connector(int32_t evse_id, int32_t connector_id) override; }; } // namespace ocpp::v2 diff --git a/include/ocpp/v2/connectivity_manager.hpp b/include/ocpp/v2/connectivity_manager.hpp index 240e947d0..a2854e168 100644 --- a/include/ocpp/v2/connectivity_manager.hpp +++ b/include/ocpp/v2/connectivity_manager.hpp @@ -30,8 +30,7 @@ using ConfigureNetworkConnectionProfileCallback = std::function get_charging_profiles_for_evse(const int evse_id) override; std::vector get_all_charging_profiles() override; - virtual std::map> get_all_charging_profiles_group_by_evse() override; + std::map> get_all_charging_profiles_group_by_evse() override; CiString<20> get_charging_limit_source_for_profile(const int profile_id) override; std::unique_ptr new_statement(const std::string& sql) override; diff --git a/include/ocpp/v2/device_model.hpp b/include/ocpp/v2/device_model.hpp index 99632c092..fdc0db0fc 100644 --- a/include/ocpp/v2/device_model.hpp +++ b/include/ocpp/v2/device_model.hpp @@ -26,26 +26,25 @@ template struct RequestDeviceModelResponse { /// \param value /// \return template T to_specific_type(const std::string& value) { - static_assert(std::is_same::value || std::is_same::value || - std::is_same::value || std::is_same::value || - std::is_same::value || std::is_same::value || - std::is_same::value, + static_assert(std::is_same_v || std::is_same_v || std::is_same_v || + std::is_same_v || std::is_same_v || std::is_same_v || + std::is_same_v, "Requested unknown datatype"); - if constexpr (std::is_same::value) { + if constexpr (std::is_same_v) { return value; - } else if constexpr (std::is_same::value) { + } else if constexpr (std::is_same_v) { return std::stoi(value); - } else if constexpr (std::is_same::value) { + } else if constexpr (std::is_same_v) { return std::stod(value); - } else if constexpr (std::is_same::value) { - size_t res = std::stoul(value); + } else if constexpr (std::is_same_v) { + const std::size_t res = std::stoul(value); return res; - } else if constexpr (std::is_same::value) { + } else if constexpr (std::is_same_v) { return DateTime(value); - } else if constexpr (std::is_same::value) { + } else if constexpr (std::is_same_v) { return ocpp::conversions::string_to_bool(value); - } else if constexpr (std::is_same::value) { + } else if constexpr (std::is_same_v) { return std::stoull(value); } } @@ -81,16 +80,17 @@ template bool is_type_numeric() { } } -typedef std::function& monitors, - const Component& component, const Variable& variable, - const VariableCharacteristics& characteristics, const VariableAttribute& attribute, - const std::string& value_previous, const std::string& value_current)> - on_variable_changed; +void filter_criteria_monitors(const std::vector& criteria, + std::vector& monitors); -typedef std::function - on_monitor_updated; +using on_variable_changed = std::function& monitors, const Component& component, + const Variable& variable, const VariableCharacteristics& characteristics, const VariableAttribute& attribute, + const std::string& value_previous, const std::string& value_current)>; + +using on_monitor_updated = std::function; /// \brief This class manages access to the device model representation and to the device model interface and provides /// functionality to support the use cases defined in the functional block Provisioning @@ -128,14 +128,6 @@ class DeviceModel { bool component_criteria_match(const Component& component_id, const std::vector& component_criteria); - /// @brief Iterates over the given \p component_variables and filters them according to the requirement conditions. - /// @param component_variables - /// @param component_ current component - /// @param variable_ current variable - /// @return true if the component is found according to any of the requirement conditions. - bool component_variables_match(const std::vector& component_variables, - const ocpp::v2::Component& component_, const struct ocpp::v2::Variable& variable_); - /// /// \brief Helper function to check if a variable has a value. /// \param component_variable Component variable to check. @@ -188,12 +180,11 @@ class DeviceModel { } if (response == GetVariableStatusEnum::Accepted) { return to_specific_type(value); - } else { - EVLOG_critical << "Directly requested value for ComponentVariable that doesn't exist in the device model: " - << component_variable; - EVLOG_AND_THROW(std::runtime_error( - "Directly requested value for ComponentVariable that doesn't exist in the device model.")); } + EVLOG_critical << "Directly requested value for ComponentVariable that doesn't exist in the device model: " + << component_variable; + EVLOG_AND_THROW(std::runtime_error( + "Directly requested value for ComponentVariable that doesn't exist in the device model.")); } /// \brief Access to std::optional of a VariableAttribute for the given component, variable and attribute_enum. @@ -213,9 +204,8 @@ class DeviceModel { } if (response == GetVariableStatusEnum::Accepted) { return to_specific_type(value); - } else { - return std::nullopt; } + return std::nullopt; } /// \brief Requests a value of a VariableAttribute specified by combination of \p component_id and \p variable_id @@ -234,9 +224,8 @@ class DeviceModel { if (req_status == GetVariableStatusEnum::Accepted) { return {GetVariableStatusEnum::Accepted, to_specific_type(value)}; - } else { - return {req_status}; } + return {req_status}; } /// \brief Get the mutability for the given component, variable and attribute_enum diff --git a/include/ocpp/v2/device_model_storage_interface.hpp b/include/ocpp/v2/device_model_storage_interface.hpp index 5baf87b2a..c31314fc5 100644 --- a/include/ocpp/v2/device_model_storage_interface.hpp +++ b/include/ocpp/v2/device_model_storage_interface.hpp @@ -44,11 +44,9 @@ class DeviceModelError : public std::exception { [[nodiscard]] const char* what() const noexcept override { return this->reason.c_str(); } - explicit DeviceModelError(std::string msg) { - this->reason = std::move(msg); + explicit DeviceModelError(std::string msg) : reason(std::move(msg)) { } - explicit DeviceModelError(const char* msg) { - this->reason = std::string(msg); + explicit DeviceModelError(const char* msg) : reason(std::string(msg)) { } private: diff --git a/include/ocpp/v2/device_model_storage_sqlite.hpp b/include/ocpp/v2/device_model_storage_sqlite.hpp index f130a4fc8..0629e7282 100644 --- a/include/ocpp/v2/device_model_storage_sqlite.hpp +++ b/include/ocpp/v2/device_model_storage_sqlite.hpp @@ -50,7 +50,7 @@ class DeviceModelStorageSqlite : public DeviceModelStorageInterface { /// \param db_path Path to database DeviceModelStorageSqlite(const fs::path& db_path); - ~DeviceModelStorageSqlite() = default; + ~DeviceModelStorageSqlite() override = default; std::map> get_device_model() final; diff --git a/include/ocpp/v2/evse.hpp b/include/ocpp/v2/evse.hpp index d87fdb431..f50770885 100644 --- a/include/ocpp/v2/evse.hpp +++ b/include/ocpp/v2/evse.hpp @@ -209,7 +209,7 @@ class Evse : public EvseInterface { /// /// Resets timer, set all pricing trigger related members to std::nullopt and / or nullptr. /// - void reset_pricing_triggers(void); + void reset_pricing_triggers(); AverageMeterValues aligned_data_updated; AverageMeterValues aligned_data_tx_end; @@ -247,7 +247,7 @@ class Evse : public EvseInterface { transaction_meter_value_req, const std::function& pause_charging_callback); - virtual ~Evse(); + ~Evse() override; int32_t get_id() const override; diff --git a/include/ocpp/v2/evse_manager.hpp b/include/ocpp/v2/evse_manager.hpp index 366b21e91..6df8143c8 100644 --- a/include/ocpp/v2/evse_manager.hpp +++ b/include/ocpp/v2/evse_manager.hpp @@ -91,7 +91,7 @@ class EvseManager : public EvseManagerInterface { EvseInterface& get_evse(int32_t id) override; const EvseInterface& get_evse(const int32_t id) const override; - virtual bool does_connector_exist(const int32_t evse_id, const CiString<20> connector_type) const override; + bool does_connector_exist(const int32_t evse_id, const CiString<20> connector_type) const override; bool does_evse_exist(const int32_t id) const override; bool are_all_connectors_effectively_inoperative() const override; diff --git a/include/ocpp/v2/functional_blocks/authorization.hpp b/include/ocpp/v2/functional_blocks/authorization.hpp index 3e3ae9ca7..ff1526b32 100644 --- a/include/ocpp/v2/functional_blocks/authorization.hpp +++ b/include/ocpp/v2/functional_blocks/authorization.hpp @@ -17,8 +17,7 @@ class DatabaseHandlerInterface; class AuthorizationInterface : public MessageHandlerInterface { public: - virtual ~AuthorizationInterface() { - } + ~AuthorizationInterface() override = default; virtual void start_auth_cache_cleanup_thread() = 0; virtual AuthorizeResponse authorize_req(const IdToken id_token, const std::optional>& certificate, @@ -55,7 +54,7 @@ class Authorization : public AuthorizationInterface { public: explicit Authorization(const FunctionalBlockContext& context); - ~Authorization(); + ~Authorization() override; void start_auth_cache_cleanup_thread() override; void handle_message(const ocpp::EnhancedMessage& message) override; AuthorizeResponse authorize_req(const IdToken id_token, const std::optional>& certificate, diff --git a/include/ocpp/v2/functional_blocks/availability.hpp b/include/ocpp/v2/functional_blocks/availability.hpp index d7962b7b3..532510100 100644 --- a/include/ocpp/v2/functional_blocks/availability.hpp +++ b/include/ocpp/v2/functional_blocks/availability.hpp @@ -20,10 +20,9 @@ struct AvailabilityChange { class AvailabilityInterface : public MessageHandlerInterface { public: - virtual ~AvailabilityInterface() { - } + ~AvailabilityInterface() override = default; - virtual void handle_message(const ocpp::EnhancedMessage& message) = 0; + void handle_message(const ocpp::EnhancedMessage& message) override = 0; // Functional Block G: Availability OCPP requests. /// @@ -70,8 +69,8 @@ class AvailabilityInterface : public MessageHandlerInterface { virtual void stop_heartbeat_timer() = 0; }; -typedef std::function TimeSyncCallback; -typedef std::function AllConnectorsUnavailableCallback; +using TimeSyncCallback = std::function; +using AllConnectorsUnavailableCallback = std::function; class Availability : public AvailabilityInterface { private: // Members @@ -89,7 +88,7 @@ class Availability : public AvailabilityInterface { Availability(const FunctionalBlockContext& functional_block_context, std::optional time_sync_callback, std::optional all_connectors_unavailable_callback); - ~Availability(); + ~Availability() override; void handle_message(const ocpp::EnhancedMessage& message) override; // Functional Block G: Availability diff --git a/include/ocpp/v2/functional_blocks/data_transfer.hpp b/include/ocpp/v2/functional_blocks/data_transfer.hpp index 1fdc0c186..57f5427cd 100644 --- a/include/ocpp/v2/functional_blocks/data_transfer.hpp +++ b/include/ocpp/v2/functional_blocks/data_transfer.hpp @@ -14,7 +14,7 @@ struct DataTransferResponse; class DataTransferInterface : public MessageHandlerInterface { public: - virtual ~DataTransferInterface() = default; + ~DataTransferInterface() override = default; /// \brief Sends a DataTransfer.req message to the CSMS using the given parameters /// \param vendorId diff --git a/include/ocpp/v2/functional_blocks/diagnostics.hpp b/include/ocpp/v2/functional_blocks/diagnostics.hpp index 4e347dc9a..8a75829d9 100644 --- a/include/ocpp/v2/functional_blocks/diagnostics.hpp +++ b/include/ocpp/v2/functional_blocks/diagnostics.hpp @@ -19,19 +19,17 @@ struct SetMonitoringLevelRequest; struct GetMonitoringReportRequest; struct ClearVariableMonitoringRequest; -typedef std::function GetLogRequestCallback; -typedef std::function customer_certificate, - const std::optional id_token, - const std::optional> customer_identifier)> - GetCustomerInformationCallback; -typedef std::function customer_certificate, - const std::optional id_token, - const std::optional> customer_identifier)> - ClearCustomerInformationCallback; +using GetLogRequestCallback = std::function; +using GetCustomerInformationCallback = std::function customer_certificate, const std::optional id_token, + const std::optional> customer_identifier)>; +using ClearCustomerInformationCallback = + std::function customer_certificate, + const std::optional id_token, const std::optional> customer_identifier)>; class DiagnosticsInterface : public MessageHandlerInterface { public: - virtual ~DiagnosticsInterface() = default; + ~DiagnosticsInterface() override = default; /* OCPP message requests */ virtual void notify_event_req(const std::vector& events) = 0; @@ -54,7 +52,8 @@ class Diagnostics : public DiagnosticsInterface { void start_monitoring() override; void process_triggered_monitors() override; -private: // Members +private: + // Members const FunctionalBlockContext& context; AuthorizationInterface& authorization; /// \brief Updater for triggered monitors @@ -68,7 +67,7 @@ class Diagnostics : public DiagnosticsInterface { std::optional clear_customer_information_callback; const bool is_monitoring_available; -private: // Functions + // Functions /* OCPP message requests */ void notify_customer_information_req(const std::string& data, const int32_t request_id); void notify_monitoring_report_req(const int request_id, std::vector& montoring_data); @@ -108,6 +107,6 @@ class Diagnostics : public DiagnosticsInterface { /// \brief Check if monitoring is available and if not, throw. /// \param type Message type to include in MessageTypeNotImplementedException when thrown. - void throw_when_monitoring_not_available(const MessageType type); + void throw_when_monitoring_not_available(const MessageType type) const; }; } // namespace ocpp::v2 diff --git a/include/ocpp/v2/functional_blocks/display_message.hpp b/include/ocpp/v2/functional_blocks/display_message.hpp index 00625c354..700dd25bd 100644 --- a/include/ocpp/v2/functional_blocks/display_message.hpp +++ b/include/ocpp/v2/functional_blocks/display_message.hpp @@ -32,16 +32,16 @@ std::optional display_message_to_message_info_type(const DisplayMes /// DisplayMessage message_info_to_display_message(const MessageInfo& message_info); -typedef std::function(const GetDisplayMessagesRequest& request)> - GetDisplayMessageCallback; -typedef std::function& display_messages)> - SetDisplayMessageCallback; -typedef std::function - ClearDisplayMessageCallback; +using GetDisplayMessageCallback = + std::function(const GetDisplayMessagesRequest& request)>; +using SetDisplayMessageCallback = + std::function& display_messages)>; +using ClearDisplayMessageCallback = + std::function; class DisplayMessageInterface : public MessageHandlerInterface { public: - virtual ~DisplayMessageInterface() = default; + ~DisplayMessageInterface() override = default; }; class DisplayMessageBlock : public DisplayMessageInterface { @@ -51,7 +51,7 @@ class DisplayMessageBlock : public DisplayMessageInterface { GetDisplayMessageCallback get_display_message_callback, SetDisplayMessageCallback set_display_message_callback, ClearDisplayMessageCallback clear_display_message_callback); - virtual void handle_message(const ocpp::EnhancedMessage& message) override; + void handle_message(const ocpp::EnhancedMessage& message) override; private: const FunctionalBlockContext& context; diff --git a/include/ocpp/v2/functional_blocks/firmware_update.hpp b/include/ocpp/v2/functional_blocks/firmware_update.hpp index 6fcb247b8..05d694379 100644 --- a/include/ocpp/v2/functional_blocks/firmware_update.hpp +++ b/include/ocpp/v2/functional_blocks/firmware_update.hpp @@ -15,12 +15,12 @@ struct UpdateFirmwareRequest; struct UpdateFirmwareResponse; // Typedef -typedef std::function UpdateFirmwareRequestCallback; -typedef std::function AllConnectorsUnavailableCallback; +using UpdateFirmwareRequestCallback = std::function; +using AllConnectorsUnavailableCallback = std::function; class FirmwareUpdateInterface : public MessageHandlerInterface { public: - virtual ~FirmwareUpdateInterface() = default; + ~FirmwareUpdateInterface() override = default; virtual void on_firmware_update_status_notification(int32_t request_id, const FirmwareStatusEnum& firmware_update_status) = 0; diff --git a/include/ocpp/v2/functional_blocks/meter_values.hpp b/include/ocpp/v2/functional_blocks/meter_values.hpp index 93f0845e1..67fa50a5d 100644 --- a/include/ocpp/v2/functional_blocks/meter_values.hpp +++ b/include/ocpp/v2/functional_blocks/meter_values.hpp @@ -14,7 +14,7 @@ struct RequiredComponentVariable; class MeterValuesInterface : public MessageHandlerInterface { public: - virtual ~MeterValuesInterface() override = default; + ~MeterValuesInterface() override = default; virtual void update_aligned_data_interval() = 0; /// \brief Event handler that should be called when a new meter value is present /// \param evse_id @@ -29,7 +29,7 @@ class MeterValuesInterface : public MessageHandlerInterface { class MeterValues : public MeterValuesInterface { public: - virtual ~MeterValues() override = default; + ~MeterValues() override = default; explicit MeterValues(const FunctionalBlockContext& functional_block_context); void handle_message(const ocpp::EnhancedMessage& message) override; void update_aligned_data_interval() override; diff --git a/include/ocpp/v2/functional_blocks/provisioning.hpp b/include/ocpp/v2/functional_blocks/provisioning.hpp index 17bc7a8a6..7d812f0dc 100644 --- a/include/ocpp/v2/functional_blocks/provisioning.hpp +++ b/include/ocpp/v2/functional_blocks/provisioning.hpp @@ -21,17 +21,16 @@ struct GetBaseReportRequest; struct ResetRequest; struct SetNetworkProfileRequest; -typedef std::function TimeSyncCallback; -typedef std::function BootNotificationCallback; -typedef std::function - ValidateNetworkProfileCallback; -typedef std::function evse_id, const ResetEnum& reset_type)> - IsResetAllowedCallback; -typedef std::function evse_id, const ResetEnum& reset_type)> ResetCallback; -typedef std::function - StopTransactionCallback; -typedef std::function VariableChangedCallback; +using TimeSyncCallback = std::function; +using BootNotificationCallback = std::function; +using ValidateNetworkProfileCallback = std::function; +using IsResetAllowedCallback = + std::function evse_id, const ResetEnum& reset_type)>; +using ResetCallback = std::function evse_id, const ResetEnum& reset_type)>; +using StopTransactionCallback = + std::function; +using VariableChangedCallback = std::function; class ProvisioningInterface : public MessageHandlerInterface { public: @@ -83,7 +82,8 @@ class Provisioning : public ProvisioningInterface { std::map set_variables(const std::vector& set_variable_data_vector, const std::string& source) override; -private: // Members +private: + // Members const FunctionalBlockContext& context; MessageQueue& message_queue; OcspUpdaterInterface& ocsp_updater; @@ -106,7 +106,7 @@ class Provisioning : public ProvisioningInterface { Everest::SteadyTimer boot_notification_timer; -private: // Functions + // Functions /* OCPP message requests */ void notify_report_req(const int request_id, const std::vector& report_data); diff --git a/include/ocpp/v2/functional_blocks/remote_transaction_control.hpp b/include/ocpp/v2/functional_blocks/remote_transaction_control.hpp index daa1bb5f5..6e5ceb42f 100644 --- a/include/ocpp/v2/functional_blocks/remote_transaction_control.hpp +++ b/include/ocpp/v2/functional_blocks/remote_transaction_control.hpp @@ -24,17 +24,16 @@ struct RequestStopTransactionRequest; struct TriggerMessageRequest; struct UnlockConnectorResponse; -typedef std::function - UnlockConnectorCallback; -typedef std::function - RemoteStartTransactionCallback; -typedef std::function - StopTransactionCallback; +using UnlockConnectorCallback = + std::function; +using RemoteStartTransactionCallback = std::function; +using StopTransactionCallback = + std::function; class RemoteTransactionControlInterface : public MessageHandlerInterface { public: - virtual ~RemoteTransactionControlInterface() = default; + ~RemoteTransactionControlInterface() override = default; }; class RemoteTransactionControl : public RemoteTransactionControlInterface { @@ -51,7 +50,8 @@ class RemoteTransactionControl : public RemoteTransactionControlInterface { std::atomic& upload_log_status_id); void handle_message(const ocpp::EnhancedMessage& message) override; -private: // Members +private: + // Members const FunctionalBlockContext& context; TransactionInterface& transaction; @@ -71,7 +71,7 @@ class RemoteTransactionControl : public RemoteTransactionControlInterface { std::atomic& upload_log_status; std::atomic& upload_log_status_id; -private: // Functions + // Functions /* OCPP message handlers */ // Function Block F: Remote transaction control @@ -81,14 +81,6 @@ class RemoteTransactionControl : public RemoteTransactionControlInterface { void handle_trigger_message(Call call); // Helper functions - /// - /// \brief Check if one of the connectors of the evse is available (both connectors faulted or unavailable or on of - /// the connectors occupied). - /// \param evse Evse to check. - /// \return True if at least one connector is not faulted or unavailable. - /// - bool is_evse_connector_available(EvseInterface& evse) const; - /// /// \brief Check if EVSE connector is reserved for another than the given id token and / or group id token. /// \param evse The evse id that must be checked. Reservation will be checked for all connectors. diff --git a/include/ocpp/v2/functional_blocks/reservation.hpp b/include/ocpp/v2/functional_blocks/reservation.hpp index edceba0e7..9f82c7a03 100644 --- a/include/ocpp/v2/functional_blocks/reservation.hpp +++ b/include/ocpp/v2/functional_blocks/reservation.hpp @@ -12,15 +12,14 @@ class EvseInterface; struct ReserveNowRequest; struct CancelReservationRequest; -typedef std::function ReserveNowCallback; -typedef std::function CancelReservationCallback; -typedef std::function idToken, - const std::optional> groupIdToken)> - IsReservationForTokenCallback; +using ReserveNowCallback = std::function; +using CancelReservationCallback = std::function; +using IsReservationForTokenCallback = std::function idToken, const std::optional> groupIdToken)>; class ReservationInterface : public MessageHandlerInterface { public: - virtual ~ReservationInterface() = default; + ~ReservationInterface() override = default; virtual void on_reservation_status(const int32_t reservation_id, const ReservationUpdateStatusEnum status) = 0; virtual ocpp::ReservationCheckStatus is_evse_reserved_for_other(const EvseInterface& evse, const IdToken& id_token, @@ -43,23 +42,23 @@ class Reservation : public ReservationInterface { /// IsReservationForTokenCallback is_reservation_for_token_callback; + // Functions + void handle_reserve_now_request(Call call); + void handle_cancel_reservation_callback(Call call); + void send_reserve_now_rejected_response(const MessageId& unique_id, const std::string& status_info); + public: Reservation(const FunctionalBlockContext& functional_block_context, ReserveNowCallback reserve_now_callback, CancelReservationCallback cancel_reservation_callback, const IsReservationForTokenCallback is_reservation_for_token_callback); - virtual void handle_message(const ocpp::EnhancedMessage& message) override; + void handle_message(const ocpp::EnhancedMessage& message) override; - virtual void on_reservation_status(const int32_t reservation_id, const ReservationUpdateStatusEnum status) override; - virtual ocpp::ReservationCheckStatus + void on_reservation_status(const int32_t reservation_id, const ReservationUpdateStatusEnum status) override; + ocpp::ReservationCheckStatus is_evse_reserved_for_other(const EvseInterface& evse, const IdToken& id_token, const std::optional& group_id_token) const override; - virtual void on_reserved(const int32_t evse_id, const int32_t connector_id) override; - virtual void on_reservation_cleared(const int32_t evse_id, const int32_t connector_id) override; - -private: // Functions - void handle_reserve_now_request(Call call); - void handle_cancel_reservation_callback(Call call); - void send_reserve_now_rejected_response(const MessageId& unique_id, const std::string& status_info); + void on_reserved(const int32_t evse_id, const int32_t connector_id) override; + void on_reservation_cleared(const int32_t evse_id, const int32_t connector_id) override; }; } // namespace ocpp::v2 diff --git a/include/ocpp/v2/functional_blocks/security.hpp b/include/ocpp/v2/functional_blocks/security.hpp index f93fdf962..cbc881bdf 100644 --- a/include/ocpp/v2/functional_blocks/security.hpp +++ b/include/ocpp/v2/functional_blocks/security.hpp @@ -23,14 +23,13 @@ struct InstallCertificateRequest; struct DeleteCertificateRequest; struct SignCertificateResponse; -typedef std::function& event_type, const std::optional>& tech_info)> - SecurityEventCallback; +using SecurityEventCallback = + std::function& event_type, const std::optional>& tech_info)>; class SecurityInterface : public MessageHandlerInterface { public: - virtual ~SecurityInterface() override { - } + ~SecurityInterface() override = default; virtual void security_event_notification_req(const CiString<50>& event_type, const std::optional>& tech_info, const bool triggered_internally, const bool critical, @@ -49,23 +48,23 @@ class Security : public SecurityInterface { public: Security(const FunctionalBlockContext& functional_block_context, MessageLogging& logging, OcspUpdaterInterface& ocsp_updater, SecurityEventCallback security_event_callback); - virtual ~Security(); + ~Security() override; void handle_message(const EnhancedMessage& message) override; - virtual void stop_certificate_signed_timer() override; + void stop_certificate_signed_timer() override; void init_certificate_expiration_check_timers() override; void stop_certificate_expiration_check_timers() override; Get15118EVCertificateResponse on_get_15118_ev_certificate_request(const Get15118EVCertificateRequest& request) override; /* OCPP message requests */ - virtual void security_event_notification_req(const CiString<50>& event_type, - const std::optional>& tech_info, - const bool triggered_internally, const bool critical, - const std::optional& timestamp = std::nullopt) override; - virtual void sign_certificate_req(const ocpp::CertificateSigningUseEnum& certificate_signing_use, - const bool initiated_by_trigger_message = false) override; - -private: // Members + void security_event_notification_req(const CiString<50>& event_type, const std::optional>& tech_info, + const bool triggered_internally, const bool critical, + const std::optional& timestamp = std::nullopt) override; + void sign_certificate_req(const ocpp::CertificateSigningUseEnum& certificate_signing_use, + const bool initiated_by_trigger_message = false) override; + +private: + // Members const FunctionalBlockContext& context; MessageLogging& logging; OcspUpdaterInterface& ocsp_updater; @@ -78,7 +77,7 @@ class Security : public SecurityInterface { Everest::SteadyTimer client_certificate_expiration_check_timer; Everest::SteadyTimer v2g_certificate_expiration_check_timer; -private: // Functions + // Functions /* OCPP message handlers */ // Functional Block A: Security diff --git a/include/ocpp/v2/functional_blocks/smart_charging.hpp b/include/ocpp/v2/functional_blocks/smart_charging.hpp index cdd3da7ec..afc3bd3a1 100644 --- a/include/ocpp/v2/functional_blocks/smart_charging.hpp +++ b/include/ocpp/v2/functional_blocks/smart_charging.hpp @@ -11,8 +11,8 @@ namespace ocpp::v2 { struct FunctionalBlockContext; class SmartChargingHandlerInterface; -typedef std::function - StopTransactionCallback; +using StopTransactionCallback = + std::function; struct LimitsSetpointsForOperationMode; @@ -28,7 +28,7 @@ struct NotifyEVChargingNeedsRequest; struct NotifyEVChargingNeedsResponse; /// \brief Different types of limits and setpoints, used in the limits_setpoints_per_operation_mode map. -enum LimitSetpointType { +enum class LimitSetpointType { Limit, DischargeLimit, Setpoint, @@ -87,6 +87,12 @@ enum class AddChargingProfileSource { RequestStartTransactionRequest }; +/// +/// \brief validates requirements that apply only to the ChargingStationMaxProfile \p profile +/// according to the specification +/// +ProfileValidationResultEnum validate_charging_station_max_profile(const ChargingProfile& profile, int32_t evse_id); + namespace conversions { /// \brief Converts the given ProfileValidationResultEnum \p e to human readable string /// \returns a string representation of the ProfileValidationResultEnum @@ -101,7 +107,7 @@ std::ostream& operator<<(std::ostream& os, const ProfileValidationResultEnum val class SmartChargingInterface : public MessageHandlerInterface { public: - virtual ~SmartChargingInterface() = default; + ~SmartChargingInterface() override = default; /// \brief Gets composite schedules for all evse_ids (including 0) for the given \p duration and \p unit . If no /// valid profiles are given for an evse for the specified period, the composite schedule will be empty for this @@ -197,13 +203,6 @@ class SmartCharging : public SmartChargingInterface { /// ProfileValidationResultEnum validate_evse_exists(int32_t evse_id) const; - /// - /// \brief validates requirements that apply only to the ChargingStationMaxProfile \p profile - /// according to the specification - /// - ProfileValidationResultEnum validate_charging_station_max_profile(const ChargingProfile& profile, - int32_t evse_id) const; - /// /// \brief validates the given \p profile and associated \p evse_id according to the specification /// @@ -276,10 +275,6 @@ class SmartCharging : public SmartChargingInterface { GetCompositeScheduleResponse get_composite_schedule_internal(const GetCompositeScheduleRequest& request, bool simulate_transaction_active = true); - /// \brief validates that the given \p profile from a RequestStartTransactionRequest is of the correct type - /// TxProfile - ProfileValidationResultEnum validate_request_start_transaction_profile(const ChargingProfile& profile) const; - /// /// \brief Checks a given \p candidate_profile and associated \p evse_id validFrom and validTo range /// This method assumes that the existing candidate_profile will have dates set for validFrom and validTo @@ -292,15 +287,7 @@ class SmartCharging : public SmartChargingInterface { std::vector get_valid_profiles_for_evse(int32_t evse_id, const std::vector& purposes_to_ignore = {}); - /// \brief sets attributes of the given \p charging_schedule_period according to the specification. - /// 2.11. ChargingSchedulePeriodType if absent numberPhases set to 3 - void conform_schedule_number_phases(int32_t profile_id, ChargingSchedulePeriod& charging_schedule_period) const; - /// - /// \brief sets attributes of the given \p profile according to the specification. - /// 2.10. ChargingProfileType validFrom if absent set to current date - /// 2.10. ChargingProfileType validTo if absent set to max date - /// - void conform_validity_periods(ChargingProfile& profile) const; + CurrentPhaseType get_current_phase_type(const std::optional evse_opt) const; /// diff --git a/include/ocpp/v2/functional_blocks/tariff_and_cost.hpp b/include/ocpp/v2/functional_blocks/tariff_and_cost.hpp index ba2aacf59..31e2df096 100644 --- a/include/ocpp/v2/functional_blocks/tariff_and_cost.hpp +++ b/include/ocpp/v2/functional_blocks/tariff_and_cost.hpp @@ -13,10 +13,9 @@ class MeterValuesInterface; struct CostUpdatedRequest; -typedef std::function currency_code)> - SetRunningCostCallback; -typedef std::function TariffMessageCallback; +using SetRunningCostCallback = std::function currency_code)>; +using TariffMessageCallback = std::function; class TariffAndCostInterface : public MessageHandlerInterface { public: @@ -45,14 +44,15 @@ class TariffAndCost : public TariffAndCostInterface { const TransactionEventRequest& original_message, const json& original_transaction_event_response) override; -private: // Members +private: + // Members const FunctionalBlockContext& context; MeterValuesInterface& meter_values; std::optional tariff_message_callback; std::optional set_running_cost_callback; boost::asio::io_context& io_context; -private: // Functions + // Functions // Functional Block I: TariffAndCost void handle_costupdated_req(const Call call); diff --git a/include/ocpp/v2/functional_blocks/transaction.hpp b/include/ocpp/v2/functional_blocks/transaction.hpp index 36d50d9dc..294d9b422 100644 --- a/include/ocpp/v2/functional_blocks/transaction.hpp +++ b/include/ocpp/v2/functional_blocks/transaction.hpp @@ -14,18 +14,17 @@ class TariffAndCostInterface; struct GetTransactionStatusRequest; -typedef std::function TransactionEventCallback; -typedef std::function evse_id, const ResetEnum& reset_type)> ResetCallback; -typedef std::function - TransactionEventResponseCallback; -typedef std::function - StopTransactionCallback; -typedef std::function PauseChargingCallback; +using TransactionEventCallback = std::function; +using ResetCallback = std::function evse_id, const ResetEnum& reset_type)>; +using TransactionEventResponseCallback = std::function; +using StopTransactionCallback = + std::function; +using PauseChargingCallback = std::function; class TransactionInterface : public MessageHandlerInterface { public: - virtual ~TransactionInterface() = default; + ~TransactionInterface() override = default; /// \brief Event handler that should be called when a transaction has started /// \param evse_id @@ -112,7 +111,8 @@ class TransactionBlock : public TransactionInterface { const int32_t remote_start_id) override; void schedule_reset(const std::optional reset_scheduled_evseid) override; -private: // Members +private: + // Members const FunctionalBlockContext& context; MessageQueue& message_queue; AuthorizationInterface& authorization; @@ -131,7 +131,7 @@ class TransactionBlock : public TransactionInterface { /// \brief If `reset_scheduled` is true and the reset is for a specific evse id, it will be stored in this member. std::set reset_scheduled_evseids; -private: // Functions + // Functions /* OCPP message handlers */ // Functional Block E: Transaction diff --git a/include/ocpp/v2/init_device_model_db.hpp b/include/ocpp/v2/init_device_model_db.hpp index 703dc31df..620c5587d 100644 --- a/include/ocpp/v2/init_device_model_db.hpp +++ b/include/ocpp/v2/init_device_model_db.hpp @@ -113,11 +113,9 @@ class InitDeviceModelDbError : public std::exception { [[nodiscard]] const char* what() const noexcept override { return this->reason.c_str(); } - explicit InitDeviceModelDbError(std::string msg) { - this->reason = std::move(msg); + explicit InitDeviceModelDbError(std::string msg) : reason(std::move(msg)) { } - explicit InitDeviceModelDbError(const char* msg) { - this->reason = std::string(msg); + explicit InitDeviceModelDbError(const char* msg) : reason(std::string(msg)) { } private: @@ -150,7 +148,7 @@ class InitDeviceModelDb : public common::DatabaseHandlerCommon { /// /// \brief Destructor /// - virtual ~InitDeviceModelDb(); + ~InitDeviceModelDb() override; /// /// \brief Initialize the database schema and component config. @@ -359,25 +357,6 @@ class InitDeviceModelDb : public common::DatabaseHandlerCommon { /// std::map> get_all_components_from_db(); - /// - /// \brief Check if a specific component exists in the databsae. - /// \param db_components The current components in the database. - /// \param component The component to check against. - /// \return The component from the database if it exists. - /// - std::optional>> - component_exists_in_db(const std::map>& db_components, - const ComponentKey& component); - - /// - /// \brief Check if a component exist in the component config. - /// \param component_config The map of component / variables read from the json component config. - /// \param component The component to check. - /// \return True when the component exists in the config. - /// - bool component_exists_in_config(const std::map>& component_config, - const ComponentKey& component); - /// /// \brief Remove components from db that do not exist in the component config. /// \param component_config The component config. @@ -431,6 +410,6 @@ class InitDeviceModelDb : public common::DatabaseHandlerCommon { /// /// \throw InitDeviceModelDbError When foreign key pragma could not be set to 'ON'. /// - virtual void init_sql() override; + void init_sql() override; }; } // namespace ocpp::v2 diff --git a/include/ocpp/v2/message_handler.hpp b/include/ocpp/v2/message_handler.hpp index 80c107c99..06603ed23 100644 --- a/include/ocpp/v2/message_handler.hpp +++ b/include/ocpp/v2/message_handler.hpp @@ -13,8 +13,7 @@ namespace v2 { class MessageHandlerInterface { public: - virtual ~MessageHandlerInterface() { - } + virtual ~MessageHandlerInterface() = default; /// \brief Handles the given \p message from the CSMS. This includes dispatching a CALLRESULT as a response to the /// incoming \p message . /// @param message diff --git a/include/ocpp/v2/messages/ChangeAvailability.hpp b/include/ocpp/v2/messages/ChangeAvailability.hpp index e6ee9dc31..4337f3f62 100644 --- a/include/ocpp/v2/messages/ChangeAvailability.hpp +++ b/include/ocpp/v2/messages/ChangeAvailability.hpp @@ -54,7 +54,8 @@ void to_json(json& j, const ChangeAvailabilityResponse& k); void from_json(const json& j, ChangeAvailabilityResponse& k); /// \brief Writes the string representation of the given ChangeAvailabilityResponse \p k to the given output stream \p -/// os \returns an output stream with the ChangeAvailabilityResponse written to +/// os +/// \returns an output stream with the ChangeAvailabilityResponse written to std::ostream& operator<<(std::ostream& os, const ChangeAvailabilityResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/ClearChargingProfile.hpp b/include/ocpp/v2/messages/ClearChargingProfile.hpp index 05baa3cc6..04ab8f58a 100644 --- a/include/ocpp/v2/messages/ClearChargingProfile.hpp +++ b/include/ocpp/v2/messages/ClearChargingProfile.hpp @@ -33,7 +33,8 @@ void to_json(json& j, const ClearChargingProfileRequest& k); void from_json(const json& j, ClearChargingProfileRequest& k); /// \brief Writes the string representation of the given ClearChargingProfileRequest \p k to the given output stream \p -/// os \returns an output stream with the ClearChargingProfileRequest written to +/// os +/// \returns an output stream with the ClearChargingProfileRequest written to std::ostream& operator<<(std::ostream& os, const ClearChargingProfileRequest& k); /// \brief Contains a OCPP ClearChargingProfileResponse message @@ -54,7 +55,8 @@ void to_json(json& j, const ClearChargingProfileResponse& k); void from_json(const json& j, ClearChargingProfileResponse& k); /// \brief Writes the string representation of the given ClearChargingProfileResponse \p k to the given output stream \p -/// os \returns an output stream with the ClearChargingProfileResponse written to +/// os +/// \returns an output stream with the ClearChargingProfileResponse written to std::ostream& operator<<(std::ostream& os, const ClearChargingProfileResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/ClearDisplayMessage.hpp b/include/ocpp/v2/messages/ClearDisplayMessage.hpp index 3b76e6573..98438e4f4 100644 --- a/include/ocpp/v2/messages/ClearDisplayMessage.hpp +++ b/include/ocpp/v2/messages/ClearDisplayMessage.hpp @@ -32,7 +32,8 @@ void to_json(json& j, const ClearDisplayMessageRequest& k); void from_json(const json& j, ClearDisplayMessageRequest& k); /// \brief Writes the string representation of the given ClearDisplayMessageRequest \p k to the given output stream \p -/// os \returns an output stream with the ClearDisplayMessageRequest written to +/// os +/// \returns an output stream with the ClearDisplayMessageRequest written to std::ostream& operator<<(std::ostream& os, const ClearDisplayMessageRequest& k); /// \brief Contains a OCPP ClearDisplayMessageResponse message @@ -53,7 +54,8 @@ void to_json(json& j, const ClearDisplayMessageResponse& k); void from_json(const json& j, ClearDisplayMessageResponse& k); /// \brief Writes the string representation of the given ClearDisplayMessageResponse \p k to the given output stream \p -/// os \returns an output stream with the ClearDisplayMessageResponse written to +/// os +/// \returns an output stream with the ClearDisplayMessageResponse written to std::ostream& operator<<(std::ostream& os, const ClearDisplayMessageResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/ClearVariableMonitoring.hpp b/include/ocpp/v2/messages/ClearVariableMonitoring.hpp index b6479b88c..5214a8910 100644 --- a/include/ocpp/v2/messages/ClearVariableMonitoring.hpp +++ b/include/ocpp/v2/messages/ClearVariableMonitoring.hpp @@ -32,7 +32,8 @@ void to_json(json& j, const ClearVariableMonitoringRequest& k); void from_json(const json& j, ClearVariableMonitoringRequest& k); /// \brief Writes the string representation of the given ClearVariableMonitoringRequest \p k to the given output stream -/// \p os \returns an output stream with the ClearVariableMonitoringRequest written to +/// \p os +/// \returns an output stream with the ClearVariableMonitoringRequest written to std::ostream& operator<<(std::ostream& os, const ClearVariableMonitoringRequest& k); /// \brief Contains a OCPP ClearVariableMonitoringResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const ClearVariableMonitoringResponse& k); void from_json(const json& j, ClearVariableMonitoringResponse& k); /// \brief Writes the string representation of the given ClearVariableMonitoringResponse \p k to the given output stream -/// \p os \returns an output stream with the ClearVariableMonitoringResponse written to +/// \p os +/// \returns an output stream with the ClearVariableMonitoringResponse written to std::ostream& operator<<(std::ostream& os, const ClearVariableMonitoringResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/ClearedChargingLimit.hpp b/include/ocpp/v2/messages/ClearedChargingLimit.hpp index e74ad6dbe..cc9e52f94 100644 --- a/include/ocpp/v2/messages/ClearedChargingLimit.hpp +++ b/include/ocpp/v2/messages/ClearedChargingLimit.hpp @@ -32,7 +32,8 @@ void to_json(json& j, const ClearedChargingLimitRequest& k); void from_json(const json& j, ClearedChargingLimitRequest& k); /// \brief Writes the string representation of the given ClearedChargingLimitRequest \p k to the given output stream \p -/// os \returns an output stream with the ClearedChargingLimitRequest written to +/// os +/// \returns an output stream with the ClearedChargingLimitRequest written to std::ostream& operator<<(std::ostream& os, const ClearedChargingLimitRequest& k); /// \brief Contains a OCPP ClearedChargingLimitResponse message @@ -51,7 +52,8 @@ void to_json(json& j, const ClearedChargingLimitResponse& k); void from_json(const json& j, ClearedChargingLimitResponse& k); /// \brief Writes the string representation of the given ClearedChargingLimitResponse \p k to the given output stream \p -/// os \returns an output stream with the ClearedChargingLimitResponse written to +/// os +/// \returns an output stream with the ClearedChargingLimitResponse written to std::ostream& operator<<(std::ostream& os, const ClearedChargingLimitResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/CustomerInformation.hpp b/include/ocpp/v2/messages/CustomerInformation.hpp index 75d268083..8ae0d8574 100644 --- a/include/ocpp/v2/messages/CustomerInformation.hpp +++ b/include/ocpp/v2/messages/CustomerInformation.hpp @@ -37,7 +37,8 @@ void to_json(json& j, const CustomerInformationRequest& k); void from_json(const json& j, CustomerInformationRequest& k); /// \brief Writes the string representation of the given CustomerInformationRequest \p k to the given output stream \p -/// os \returns an output stream with the CustomerInformationRequest written to +/// os +/// \returns an output stream with the CustomerInformationRequest written to std::ostream& operator<<(std::ostream& os, const CustomerInformationRequest& k); /// \brief Contains a OCPP CustomerInformationResponse message @@ -58,7 +59,8 @@ void to_json(json& j, const CustomerInformationResponse& k); void from_json(const json& j, CustomerInformationResponse& k); /// \brief Writes the string representation of the given CustomerInformationResponse \p k to the given output stream \p -/// os \returns an output stream with the CustomerInformationResponse written to +/// os +/// \returns an output stream with the CustomerInformationResponse written to std::ostream& operator<<(std::ostream& os, const CustomerInformationResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/FirmwareStatusNotification.hpp b/include/ocpp/v2/messages/FirmwareStatusNotification.hpp index 32f9a6320..1339909d7 100644 --- a/include/ocpp/v2/messages/FirmwareStatusNotification.hpp +++ b/include/ocpp/v2/messages/FirmwareStatusNotification.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const FirmwareStatusNotificationRequest& k); void from_json(const json& j, FirmwareStatusNotificationRequest& k); /// \brief Writes the string representation of the given FirmwareStatusNotificationRequest \p k to the given output -/// stream \p os \returns an output stream with the FirmwareStatusNotificationRequest written to +/// stream \p os +/// \returns an output stream with the FirmwareStatusNotificationRequest written to std::ostream& operator<<(std::ostream& os, const FirmwareStatusNotificationRequest& k); /// \brief Contains a OCPP FirmwareStatusNotificationResponse message @@ -53,7 +54,8 @@ void to_json(json& j, const FirmwareStatusNotificationResponse& k); void from_json(const json& j, FirmwareStatusNotificationResponse& k); /// \brief Writes the string representation of the given FirmwareStatusNotificationResponse \p k to the given output -/// stream \p os \returns an output stream with the FirmwareStatusNotificationResponse written to +/// stream \p os +/// \returns an output stream with the FirmwareStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const FirmwareStatusNotificationResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/Get15118EVCertificate.hpp b/include/ocpp/v2/messages/Get15118EVCertificate.hpp index 77a553c30..3c52fd324 100644 --- a/include/ocpp/v2/messages/Get15118EVCertificate.hpp +++ b/include/ocpp/v2/messages/Get15118EVCertificate.hpp @@ -37,7 +37,8 @@ void to_json(json& j, const Get15118EVCertificateRequest& k); void from_json(const json& j, Get15118EVCertificateRequest& k); /// \brief Writes the string representation of the given Get15118EVCertificateRequest \p k to the given output stream \p -/// os \returns an output stream with the Get15118EVCertificateRequest written to +/// os +/// \returns an output stream with the Get15118EVCertificateRequest written to std::ostream& operator<<(std::ostream& os, const Get15118EVCertificateRequest& k); /// \brief Contains a OCPP Get15118EVCertificateResponse message @@ -60,7 +61,8 @@ void to_json(json& j, const Get15118EVCertificateResponse& k); void from_json(const json& j, Get15118EVCertificateResponse& k); /// \brief Writes the string representation of the given Get15118EVCertificateResponse \p k to the given output stream -/// \p os \returns an output stream with the Get15118EVCertificateResponse written to +/// \p os +/// \returns an output stream with the Get15118EVCertificateResponse written to std::ostream& operator<<(std::ostream& os, const Get15118EVCertificateResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/GetCertificateStatus.hpp b/include/ocpp/v2/messages/GetCertificateStatus.hpp index b9ac144ef..c8809e7ec 100644 --- a/include/ocpp/v2/messages/GetCertificateStatus.hpp +++ b/include/ocpp/v2/messages/GetCertificateStatus.hpp @@ -32,7 +32,8 @@ void to_json(json& j, const GetCertificateStatusRequest& k); void from_json(const json& j, GetCertificateStatusRequest& k); /// \brief Writes the string representation of the given GetCertificateStatusRequest \p k to the given output stream \p -/// os \returns an output stream with the GetCertificateStatusRequest written to +/// os +/// \returns an output stream with the GetCertificateStatusRequest written to std::ostream& operator<<(std::ostream& os, const GetCertificateStatusRequest& k); /// \brief Contains a OCPP GetCertificateStatusResponse message @@ -54,7 +55,8 @@ void to_json(json& j, const GetCertificateStatusResponse& k); void from_json(const json& j, GetCertificateStatusResponse& k); /// \brief Writes the string representation of the given GetCertificateStatusResponse \p k to the given output stream \p -/// os \returns an output stream with the GetCertificateStatusResponse written to +/// os +/// \returns an output stream with the GetCertificateStatusResponse written to std::ostream& operator<<(std::ostream& os, const GetCertificateStatusResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/GetChargingProfiles.hpp b/include/ocpp/v2/messages/GetChargingProfiles.hpp index f6f4f13b9..864a21a11 100644 --- a/include/ocpp/v2/messages/GetChargingProfiles.hpp +++ b/include/ocpp/v2/messages/GetChargingProfiles.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const GetChargingProfilesRequest& k); void from_json(const json& j, GetChargingProfilesRequest& k); /// \brief Writes the string representation of the given GetChargingProfilesRequest \p k to the given output stream \p -/// os \returns an output stream with the GetChargingProfilesRequest written to +/// os +/// \returns an output stream with the GetChargingProfilesRequest written to std::ostream& operator<<(std::ostream& os, const GetChargingProfilesRequest& k); /// \brief Contains a OCPP GetChargingProfilesResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const GetChargingProfilesResponse& k); void from_json(const json& j, GetChargingProfilesResponse& k); /// \brief Writes the string representation of the given GetChargingProfilesResponse \p k to the given output stream \p -/// os \returns an output stream with the GetChargingProfilesResponse written to +/// os +/// \returns an output stream with the GetChargingProfilesResponse written to std::ostream& operator<<(std::ostream& os, const GetChargingProfilesResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/GetCompositeSchedule.hpp b/include/ocpp/v2/messages/GetCompositeSchedule.hpp index 1e272ccd5..c6244fb8d 100644 --- a/include/ocpp/v2/messages/GetCompositeSchedule.hpp +++ b/include/ocpp/v2/messages/GetCompositeSchedule.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const GetCompositeScheduleRequest& k); void from_json(const json& j, GetCompositeScheduleRequest& k); /// \brief Writes the string representation of the given GetCompositeScheduleRequest \p k to the given output stream \p -/// os \returns an output stream with the GetCompositeScheduleRequest written to +/// os +/// \returns an output stream with the GetCompositeScheduleRequest written to std::ostream& operator<<(std::ostream& os, const GetCompositeScheduleRequest& k); /// \brief Contains a OCPP GetCompositeScheduleResponse message @@ -56,7 +57,8 @@ void to_json(json& j, const GetCompositeScheduleResponse& k); void from_json(const json& j, GetCompositeScheduleResponse& k); /// \brief Writes the string representation of the given GetCompositeScheduleResponse \p k to the given output stream \p -/// os \returns an output stream with the GetCompositeScheduleResponse written to +/// os +/// \returns an output stream with the GetCompositeScheduleResponse written to std::ostream& operator<<(std::ostream& os, const GetCompositeScheduleResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/GetDisplayMessages.hpp b/include/ocpp/v2/messages/GetDisplayMessages.hpp index ec134cc29..09b8f0545 100644 --- a/include/ocpp/v2/messages/GetDisplayMessages.hpp +++ b/include/ocpp/v2/messages/GetDisplayMessages.hpp @@ -56,7 +56,8 @@ void to_json(json& j, const GetDisplayMessagesResponse& k); void from_json(const json& j, GetDisplayMessagesResponse& k); /// \brief Writes the string representation of the given GetDisplayMessagesResponse \p k to the given output stream \p -/// os \returns an output stream with the GetDisplayMessagesResponse written to +/// os +/// \returns an output stream with the GetDisplayMessagesResponse written to std::ostream& operator<<(std::ostream& os, const GetDisplayMessagesResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/GetInstalledCertificateIds.hpp b/include/ocpp/v2/messages/GetInstalledCertificateIds.hpp index 5c71e33bf..c2e103647 100644 --- a/include/ocpp/v2/messages/GetInstalledCertificateIds.hpp +++ b/include/ocpp/v2/messages/GetInstalledCertificateIds.hpp @@ -32,7 +32,8 @@ void to_json(json& j, const GetInstalledCertificateIdsRequest& k); void from_json(const json& j, GetInstalledCertificateIdsRequest& k); /// \brief Writes the string representation of the given GetInstalledCertificateIdsRequest \p k to the given output -/// stream \p os \returns an output stream with the GetInstalledCertificateIdsRequest written to +/// stream \p os +/// \returns an output stream with the GetInstalledCertificateIdsRequest written to std::ostream& operator<<(std::ostream& os, const GetInstalledCertificateIdsRequest& k); /// \brief Contains a OCPP GetInstalledCertificateIdsResponse message @@ -54,7 +55,8 @@ void to_json(json& j, const GetInstalledCertificateIdsResponse& k); void from_json(const json& j, GetInstalledCertificateIdsResponse& k); /// \brief Writes the string representation of the given GetInstalledCertificateIdsResponse \p k to the given output -/// stream \p os \returns an output stream with the GetInstalledCertificateIdsResponse written to +/// stream \p os +/// \returns an output stream with the GetInstalledCertificateIdsResponse written to std::ostream& operator<<(std::ostream& os, const GetInstalledCertificateIdsResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/GetLocalListVersion.hpp b/include/ocpp/v2/messages/GetLocalListVersion.hpp index 9c44437b9..1b13b9683 100644 --- a/include/ocpp/v2/messages/GetLocalListVersion.hpp +++ b/include/ocpp/v2/messages/GetLocalListVersion.hpp @@ -30,7 +30,8 @@ void to_json(json& j, const GetLocalListVersionRequest& k); void from_json(const json& j, GetLocalListVersionRequest& k); /// \brief Writes the string representation of the given GetLocalListVersionRequest \p k to the given output stream \p -/// os \returns an output stream with the GetLocalListVersionRequest written to +/// os +/// \returns an output stream with the GetLocalListVersionRequest written to std::ostream& operator<<(std::ostream& os, const GetLocalListVersionRequest& k); /// \brief Contains a OCPP GetLocalListVersionResponse message @@ -50,7 +51,8 @@ void to_json(json& j, const GetLocalListVersionResponse& k); void from_json(const json& j, GetLocalListVersionResponse& k); /// \brief Writes the string representation of the given GetLocalListVersionResponse \p k to the given output stream \p -/// os \returns an output stream with the GetLocalListVersionResponse written to +/// os +/// \returns an output stream with the GetLocalListVersionResponse written to std::ostream& operator<<(std::ostream& os, const GetLocalListVersionResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/GetMonitoringReport.hpp b/include/ocpp/v2/messages/GetMonitoringReport.hpp index 3951b0aae..e6595ca96 100644 --- a/include/ocpp/v2/messages/GetMonitoringReport.hpp +++ b/include/ocpp/v2/messages/GetMonitoringReport.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const GetMonitoringReportRequest& k); void from_json(const json& j, GetMonitoringReportRequest& k); /// \brief Writes the string representation of the given GetMonitoringReportRequest \p k to the given output stream \p -/// os \returns an output stream with the GetMonitoringReportRequest written to +/// os +/// \returns an output stream with the GetMonitoringReportRequest written to std::ostream& operator<<(std::ostream& os, const GetMonitoringReportRequest& k); /// \brief Contains a OCPP GetMonitoringReportResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const GetMonitoringReportResponse& k); void from_json(const json& j, GetMonitoringReportResponse& k); /// \brief Writes the string representation of the given GetMonitoringReportResponse \p k to the given output stream \p -/// os \returns an output stream with the GetMonitoringReportResponse written to +/// os +/// \returns an output stream with the GetMonitoringReportResponse written to std::ostream& operator<<(std::ostream& os, const GetMonitoringReportResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/GetTransactionStatus.hpp b/include/ocpp/v2/messages/GetTransactionStatus.hpp index 9d013d498..42e9befa8 100644 --- a/include/ocpp/v2/messages/GetTransactionStatus.hpp +++ b/include/ocpp/v2/messages/GetTransactionStatus.hpp @@ -31,7 +31,8 @@ void to_json(json& j, const GetTransactionStatusRequest& k); void from_json(const json& j, GetTransactionStatusRequest& k); /// \brief Writes the string representation of the given GetTransactionStatusRequest \p k to the given output stream \p -/// os \returns an output stream with the GetTransactionStatusRequest written to +/// os +/// \returns an output stream with the GetTransactionStatusRequest written to std::ostream& operator<<(std::ostream& os, const GetTransactionStatusRequest& k); /// \brief Contains a OCPP GetTransactionStatusResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const GetTransactionStatusResponse& k); void from_json(const json& j, GetTransactionStatusResponse& k); /// \brief Writes the string representation of the given GetTransactionStatusResponse \p k to the given output stream \p -/// os \returns an output stream with the GetTransactionStatusResponse written to +/// os +/// \returns an output stream with the GetTransactionStatusResponse written to std::ostream& operator<<(std::ostream& os, const GetTransactionStatusResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/InstallCertificate.hpp b/include/ocpp/v2/messages/InstallCertificate.hpp index 71e64b67d..8f47fc04d 100644 --- a/include/ocpp/v2/messages/InstallCertificate.hpp +++ b/include/ocpp/v2/messages/InstallCertificate.hpp @@ -54,7 +54,8 @@ void to_json(json& j, const InstallCertificateResponse& k); void from_json(const json& j, InstallCertificateResponse& k); /// \brief Writes the string representation of the given InstallCertificateResponse \p k to the given output stream \p -/// os \returns an output stream with the InstallCertificateResponse written to +/// os +/// \returns an output stream with the InstallCertificateResponse written to std::ostream& operator<<(std::ostream& os, const InstallCertificateResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/LogStatusNotification.hpp b/include/ocpp/v2/messages/LogStatusNotification.hpp index 17dbf29f7..bfc8cf62c 100644 --- a/include/ocpp/v2/messages/LogStatusNotification.hpp +++ b/include/ocpp/v2/messages/LogStatusNotification.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const LogStatusNotificationRequest& k); void from_json(const json& j, LogStatusNotificationRequest& k); /// \brief Writes the string representation of the given LogStatusNotificationRequest \p k to the given output stream \p -/// os \returns an output stream with the LogStatusNotificationRequest written to +/// os +/// \returns an output stream with the LogStatusNotificationRequest written to std::ostream& operator<<(std::ostream& os, const LogStatusNotificationRequest& k); /// \brief Contains a OCPP LogStatusNotificationResponse message @@ -53,7 +54,8 @@ void to_json(json& j, const LogStatusNotificationResponse& k); void from_json(const json& j, LogStatusNotificationResponse& k); /// \brief Writes the string representation of the given LogStatusNotificationResponse \p k to the given output stream -/// \p os \returns an output stream with the LogStatusNotificationResponse written to +/// \p os +/// \returns an output stream with the LogStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const LogStatusNotificationResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/NotifyChargingLimit.hpp b/include/ocpp/v2/messages/NotifyChargingLimit.hpp index 8bee47a04..8a6f552b6 100644 --- a/include/ocpp/v2/messages/NotifyChargingLimit.hpp +++ b/include/ocpp/v2/messages/NotifyChargingLimit.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const NotifyChargingLimitRequest& k); void from_json(const json& j, NotifyChargingLimitRequest& k); /// \brief Writes the string representation of the given NotifyChargingLimitRequest \p k to the given output stream \p -/// os \returns an output stream with the NotifyChargingLimitRequest written to +/// os +/// \returns an output stream with the NotifyChargingLimitRequest written to std::ostream& operator<<(std::ostream& os, const NotifyChargingLimitRequest& k); /// \brief Contains a OCPP NotifyChargingLimitResponse message @@ -53,7 +54,8 @@ void to_json(json& j, const NotifyChargingLimitResponse& k); void from_json(const json& j, NotifyChargingLimitResponse& k); /// \brief Writes the string representation of the given NotifyChargingLimitResponse \p k to the given output stream \p -/// os \returns an output stream with the NotifyChargingLimitResponse written to +/// os +/// \returns an output stream with the NotifyChargingLimitResponse written to std::ostream& operator<<(std::ostream& os, const NotifyChargingLimitResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/NotifyCustomerInformation.hpp b/include/ocpp/v2/messages/NotifyCustomerInformation.hpp index 7b1a894f1..836ff8973 100644 --- a/include/ocpp/v2/messages/NotifyCustomerInformation.hpp +++ b/include/ocpp/v2/messages/NotifyCustomerInformation.hpp @@ -35,7 +35,8 @@ void to_json(json& j, const NotifyCustomerInformationRequest& k); void from_json(const json& j, NotifyCustomerInformationRequest& k); /// \brief Writes the string representation of the given NotifyCustomerInformationRequest \p k to the given output -/// stream \p os \returns an output stream with the NotifyCustomerInformationRequest written to +/// stream \p os +/// \returns an output stream with the NotifyCustomerInformationRequest written to std::ostream& operator<<(std::ostream& os, const NotifyCustomerInformationRequest& k); /// \brief Contains a OCPP NotifyCustomerInformationResponse message @@ -54,7 +55,8 @@ void to_json(json& j, const NotifyCustomerInformationResponse& k); void from_json(const json& j, NotifyCustomerInformationResponse& k); /// \brief Writes the string representation of the given NotifyCustomerInformationResponse \p k to the given output -/// stream \p os \returns an output stream with the NotifyCustomerInformationResponse written to +/// stream \p os +/// \returns an output stream with the NotifyCustomerInformationResponse written to std::ostream& operator<<(std::ostream& os, const NotifyCustomerInformationResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/NotifyDisplayMessages.hpp b/include/ocpp/v2/messages/NotifyDisplayMessages.hpp index ec2d40100..2450c09e5 100644 --- a/include/ocpp/v2/messages/NotifyDisplayMessages.hpp +++ b/include/ocpp/v2/messages/NotifyDisplayMessages.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const NotifyDisplayMessagesRequest& k); void from_json(const json& j, NotifyDisplayMessagesRequest& k); /// \brief Writes the string representation of the given NotifyDisplayMessagesRequest \p k to the given output stream \p -/// os \returns an output stream with the NotifyDisplayMessagesRequest written to +/// os +/// \returns an output stream with the NotifyDisplayMessagesRequest written to std::ostream& operator<<(std::ostream& os, const NotifyDisplayMessagesRequest& k); /// \brief Contains a OCPP NotifyDisplayMessagesResponse message @@ -53,7 +54,8 @@ void to_json(json& j, const NotifyDisplayMessagesResponse& k); void from_json(const json& j, NotifyDisplayMessagesResponse& k); /// \brief Writes the string representation of the given NotifyDisplayMessagesResponse \p k to the given output stream -/// \p os \returns an output stream with the NotifyDisplayMessagesResponse written to +/// \p os +/// \returns an output stream with the NotifyDisplayMessagesResponse written to std::ostream& operator<<(std::ostream& os, const NotifyDisplayMessagesResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/NotifyEVChargingNeeds.hpp b/include/ocpp/v2/messages/NotifyEVChargingNeeds.hpp index 863b01fdd..dd23596d3 100644 --- a/include/ocpp/v2/messages/NotifyEVChargingNeeds.hpp +++ b/include/ocpp/v2/messages/NotifyEVChargingNeeds.hpp @@ -35,7 +35,8 @@ void to_json(json& j, const NotifyEVChargingNeedsRequest& k); void from_json(const json& j, NotifyEVChargingNeedsRequest& k); /// \brief Writes the string representation of the given NotifyEVChargingNeedsRequest \p k to the given output stream \p -/// os \returns an output stream with the NotifyEVChargingNeedsRequest written to +/// os +/// \returns an output stream with the NotifyEVChargingNeedsRequest written to std::ostream& operator<<(std::ostream& os, const NotifyEVChargingNeedsRequest& k); /// \brief Contains a OCPP NotifyEVChargingNeedsResponse message @@ -56,7 +57,8 @@ void to_json(json& j, const NotifyEVChargingNeedsResponse& k); void from_json(const json& j, NotifyEVChargingNeedsResponse& k); /// \brief Writes the string representation of the given NotifyEVChargingNeedsResponse \p k to the given output stream -/// \p os \returns an output stream with the NotifyEVChargingNeedsResponse written to +/// \p os +/// \returns an output stream with the NotifyEVChargingNeedsResponse written to std::ostream& operator<<(std::ostream& os, const NotifyEVChargingNeedsResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/NotifyEVChargingSchedule.hpp b/include/ocpp/v2/messages/NotifyEVChargingSchedule.hpp index a5c4b40b1..e7826ff12 100644 --- a/include/ocpp/v2/messages/NotifyEVChargingSchedule.hpp +++ b/include/ocpp/v2/messages/NotifyEVChargingSchedule.hpp @@ -36,7 +36,8 @@ void to_json(json& j, const NotifyEVChargingScheduleRequest& k); void from_json(const json& j, NotifyEVChargingScheduleRequest& k); /// \brief Writes the string representation of the given NotifyEVChargingScheduleRequest \p k to the given output stream -/// \p os \returns an output stream with the NotifyEVChargingScheduleRequest written to +/// \p os +/// \returns an output stream with the NotifyEVChargingScheduleRequest written to std::ostream& operator<<(std::ostream& os, const NotifyEVChargingScheduleRequest& k); /// \brief Contains a OCPP NotifyEVChargingScheduleResponse message @@ -57,7 +58,8 @@ void to_json(json& j, const NotifyEVChargingScheduleResponse& k); void from_json(const json& j, NotifyEVChargingScheduleResponse& k); /// \brief Writes the string representation of the given NotifyEVChargingScheduleResponse \p k to the given output -/// stream \p os \returns an output stream with the NotifyEVChargingScheduleResponse written to +/// stream \p os +/// \returns an output stream with the NotifyEVChargingScheduleResponse written to std::ostream& operator<<(std::ostream& os, const NotifyEVChargingScheduleResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/NotifyMonitoringReport.hpp b/include/ocpp/v2/messages/NotifyMonitoringReport.hpp index cafabb754..e84c00560 100644 --- a/include/ocpp/v2/messages/NotifyMonitoringReport.hpp +++ b/include/ocpp/v2/messages/NotifyMonitoringReport.hpp @@ -36,7 +36,8 @@ void to_json(json& j, const NotifyMonitoringReportRequest& k); void from_json(const json& j, NotifyMonitoringReportRequest& k); /// \brief Writes the string representation of the given NotifyMonitoringReportRequest \p k to the given output stream -/// \p os \returns an output stream with the NotifyMonitoringReportRequest written to +/// \p os +/// \returns an output stream with the NotifyMonitoringReportRequest written to std::ostream& operator<<(std::ostream& os, const NotifyMonitoringReportRequest& k); /// \brief Contains a OCPP NotifyMonitoringReportResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const NotifyMonitoringReportResponse& k); void from_json(const json& j, NotifyMonitoringReportResponse& k); /// \brief Writes the string representation of the given NotifyMonitoringReportResponse \p k to the given output stream -/// \p os \returns an output stream with the NotifyMonitoringReportResponse written to +/// \p os +/// \returns an output stream with the NotifyMonitoringReportResponse written to std::ostream& operator<<(std::ostream& os, const NotifyMonitoringReportResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/PublishFirmwareStatusNotification.hpp b/include/ocpp/v2/messages/PublishFirmwareStatusNotification.hpp index 3c955ff0e..66da07e46 100644 --- a/include/ocpp/v2/messages/PublishFirmwareStatusNotification.hpp +++ b/include/ocpp/v2/messages/PublishFirmwareStatusNotification.hpp @@ -35,7 +35,8 @@ void to_json(json& j, const PublishFirmwareStatusNotificationRequest& k); void from_json(const json& j, PublishFirmwareStatusNotificationRequest& k); /// \brief Writes the string representation of the given PublishFirmwareStatusNotificationRequest \p k to the given -/// output stream \p os \returns an output stream with the PublishFirmwareStatusNotificationRequest written to +/// output stream \p os +/// \returns an output stream with the PublishFirmwareStatusNotificationRequest written to std::ostream& operator<<(std::ostream& os, const PublishFirmwareStatusNotificationRequest& k); /// \brief Contains a OCPP PublishFirmwareStatusNotificationResponse message @@ -54,7 +55,8 @@ void to_json(json& j, const PublishFirmwareStatusNotificationResponse& k); void from_json(const json& j, PublishFirmwareStatusNotificationResponse& k); /// \brief Writes the string representation of the given PublishFirmwareStatusNotificationResponse \p k to the given -/// output stream \p os \returns an output stream with the PublishFirmwareStatusNotificationResponse written to +/// output stream \p os +/// \returns an output stream with the PublishFirmwareStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const PublishFirmwareStatusNotificationResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/ReportChargingProfiles.hpp b/include/ocpp/v2/messages/ReportChargingProfiles.hpp index 665ab08f7..b7a52dd10 100644 --- a/include/ocpp/v2/messages/ReportChargingProfiles.hpp +++ b/include/ocpp/v2/messages/ReportChargingProfiles.hpp @@ -36,7 +36,8 @@ void to_json(json& j, const ReportChargingProfilesRequest& k); void from_json(const json& j, ReportChargingProfilesRequest& k); /// \brief Writes the string representation of the given ReportChargingProfilesRequest \p k to the given output stream -/// \p os \returns an output stream with the ReportChargingProfilesRequest written to +/// \p os +/// \returns an output stream with the ReportChargingProfilesRequest written to std::ostream& operator<<(std::ostream& os, const ReportChargingProfilesRequest& k); /// \brief Contains a OCPP ReportChargingProfilesResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const ReportChargingProfilesResponse& k); void from_json(const json& j, ReportChargingProfilesResponse& k); /// \brief Writes the string representation of the given ReportChargingProfilesResponse \p k to the given output stream -/// \p os \returns an output stream with the ReportChargingProfilesResponse written to +/// \p os +/// \returns an output stream with the ReportChargingProfilesResponse written to std::ostream& operator<<(std::ostream& os, const ReportChargingProfilesResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/RequestStartTransaction.hpp b/include/ocpp/v2/messages/RequestStartTransaction.hpp index c94fbc60a..92a84acd0 100644 --- a/include/ocpp/v2/messages/RequestStartTransaction.hpp +++ b/include/ocpp/v2/messages/RequestStartTransaction.hpp @@ -36,7 +36,8 @@ void to_json(json& j, const RequestStartTransactionRequest& k); void from_json(const json& j, RequestStartTransactionRequest& k); /// \brief Writes the string representation of the given RequestStartTransactionRequest \p k to the given output stream -/// \p os \returns an output stream with the RequestStartTransactionRequest written to +/// \p os +/// \returns an output stream with the RequestStartTransactionRequest written to std::ostream& operator<<(std::ostream& os, const RequestStartTransactionRequest& k); /// \brief Contains a OCPP StartTransactionResponse message @@ -58,7 +59,8 @@ void to_json(json& j, const RequestStartTransactionResponse& k); void from_json(const json& j, RequestStartTransactionResponse& k); /// \brief Writes the string representation of the given RequestStartTransactionResponse \p k to the given output stream -/// \p os \returns an output stream with the RequestStartTransactionResponse written to +/// \p os +/// \returns an output stream with the RequestStartTransactionResponse written to std::ostream& operator<<(std::ostream& os, const RequestStartTransactionResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/RequestStopTransaction.hpp b/include/ocpp/v2/messages/RequestStopTransaction.hpp index 565f21acb..b22c4c10f 100644 --- a/include/ocpp/v2/messages/RequestStopTransaction.hpp +++ b/include/ocpp/v2/messages/RequestStopTransaction.hpp @@ -32,7 +32,8 @@ void to_json(json& j, const RequestStopTransactionRequest& k); void from_json(const json& j, RequestStopTransactionRequest& k); /// \brief Writes the string representation of the given RequestStopTransactionRequest \p k to the given output stream -/// \p os \returns an output stream with the RequestStopTransactionRequest written to +/// \p os +/// \returns an output stream with the RequestStopTransactionRequest written to std::ostream& operator<<(std::ostream& os, const RequestStopTransactionRequest& k); /// \brief Contains a OCPP StopTransactionResponse message @@ -53,7 +54,8 @@ void to_json(json& j, const RequestStopTransactionResponse& k); void from_json(const json& j, RequestStopTransactionResponse& k); /// \brief Writes the string representation of the given RequestStopTransactionResponse \p k to the given output stream -/// \p os \returns an output stream with the RequestStopTransactionResponse written to +/// \p os +/// \returns an output stream with the RequestStopTransactionResponse written to std::ostream& operator<<(std::ostream& os, const RequestStopTransactionResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/ReservationStatusUpdate.hpp b/include/ocpp/v2/messages/ReservationStatusUpdate.hpp index ddb188a31..8c9888246 100644 --- a/include/ocpp/v2/messages/ReservationStatusUpdate.hpp +++ b/include/ocpp/v2/messages/ReservationStatusUpdate.hpp @@ -33,7 +33,8 @@ void to_json(json& j, const ReservationStatusUpdateRequest& k); void from_json(const json& j, ReservationStatusUpdateRequest& k); /// \brief Writes the string representation of the given ReservationStatusUpdateRequest \p k to the given output stream -/// \p os \returns an output stream with the ReservationStatusUpdateRequest written to +/// \p os +/// \returns an output stream with the ReservationStatusUpdateRequest written to std::ostream& operator<<(std::ostream& os, const ReservationStatusUpdateRequest& k); /// \brief Contains a OCPP ReservationStatusUpdateResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const ReservationStatusUpdateResponse& k); void from_json(const json& j, ReservationStatusUpdateResponse& k); /// \brief Writes the string representation of the given ReservationStatusUpdateResponse \p k to the given output stream -/// \p os \returns an output stream with the ReservationStatusUpdateResponse written to +/// \p os +/// \returns an output stream with the ReservationStatusUpdateResponse written to std::ostream& operator<<(std::ostream& os, const ReservationStatusUpdateResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/SecurityEventNotification.hpp b/include/ocpp/v2/messages/SecurityEventNotification.hpp index f422e35b7..d740e4060 100644 --- a/include/ocpp/v2/messages/SecurityEventNotification.hpp +++ b/include/ocpp/v2/messages/SecurityEventNotification.hpp @@ -33,7 +33,8 @@ void to_json(json& j, const SecurityEventNotificationRequest& k); void from_json(const json& j, SecurityEventNotificationRequest& k); /// \brief Writes the string representation of the given SecurityEventNotificationRequest \p k to the given output -/// stream \p os \returns an output stream with the SecurityEventNotificationRequest written to +/// stream \p os +/// \returns an output stream with the SecurityEventNotificationRequest written to std::ostream& operator<<(std::ostream& os, const SecurityEventNotificationRequest& k); /// \brief Contains a OCPP SecurityEventNotificationResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const SecurityEventNotificationResponse& k); void from_json(const json& j, SecurityEventNotificationResponse& k); /// \brief Writes the string representation of the given SecurityEventNotificationResponse \p k to the given output -/// stream \p os \returns an output stream with the SecurityEventNotificationResponse written to +/// stream \p os +/// \returns an output stream with the SecurityEventNotificationResponse written to std::ostream& operator<<(std::ostream& os, const SecurityEventNotificationResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/SetChargingProfile.hpp b/include/ocpp/v2/messages/SetChargingProfile.hpp index 3ccc31a06..9f752d9bf 100644 --- a/include/ocpp/v2/messages/SetChargingProfile.hpp +++ b/include/ocpp/v2/messages/SetChargingProfile.hpp @@ -54,7 +54,8 @@ void to_json(json& j, const SetChargingProfileResponse& k); void from_json(const json& j, SetChargingProfileResponse& k); /// \brief Writes the string representation of the given SetChargingProfileResponse \p k to the given output stream \p -/// os \returns an output stream with the SetChargingProfileResponse written to +/// os +/// \returns an output stream with the SetChargingProfileResponse written to std::ostream& operator<<(std::ostream& os, const SetChargingProfileResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/SetMonitoringLevel.hpp b/include/ocpp/v2/messages/SetMonitoringLevel.hpp index bc068451f..21d1daa1b 100644 --- a/include/ocpp/v2/messages/SetMonitoringLevel.hpp +++ b/include/ocpp/v2/messages/SetMonitoringLevel.hpp @@ -53,7 +53,8 @@ void to_json(json& j, const SetMonitoringLevelResponse& k); void from_json(const json& j, SetMonitoringLevelResponse& k); /// \brief Writes the string representation of the given SetMonitoringLevelResponse \p k to the given output stream \p -/// os \returns an output stream with the SetMonitoringLevelResponse written to +/// os +/// \returns an output stream with the SetMonitoringLevelResponse written to std::ostream& operator<<(std::ostream& os, const SetMonitoringLevelResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/SetVariableMonitoring.hpp b/include/ocpp/v2/messages/SetVariableMonitoring.hpp index 43a9783f5..08125db7c 100644 --- a/include/ocpp/v2/messages/SetVariableMonitoring.hpp +++ b/include/ocpp/v2/messages/SetVariableMonitoring.hpp @@ -32,7 +32,8 @@ void to_json(json& j, const SetVariableMonitoringRequest& k); void from_json(const json& j, SetVariableMonitoringRequest& k); /// \brief Writes the string representation of the given SetVariableMonitoringRequest \p k to the given output stream \p -/// os \returns an output stream with the SetVariableMonitoringRequest written to +/// os +/// \returns an output stream with the SetVariableMonitoringRequest written to std::ostream& operator<<(std::ostream& os, const SetVariableMonitoringRequest& k); /// \brief Contains a OCPP SetVariableMonitoringResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const SetVariableMonitoringResponse& k); void from_json(const json& j, SetVariableMonitoringResponse& k); /// \brief Writes the string representation of the given SetVariableMonitoringResponse \p k to the given output stream -/// \p os \returns an output stream with the SetVariableMonitoringResponse written to +/// \p os +/// \returns an output stream with the SetVariableMonitoringResponse written to std::ostream& operator<<(std::ostream& os, const SetVariableMonitoringResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/messages/StatusNotification.hpp b/include/ocpp/v2/messages/StatusNotification.hpp index d4d031b69..557d53abb 100644 --- a/include/ocpp/v2/messages/StatusNotification.hpp +++ b/include/ocpp/v2/messages/StatusNotification.hpp @@ -54,7 +54,8 @@ void to_json(json& j, const StatusNotificationResponse& k); void from_json(const json& j, StatusNotificationResponse& k); /// \brief Writes the string representation of the given StatusNotificationResponse \p k to the given output stream \p -/// os \returns an output stream with the StatusNotificationResponse written to +/// os +/// \returns an output stream with the StatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const StatusNotificationResponse& k); } // namespace v2 diff --git a/include/ocpp/v2/monitoring_updater.hpp b/include/ocpp/v2/monitoring_updater.hpp index 5dc9ef426..364682878 100644 --- a/include/ocpp/v2/monitoring_updater.hpp +++ b/include/ocpp/v2/monitoring_updater.hpp @@ -17,7 +17,7 @@ namespace ocpp::v2 { class DeviceModel; -enum UpdateMonitorMetaType { +enum class UpdateMonitorMetaType { TRIGGER, PERIODIC }; @@ -82,8 +82,8 @@ struct UpdaterMonitorMeta { throw std::runtime_error("Clear state should never be used on a non-trigger meta!"); } - if (meta_trigger.is_cleared != is_cleared) { - meta_trigger.is_cleared = is_cleared; + if (meta_trigger.is_cleared != static_cast(is_cleared)) { + meta_trigger.is_cleared = static_cast(is_cleared); // On a state change reset the CSMS sent status and // event generation status @@ -93,8 +93,8 @@ struct UpdaterMonitorMeta { } }; -typedef std::function&)> notify_events; -typedef std::function is_offline; +using notify_events = std::function&)>; +using is_offline = std::function; class MonitoringUpdater { @@ -109,7 +109,6 @@ class MonitoringUpdater { MonitoringUpdater(DeviceModel& device_model, notify_events notify_csms_events, is_offline is_chargepoint_offline); ~MonitoringUpdater(); -public: /// \brief Starts monitoring the variables, kicking the timer void start_monitoring(); /// \brief Stops monitoring the variables, canceling the timer @@ -132,7 +131,7 @@ class MonitoringUpdater { void on_variable_changed(const std::unordered_map& monitors, const Component& component, const Variable& variable, const VariableCharacteristics& characteristics, const VariableAttribute& attribute, - const std::string& value_old, const std::string& value_current); + const std::string& value_previous, const std::string& value_current); /// \brief Callback that is registered to the 'device_model' that determines if any of /// the already existing monitors were updated. It is required for some spec requirements @@ -159,11 +158,6 @@ class MonitoringUpdater { /// of the offline state void process_monitor_meta_internal(UpdaterMonitorMeta& updater_meta_data); - /// \brief Function that determines based on the current meta internal - /// state if it is proper to remove from the internal list the provided - /// monitor meta data. That implies various checks for various states - bool should_remove_monitor_meta_internal(const UpdaterMonitorMeta& updater_meta_data); - /// \brief Query the database (from in-memory data for fast retrieval) /// and updates our internal monitors with the new database data void update_periodic_monitors_internal(); @@ -173,7 +167,6 @@ class MonitoringUpdater { bool is_monitoring_enabled(); -private: DeviceModel& device_model; Everest::SteadyTimer monitors_timer; diff --git a/include/ocpp/v2/ocpp_enums.hpp b/include/ocpp/v2/ocpp_enums.hpp index 7764fd797..7122241e4 100644 --- a/include/ocpp/v2/ocpp_enums.hpp +++ b/include/ocpp/v2/ocpp_enums.hpp @@ -28,7 +28,8 @@ GenericStatusEnum string_to_generic_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given GenericStatusEnum \p generic_status_enum to the given output -/// stream \p os \returns an output stream with the GenericStatusEnum written to +/// stream \p os +/// \returns an output stream with the GenericStatusEnum written to std::ostream& operator<<(std::ostream& os, const GenericStatusEnum& generic_status_enum); // from: AuthorizeRequest @@ -49,7 +50,8 @@ HashAlgorithmEnum string_to_hash_algorithm_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given HashAlgorithmEnum \p hash_algorithm_enum to the given output -/// stream \p os \returns an output stream with the HashAlgorithmEnum written to +/// stream \p os +/// \returns an output stream with the HashAlgorithmEnum written to std::ostream& operator<<(std::ostream& os, const HashAlgorithmEnum& hash_algorithm_enum); // from: AuthorizeResponse @@ -77,7 +79,8 @@ AuthorizationStatusEnum string_to_authorization_status_enum(const std::string& s } // namespace conversions /// \brief Writes the string representation of the given AuthorizationStatusEnum \p authorization_status_enum to the -/// given output stream \p os \returns an output stream with the AuthorizationStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the AuthorizationStatusEnum written to std::ostream& operator<<(std::ostream& os, const AuthorizationStatusEnum& authorization_status_enum); // from: AuthorizeResponse @@ -100,7 +103,8 @@ MessageFormatEnum string_to_message_format_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MessageFormatEnum \p message_format_enum to the given output -/// stream \p os \returns an output stream with the MessageFormatEnum written to +/// stream \p os +/// \returns an output stream with the MessageFormatEnum written to std::ostream& operator<<(std::ostream& os, const MessageFormatEnum& message_format_enum); // from: AuthorizeResponse @@ -125,8 +129,8 @@ AuthorizeCertificateStatusEnum string_to_authorize_certificate_status_enum(const } // namespace conversions /// \brief Writes the string representation of the given AuthorizeCertificateStatusEnum \p -/// authorize_certificate_status_enum to the given output stream \p os \returns an output stream with the -/// AuthorizeCertificateStatusEnum written to +/// authorize_certificate_status_enum to the given output stream \p os +/// \returns an output stream with the AuthorizeCertificateStatusEnum written to std::ostream& operator<<(std::ostream& os, const AuthorizeCertificateStatusEnum& authorize_certificate_status_enum); // from: AuthorizeResponse @@ -155,7 +159,8 @@ EnergyTransferModeEnum string_to_energy_transfer_mode_enum(const std::string& s) } // namespace conversions /// \brief Writes the string representation of the given EnergyTransferModeEnum \p energy_transfer_mode_enum to the -/// given output stream \p os \returns an output stream with the EnergyTransferModeEnum written to +/// given output stream \p os +/// \returns an output stream with the EnergyTransferModeEnum written to std::ostream& operator<<(std::ostream& os, const EnergyTransferModeEnum& energy_transfer_mode_enum); // from: AuthorizeResponse @@ -180,7 +185,8 @@ DayOfWeekEnum string_to_day_of_week_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given DayOfWeekEnum \p day_of_week_enum to the given output stream \p -/// os \returns an output stream with the DayOfWeekEnum written to +/// os +/// \returns an output stream with the DayOfWeekEnum written to std::ostream& operator<<(std::ostream& os, const DayOfWeekEnum& day_of_week_enum); // from: AuthorizeResponse @@ -221,7 +227,8 @@ BatterySwapEventEnum string_to_battery_swap_event_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given BatterySwapEventEnum \p battery_swap_event_enum to the given -/// output stream \p os \returns an output stream with the BatterySwapEventEnum written to +/// output stream \p os +/// \returns an output stream with the BatterySwapEventEnum written to std::ostream& operator<<(std::ostream& os, const BatterySwapEventEnum& battery_swap_event_enum); // from: BootNotificationRequest @@ -248,7 +255,8 @@ BootReasonEnum string_to_boot_reason_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given BootReasonEnum \p boot_reason_enum to the given output stream -/// \p os \returns an output stream with the BootReasonEnum written to +/// \p os +/// \returns an output stream with the BootReasonEnum written to std::ostream& operator<<(std::ostream& os, const BootReasonEnum& boot_reason_enum); // from: BootNotificationResponse @@ -269,7 +277,8 @@ RegistrationStatusEnum string_to_registration_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given RegistrationStatusEnum \p registration_status_enum to the given -/// output stream \p os \returns an output stream with the RegistrationStatusEnum written to +/// output stream \p os +/// \returns an output stream with the RegistrationStatusEnum written to std::ostream& operator<<(std::ostream& os, const RegistrationStatusEnum& registration_status_enum); // from: CancelReservationResponse @@ -289,7 +298,8 @@ CancelReservationStatusEnum string_to_cancel_reservation_status_enum(const std:: } // namespace conversions /// \brief Writes the string representation of the given CancelReservationStatusEnum \p cancel_reservation_status_enum -/// to the given output stream \p os \returns an output stream with the CancelReservationStatusEnum written to +/// to the given output stream \p os +/// \returns an output stream with the CancelReservationStatusEnum written to std::ostream& operator<<(std::ostream& os, const CancelReservationStatusEnum& cancel_reservation_status_enum); // from: CertificateSignedRequest @@ -310,7 +320,8 @@ CertificateSigningUseEnum string_to_certificate_signing_use_enum(const std::stri } // namespace conversions /// \brief Writes the string representation of the given CertificateSigningUseEnum \p certificate_signing_use_enum to -/// the given output stream \p os \returns an output stream with the CertificateSigningUseEnum written to +/// the given output stream \p os +/// \returns an output stream with the CertificateSigningUseEnum written to std::ostream& operator<<(std::ostream& os, const CertificateSigningUseEnum& certificate_signing_use_enum); // from: CertificateSignedResponse @@ -330,7 +341,8 @@ CertificateSignedStatusEnum string_to_certificate_signed_status_enum(const std:: } // namespace conversions /// \brief Writes the string representation of the given CertificateSignedStatusEnum \p certificate_signed_status_enum -/// to the given output stream \p os \returns an output stream with the CertificateSignedStatusEnum written to +/// to the given output stream \p os +/// \returns an output stream with the CertificateSignedStatusEnum written to std::ostream& operator<<(std::ostream& os, const CertificateSignedStatusEnum& certificate_signed_status_enum); // from: ChangeAvailabilityRequest @@ -350,7 +362,8 @@ OperationalStatusEnum string_to_operational_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given OperationalStatusEnum \p operational_status_enum to the given -/// output stream \p os \returns an output stream with the OperationalStatusEnum written to +/// output stream \p os +/// \returns an output stream with the OperationalStatusEnum written to std::ostream& operator<<(std::ostream& os, const OperationalStatusEnum& operational_status_enum); // from: ChangeAvailabilityResponse @@ -371,7 +384,8 @@ ChangeAvailabilityStatusEnum string_to_change_availability_status_enum(const std } // namespace conversions /// \brief Writes the string representation of the given ChangeAvailabilityStatusEnum \p change_availability_status_enum -/// to the given output stream \p os \returns an output stream with the ChangeAvailabilityStatusEnum written to +/// to the given output stream \p os +/// \returns an output stream with the ChangeAvailabilityStatusEnum written to std::ostream& operator<<(std::ostream& os, const ChangeAvailabilityStatusEnum& change_availability_status_enum); // from: ChangeTransactionTariffResponse @@ -395,7 +409,8 @@ TariffChangeStatusEnum string_to_tariff_change_status_enum(const std::string& s) } // namespace conversions /// \brief Writes the string representation of the given TariffChangeStatusEnum \p tariff_change_status_enum to the -/// given output stream \p os \returns an output stream with the TariffChangeStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the TariffChangeStatusEnum written to std::ostream& operator<<(std::ostream& os, const TariffChangeStatusEnum& tariff_change_status_enum); // from: ClearCacheResponse @@ -415,7 +430,8 @@ ClearCacheStatusEnum string_to_clear_cache_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ClearCacheStatusEnum \p clear_cache_status_enum to the given -/// output stream \p os \returns an output stream with the ClearCacheStatusEnum written to +/// output stream \p os +/// \returns an output stream with the ClearCacheStatusEnum written to std::ostream& operator<<(std::ostream& os, const ClearCacheStatusEnum& clear_cache_status_enum); // from: ClearChargingProfileRequest @@ -439,7 +455,8 @@ ChargingProfilePurposeEnum string_to_charging_profile_purpose_enum(const std::st } // namespace conversions /// \brief Writes the string representation of the given ChargingProfilePurposeEnum \p charging_profile_purpose_enum to -/// the given output stream \p os \returns an output stream with the ChargingProfilePurposeEnum written to +/// the given output stream \p os +/// \returns an output stream with the ChargingProfilePurposeEnum written to std::ostream& operator<<(std::ostream& os, const ChargingProfilePurposeEnum& charging_profile_purpose_enum); // from: ClearChargingProfileResponse @@ -459,8 +476,8 @@ ClearChargingProfileStatusEnum string_to_clear_charging_profile_status_enum(cons } // namespace conversions /// \brief Writes the string representation of the given ClearChargingProfileStatusEnum \p -/// clear_charging_profile_status_enum to the given output stream \p os \returns an output stream with the -/// ClearChargingProfileStatusEnum written to +/// clear_charging_profile_status_enum to the given output stream \p os +/// \returns an output stream with the ClearChargingProfileStatusEnum written to std::ostream& operator<<(std::ostream& os, const ClearChargingProfileStatusEnum& clear_charging_profile_status_enum); // from: ClearDERControlRequest @@ -500,7 +517,8 @@ DERControlEnum string_to_dercontrol_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given DERControlEnum \p dercontrol_enum to the given output stream \p -/// os \returns an output stream with the DERControlEnum written to +/// os +/// \returns an output stream with the DERControlEnum written to std::ostream& operator<<(std::ostream& os, const DERControlEnum& dercontrol_enum); // from: ClearDERControlResponse @@ -522,7 +540,8 @@ DERControlStatusEnum string_to_dercontrol_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given DERControlStatusEnum \p dercontrol_status_enum to the given -/// output stream \p os \returns an output stream with the DERControlStatusEnum written to +/// output stream \p os +/// \returns an output stream with the DERControlStatusEnum written to std::ostream& operator<<(std::ostream& os, const DERControlStatusEnum& dercontrol_status_enum); // from: ClearDisplayMessageResponse @@ -543,7 +562,8 @@ ClearMessageStatusEnum string_to_clear_message_status_enum(const std::string& s) } // namespace conversions /// \brief Writes the string representation of the given ClearMessageStatusEnum \p clear_message_status_enum to the -/// given output stream \p os \returns an output stream with the ClearMessageStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the ClearMessageStatusEnum written to std::ostream& operator<<(std::ostream& os, const ClearMessageStatusEnum& clear_message_status_enum); // from: ClearTariffsResponse @@ -564,7 +584,8 @@ TariffClearStatusEnum string_to_tariff_clear_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given TariffClearStatusEnum \p tariff_clear_status_enum to the given -/// output stream \p os \returns an output stream with the TariffClearStatusEnum written to +/// output stream \p os +/// \returns an output stream with the TariffClearStatusEnum written to std::ostream& operator<<(std::ostream& os, const TariffClearStatusEnum& tariff_clear_status_enum); // from: ClearVariableMonitoringResponse @@ -585,7 +606,8 @@ ClearMonitoringStatusEnum string_to_clear_monitoring_status_enum(const std::stri } // namespace conversions /// \brief Writes the string representation of the given ClearMonitoringStatusEnum \p clear_monitoring_status_enum to -/// the given output stream \p os \returns an output stream with the ClearMonitoringStatusEnum written to +/// the given output stream \p os +/// \returns an output stream with the ClearMonitoringStatusEnum written to std::ostream& operator<<(std::ostream& os, const ClearMonitoringStatusEnum& clear_monitoring_status_enum); // from: CustomerInformationResponse @@ -606,8 +628,8 @@ CustomerInformationStatusEnum string_to_customer_information_status_enum(const s } // namespace conversions /// \brief Writes the string representation of the given CustomerInformationStatusEnum \p -/// customer_information_status_enum to the given output stream \p os \returns an output stream with the -/// CustomerInformationStatusEnum written to +/// customer_information_status_enum to the given output stream \p os +/// \returns an output stream with the CustomerInformationStatusEnum written to std::ostream& operator<<(std::ostream& os, const CustomerInformationStatusEnum& customer_information_status_enum); // from: DataTransferResponse @@ -629,7 +651,8 @@ DataTransferStatusEnum string_to_data_transfer_status_enum(const std::string& s) } // namespace conversions /// \brief Writes the string representation of the given DataTransferStatusEnum \p data_transfer_status_enum to the -/// given output stream \p os \returns an output stream with the DataTransferStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the DataTransferStatusEnum written to std::ostream& operator<<(std::ostream& os, const DataTransferStatusEnum& data_transfer_status_enum); // from: DeleteCertificateResponse @@ -650,7 +673,8 @@ DeleteCertificateStatusEnum string_to_delete_certificate_status_enum(const std:: } // namespace conversions /// \brief Writes the string representation of the given DeleteCertificateStatusEnum \p delete_certificate_status_enum -/// to the given output stream \p os \returns an output stream with the DeleteCertificateStatusEnum written to +/// to the given output stream \p os +/// \returns an output stream with the DeleteCertificateStatusEnum written to std::ostream& operator<<(std::ostream& os, const DeleteCertificateStatusEnum& delete_certificate_status_enum); // from: FirmwareStatusNotificationRequest @@ -682,7 +706,8 @@ FirmwareStatusEnum string_to_firmware_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given FirmwareStatusEnum \p firmware_status_enum to the given output -/// stream \p os \returns an output stream with the FirmwareStatusEnum written to +/// stream \p os +/// \returns an output stream with the FirmwareStatusEnum written to std::ostream& operator<<(std::ostream& os, const FirmwareStatusEnum& firmware_status_enum); // from: Get15118EVCertificateRequest @@ -702,7 +727,8 @@ CertificateActionEnum string_to_certificate_action_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given CertificateActionEnum \p certificate_action_enum to the given -/// output stream \p os \returns an output stream with the CertificateActionEnum written to +/// output stream \p os +/// \returns an output stream with the CertificateActionEnum written to std::ostream& operator<<(std::ostream& os, const CertificateActionEnum& certificate_action_enum); // from: Get15118EVCertificateResponse @@ -722,8 +748,8 @@ Iso15118EVCertificateStatusEnum string_to_iso15118evcertificate_status_enum(cons } // namespace conversions /// \brief Writes the string representation of the given Iso15118EVCertificateStatusEnum \p -/// iso15118evcertificate_status_enum to the given output stream \p os \returns an output stream with the -/// Iso15118EVCertificateStatusEnum written to +/// iso15118evcertificate_status_enum to the given output stream \p os +/// \returns an output stream with the Iso15118EVCertificateStatusEnum written to std::ostream& operator<<(std::ostream& os, const Iso15118EVCertificateStatusEnum& iso15118evcertificate_status_enum); // from: GetBaseReportRequest @@ -744,7 +770,8 @@ ReportBaseEnum string_to_report_base_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ReportBaseEnum \p report_base_enum to the given output stream -/// \p os \returns an output stream with the ReportBaseEnum written to +/// \p os +/// \returns an output stream with the ReportBaseEnum written to std::ostream& operator<<(std::ostream& os, const ReportBaseEnum& report_base_enum); // from: GetBaseReportResponse @@ -766,8 +793,8 @@ GenericDeviceModelStatusEnum string_to_generic_device_model_status_enum(const st } // namespace conversions /// \brief Writes the string representation of the given GenericDeviceModelStatusEnum \p -/// generic_device_model_status_enum to the given output stream \p os \returns an output stream with the -/// GenericDeviceModelStatusEnum written to +/// generic_device_model_status_enum to the given output stream \p os +/// \returns an output stream with the GenericDeviceModelStatusEnum written to std::ostream& operator<<(std::ostream& os, const GenericDeviceModelStatusEnum& generic_device_model_status_enum); // from: GetCertificateChainStatusRequest @@ -787,7 +814,8 @@ CertificateStatusSourceEnum string_to_certificate_status_source_enum(const std:: } // namespace conversions /// \brief Writes the string representation of the given CertificateStatusSourceEnum \p certificate_status_source_enum -/// to the given output stream \p os \returns an output stream with the CertificateStatusSourceEnum written to +/// to the given output stream \p os +/// \returns an output stream with the CertificateStatusSourceEnum written to std::ostream& operator<<(std::ostream& os, const CertificateStatusSourceEnum& certificate_status_source_enum); // from: GetCertificateChainStatusResponse @@ -809,7 +837,8 @@ CertificateStatusEnum string_to_certificate_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given CertificateStatusEnum \p certificate_status_enum to the given -/// output stream \p os \returns an output stream with the CertificateStatusEnum written to +/// output stream \p os +/// \returns an output stream with the CertificateStatusEnum written to std::ostream& operator<<(std::ostream& os, const CertificateStatusEnum& certificate_status_enum); // from: GetCertificateStatusResponse @@ -829,7 +858,8 @@ GetCertificateStatusEnum string_to_get_certificate_status_enum(const std::string } // namespace conversions /// \brief Writes the string representation of the given GetCertificateStatusEnum \p get_certificate_status_enum to the -/// given output stream \p os \returns an output stream with the GetCertificateStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the GetCertificateStatusEnum written to std::ostream& operator<<(std::ostream& os, const GetCertificateStatusEnum& get_certificate_status_enum); // from: GetChargingProfilesResponse @@ -849,8 +879,8 @@ GetChargingProfileStatusEnum string_to_get_charging_profile_status_enum(const st } // namespace conversions /// \brief Writes the string representation of the given GetChargingProfileStatusEnum \p -/// get_charging_profile_status_enum to the given output stream \p os \returns an output stream with the -/// GetChargingProfileStatusEnum written to +/// get_charging_profile_status_enum to the given output stream \p os +/// \returns an output stream with the GetChargingProfileStatusEnum written to std::ostream& operator<<(std::ostream& os, const GetChargingProfileStatusEnum& get_charging_profile_status_enum); // from: GetCompositeScheduleRequest @@ -870,7 +900,8 @@ ChargingRateUnitEnum string_to_charging_rate_unit_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ChargingRateUnitEnum \p charging_rate_unit_enum to the given -/// output stream \p os \returns an output stream with the ChargingRateUnitEnum written to +/// output stream \p os +/// \returns an output stream with the ChargingRateUnitEnum written to std::ostream& operator<<(std::ostream& os, const ChargingRateUnitEnum& charging_rate_unit_enum); // from: GetCompositeScheduleResponse @@ -896,7 +927,8 @@ OperationModeEnum string_to_operation_mode_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given OperationModeEnum \p operation_mode_enum to the given output -/// stream \p os \returns an output stream with the OperationModeEnum written to +/// stream \p os +/// \returns an output stream with the OperationModeEnum written to std::ostream& operator<<(std::ostream& os, const OperationModeEnum& operation_mode_enum); // from: GetDisplayMessagesRequest @@ -917,7 +949,8 @@ MessagePriorityEnum string_to_message_priority_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MessagePriorityEnum \p message_priority_enum to the given -/// output stream \p os \returns an output stream with the MessagePriorityEnum written to +/// output stream \p os +/// \returns an output stream with the MessagePriorityEnum written to std::ostream& operator<<(std::ostream& os, const MessagePriorityEnum& message_priority_enum); // from: GetDisplayMessagesRequest @@ -941,7 +974,8 @@ MessageStateEnum string_to_message_state_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MessageStateEnum \p message_state_enum to the given output -/// stream \p os \returns an output stream with the MessageStateEnum written to +/// stream \p os +/// \returns an output stream with the MessageStateEnum written to std::ostream& operator<<(std::ostream& os, const MessageStateEnum& message_state_enum); // from: GetDisplayMessagesResponse @@ -961,8 +995,8 @@ GetDisplayMessagesStatusEnum string_to_get_display_messages_status_enum(const st } // namespace conversions /// \brief Writes the string representation of the given GetDisplayMessagesStatusEnum \p -/// get_display_messages_status_enum to the given output stream \p os \returns an output stream with the -/// GetDisplayMessagesStatusEnum written to +/// get_display_messages_status_enum to the given output stream \p os +/// \returns an output stream with the GetDisplayMessagesStatusEnum written to std::ostream& operator<<(std::ostream& os, const GetDisplayMessagesStatusEnum& get_display_messages_status_enum); // from: GetInstalledCertificateIdsRequest @@ -986,7 +1020,8 @@ GetCertificateIdUseEnum string_to_get_certificate_id_use_enum(const std::string& } // namespace conversions /// \brief Writes the string representation of the given GetCertificateIdUseEnum \p get_certificate_id_use_enum to the -/// given output stream \p os \returns an output stream with the GetCertificateIdUseEnum written to +/// given output stream \p os +/// \returns an output stream with the GetCertificateIdUseEnum written to std::ostream& operator<<(std::ostream& os, const GetCertificateIdUseEnum& get_certificate_id_use_enum); // from: GetInstalledCertificateIdsResponse @@ -1006,8 +1041,8 @@ GetInstalledCertificateStatusEnum string_to_get_installed_certificate_status_enu } // namespace conversions /// \brief Writes the string representation of the given GetInstalledCertificateStatusEnum \p -/// get_installed_certificate_status_enum to the given output stream \p os \returns an output stream with the -/// GetInstalledCertificateStatusEnum written to +/// get_installed_certificate_status_enum to the given output stream \p os +/// \returns an output stream with the GetInstalledCertificateStatusEnum written to std::ostream& operator<<(std::ostream& os, const GetInstalledCertificateStatusEnum& get_installed_certificate_status_enum); @@ -1050,7 +1085,8 @@ LogStatusEnum string_to_log_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given LogStatusEnum \p log_status_enum to the given output stream \p -/// os \returns an output stream with the LogStatusEnum written to +/// os +/// \returns an output stream with the LogStatusEnum written to std::ostream& operator<<(std::ostream& os, const LogStatusEnum& log_status_enum); // from: GetMonitoringReportRequest @@ -1071,7 +1107,8 @@ MonitoringCriterionEnum string_to_monitoring_criterion_enum(const std::string& s } // namespace conversions /// \brief Writes the string representation of the given MonitoringCriterionEnum \p monitoring_criterion_enum to the -/// given output stream \p os \returns an output stream with the MonitoringCriterionEnum written to +/// given output stream \p os +/// \returns an output stream with the MonitoringCriterionEnum written to std::ostream& operator<<(std::ostream& os, const MonitoringCriterionEnum& monitoring_criterion_enum); // from: GetReportRequest @@ -1093,7 +1130,8 @@ ComponentCriterionEnum string_to_component_criterion_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ComponentCriterionEnum \p component_criterion_enum to the given -/// output stream \p os \returns an output stream with the ComponentCriterionEnum written to +/// output stream \p os +/// \returns an output stream with the ComponentCriterionEnum written to std::ostream& operator<<(std::ostream& os, const ComponentCriterionEnum& component_criterion_enum); // from: GetTariffsResponse @@ -1114,7 +1152,8 @@ TariffGetStatusEnum string_to_tariff_get_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given TariffGetStatusEnum \p tariff_get_status_enum to the given -/// output stream \p os \returns an output stream with the TariffGetStatusEnum written to +/// output stream \p os +/// \returns an output stream with the TariffGetStatusEnum written to std::ostream& operator<<(std::ostream& os, const TariffGetStatusEnum& tariff_get_status_enum); // from: GetTariffsResponse @@ -1134,7 +1173,8 @@ TariffKindEnum string_to_tariff_kind_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given TariffKindEnum \p tariff_kind_enum to the given output stream -/// \p os \returns an output stream with the TariffKindEnum written to +/// \p os +/// \returns an output stream with the TariffKindEnum written to std::ostream& operator<<(std::ostream& os, const TariffKindEnum& tariff_kind_enum); // from: GetVariablesRequest @@ -1156,7 +1196,8 @@ AttributeEnum string_to_attribute_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given AttributeEnum \p attribute_enum to the given output stream \p -/// os \returns an output stream with the AttributeEnum written to +/// os +/// \returns an output stream with the AttributeEnum written to std::ostream& operator<<(std::ostream& os, const AttributeEnum& attribute_enum); // from: GetVariablesResponse @@ -1179,7 +1220,8 @@ GetVariableStatusEnum string_to_get_variable_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given GetVariableStatusEnum \p get_variable_status_enum to the given -/// output stream \p os \returns an output stream with the GetVariableStatusEnum written to +/// output stream \p os +/// \returns an output stream with the GetVariableStatusEnum written to std::ostream& operator<<(std::ostream& os, const GetVariableStatusEnum& get_variable_status_enum); // from: InstallCertificateRequest @@ -1202,7 +1244,8 @@ InstallCertificateUseEnum string_to_install_certificate_use_enum(const std::stri } // namespace conversions /// \brief Writes the string representation of the given InstallCertificateUseEnum \p install_certificate_use_enum to -/// the given output stream \p os \returns an output stream with the InstallCertificateUseEnum written to +/// the given output stream \p os +/// \returns an output stream with the InstallCertificateUseEnum written to std::ostream& operator<<(std::ostream& os, const InstallCertificateUseEnum& install_certificate_use_enum); // from: InstallCertificateResponse @@ -1223,7 +1266,8 @@ InstallCertificateStatusEnum string_to_install_certificate_status_enum(const std } // namespace conversions /// \brief Writes the string representation of the given InstallCertificateStatusEnum \p install_certificate_status_enum -/// to the given output stream \p os \returns an output stream with the InstallCertificateStatusEnum written to +/// to the given output stream \p os +/// \returns an output stream with the InstallCertificateStatusEnum written to std::ostream& operator<<(std::ostream& os, const InstallCertificateStatusEnum& install_certificate_status_enum); // from: LogStatusNotificationRequest @@ -1249,7 +1293,8 @@ UploadLogStatusEnum string_to_upload_log_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given UploadLogStatusEnum \p upload_log_status_enum to the given -/// output stream \p os \returns an output stream with the UploadLogStatusEnum written to +/// output stream \p os +/// \returns an output stream with the UploadLogStatusEnum written to std::ostream& operator<<(std::ostream& os, const UploadLogStatusEnum& upload_log_status_enum); // from: MeterValuesRequest @@ -1323,7 +1368,8 @@ MeasurandEnum string_to_measurand_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MeasurandEnum \p measurand_enum to the given output stream \p -/// os \returns an output stream with the MeasurandEnum written to +/// os +/// \returns an output stream with the MeasurandEnum written to std::ostream& operator<<(std::ostream& os, const MeasurandEnum& measurand_enum); // from: MeterValuesRequest @@ -1349,7 +1395,8 @@ ReadingContextEnum string_to_reading_context_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ReadingContextEnum \p reading_context_enum to the given output -/// stream \p os \returns an output stream with the ReadingContextEnum written to +/// stream \p os +/// \returns an output stream with the ReadingContextEnum written to std::ostream& operator<<(std::ostream& os, const ReadingContextEnum& reading_context_enum); // from: MeterValuesRequest @@ -1421,8 +1468,8 @@ NotifyAllowedEnergyTransferStatusEnum string_to_notify_allowed_energy_transfer_s } // namespace conversions /// \brief Writes the string representation of the given NotifyAllowedEnergyTransferStatusEnum \p -/// notify_allowed_energy_transfer_status_enum to the given output stream \p os \returns an output stream with the -/// NotifyAllowedEnergyTransferStatusEnum written to +/// notify_allowed_energy_transfer_status_enum to the given output stream \p os +/// \returns an output stream with the NotifyAllowedEnergyTransferStatusEnum written to std::ostream& operator<<(std::ostream& os, const NotifyAllowedEnergyTransferStatusEnum& notify_allowed_energy_transfer_status_enum); @@ -1473,7 +1520,8 @@ GridEventFaultEnum string_to_grid_event_fault_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given GridEventFaultEnum \p grid_event_fault_enum to the given output -/// stream \p os \returns an output stream with the GridEventFaultEnum written to +/// stream \p os +/// \returns an output stream with the GridEventFaultEnum written to std::ostream& operator<<(std::ostream& os, const GridEventFaultEnum& grid_event_fault_enum); // from: NotifyEVChargingNeedsRequest @@ -1506,7 +1554,8 @@ IslandingDetectionEnum string_to_islanding_detection_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given IslandingDetectionEnum \p islanding_detection_enum to the given -/// output stream \p os \returns an output stream with the IslandingDetectionEnum written to +/// output stream \p os +/// \returns an output stream with the IslandingDetectionEnum written to std::ostream& operator<<(std::ostream& os, const IslandingDetectionEnum& islanding_detection_enum); // from: NotifyEVChargingNeedsRequest @@ -1526,7 +1575,8 @@ ControlModeEnum string_to_control_mode_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ControlModeEnum \p control_mode_enum to the given output stream -/// \p os \returns an output stream with the ControlModeEnum written to +/// \p os +/// \returns an output stream with the ControlModeEnum written to std::ostream& operator<<(std::ostream& os, const ControlModeEnum& control_mode_enum); // from: NotifyEVChargingNeedsRequest @@ -1546,7 +1596,8 @@ MobilityNeedsModeEnum string_to_mobility_needs_mode_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MobilityNeedsModeEnum \p mobility_needs_mode_enum to the given -/// output stream \p os \returns an output stream with the MobilityNeedsModeEnum written to +/// output stream \p os +/// \returns an output stream with the MobilityNeedsModeEnum written to std::ostream& operator<<(std::ostream& os, const MobilityNeedsModeEnum& mobility_needs_mode_enum); // from: NotifyEVChargingNeedsResponse @@ -1568,8 +1619,8 @@ NotifyEVChargingNeedsStatusEnum string_to_notify_evcharging_needs_status_enum(co } // namespace conversions /// \brief Writes the string representation of the given NotifyEVChargingNeedsStatusEnum \p -/// notify_evcharging_needs_status_enum to the given output stream \p os \returns an output stream with the -/// NotifyEVChargingNeedsStatusEnum written to +/// notify_evcharging_needs_status_enum to the given output stream \p os +/// \returns an output stream with the NotifyEVChargingNeedsStatusEnum written to std::ostream& operator<<(std::ostream& os, const NotifyEVChargingNeedsStatusEnum& notify_evcharging_needs_status_enum); // from: NotifyEventRequest @@ -1590,7 +1641,8 @@ EventTriggerEnum string_to_event_trigger_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given EventTriggerEnum \p event_trigger_enum to the given output -/// stream \p os \returns an output stream with the EventTriggerEnum written to +/// stream \p os +/// \returns an output stream with the EventTriggerEnum written to std::ostream& operator<<(std::ostream& os, const EventTriggerEnum& event_trigger_enum); // from: NotifyEventRequest @@ -1612,7 +1664,8 @@ EventNotificationEnum string_to_event_notification_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given EventNotificationEnum \p event_notification_enum to the given -/// output stream \p os \returns an output stream with the EventNotificationEnum written to +/// output stream \p os +/// \returns an output stream with the EventNotificationEnum written to std::ostream& operator<<(std::ostream& os, const EventNotificationEnum& event_notification_enum); // from: NotifyMonitoringReportRequest @@ -1658,7 +1711,8 @@ MutabilityEnum string_to_mutability_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MutabilityEnum \p mutability_enum to the given output stream \p -/// os \returns an output stream with the MutabilityEnum written to +/// os +/// \returns an output stream with the MutabilityEnum written to std::ostream& operator<<(std::ostream& os, const MutabilityEnum& mutability_enum); // from: NotifyReportRequest @@ -1706,7 +1760,8 @@ PaymentStatusEnum string_to_payment_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given PaymentStatusEnum \p payment_status_enum to the given output -/// stream \p os \returns an output stream with the PaymentStatusEnum written to +/// stream \p os +/// \returns an output stream with the PaymentStatusEnum written to std::ostream& operator<<(std::ostream& os, const PaymentStatusEnum& payment_status_enum); // from: PublishFirmwareStatusNotificationRequest @@ -1734,7 +1789,8 @@ PublishFirmwareStatusEnum string_to_publish_firmware_status_enum(const std::stri } // namespace conversions /// \brief Writes the string representation of the given PublishFirmwareStatusEnum \p publish_firmware_status_enum to -/// the given output stream \p os \returns an output stream with the PublishFirmwareStatusEnum written to +/// the given output stream \p os +/// \returns an output stream with the PublishFirmwareStatusEnum written to std::ostream& operator<<(std::ostream& os, const PublishFirmwareStatusEnum& publish_firmware_status_enum); // from: PullDynamicScheduleUpdateResponse @@ -1754,7 +1810,8 @@ ChargingProfileStatusEnum string_to_charging_profile_status_enum(const std::stri } // namespace conversions /// \brief Writes the string representation of the given ChargingProfileStatusEnum \p charging_profile_status_enum to -/// the given output stream \p os \returns an output stream with the ChargingProfileStatusEnum written to +/// the given output stream \p os +/// \returns an output stream with the ChargingProfileStatusEnum written to std::ostream& operator<<(std::ostream& os, const ChargingProfileStatusEnum& charging_profile_status_enum); // from: ReportChargingProfilesRequest @@ -1776,7 +1833,8 @@ ChargingProfileKindEnum string_to_charging_profile_kind_enum(const std::string& } // namespace conversions /// \brief Writes the string representation of the given ChargingProfileKindEnum \p charging_profile_kind_enum to the -/// given output stream \p os \returns an output stream with the ChargingProfileKindEnum written to +/// given output stream \p os +/// \returns an output stream with the ChargingProfileKindEnum written to std::ostream& operator<<(std::ostream& os, const ChargingProfileKindEnum& charging_profile_kind_enum); // from: ReportChargingProfilesRequest @@ -1796,7 +1854,8 @@ RecurrencyKindEnum string_to_recurrency_kind_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given RecurrencyKindEnum \p recurrency_kind_enum to the given output -/// stream \p os \returns an output stream with the RecurrencyKindEnum written to +/// stream \p os +/// \returns an output stream with the RecurrencyKindEnum written to std::ostream& operator<<(std::ostream& os, const RecurrencyKindEnum& recurrency_kind_enum); // from: ReportDERControlRequest @@ -1816,7 +1875,8 @@ PowerDuringCessationEnum string_to_power_during_cessation_enum(const std::string } // namespace conversions /// \brief Writes the string representation of the given PowerDuringCessationEnum \p power_during_cessation_enum to the -/// given output stream \p os \returns an output stream with the PowerDuringCessationEnum written to +/// given output stream \p os +/// \returns an output stream with the PowerDuringCessationEnum written to std::ostream& operator<<(std::ostream& os, const PowerDuringCessationEnum& power_during_cessation_enum); // from: ReportDERControlRequest @@ -1860,7 +1920,8 @@ RequestStartStopStatusEnum string_to_request_start_stop_status_enum(const std::s } // namespace conversions /// \brief Writes the string representation of the given RequestStartStopStatusEnum \p request_start_stop_status_enum to -/// the given output stream \p os \returns an output stream with the RequestStartStopStatusEnum written to +/// the given output stream \p os +/// \returns an output stream with the RequestStartStopStatusEnum written to std::ostream& operator<<(std::ostream& os, const RequestStartStopStatusEnum& request_start_stop_status_enum); // from: ReservationStatusUpdateRequest @@ -1881,7 +1942,8 @@ ReservationUpdateStatusEnum string_to_reservation_update_status_enum(const std:: } // namespace conversions /// \brief Writes the string representation of the given ReservationUpdateStatusEnum \p reservation_update_status_enum -/// to the given output stream \p os \returns an output stream with the ReservationUpdateStatusEnum written to +/// to the given output stream \p os +/// \returns an output stream with the ReservationUpdateStatusEnum written to std::ostream& operator<<(std::ostream& os, const ReservationUpdateStatusEnum& reservation_update_status_enum); // from: ReserveNowResponse @@ -1904,7 +1966,8 @@ ReserveNowStatusEnum string_to_reserve_now_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ReserveNowStatusEnum \p reserve_now_status_enum to the given -/// output stream \p os \returns an output stream with the ReserveNowStatusEnum written to +/// output stream \p os +/// \returns an output stream with the ReserveNowStatusEnum written to std::ostream& operator<<(std::ostream& os, const ReserveNowStatusEnum& reserve_now_status_enum); // from: ResetRequest @@ -1946,7 +2009,8 @@ ResetStatusEnum string_to_reset_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ResetStatusEnum \p reset_status_enum to the given output stream -/// \p os \returns an output stream with the ResetStatusEnum written to +/// \p os +/// \returns an output stream with the ResetStatusEnum written to std::ostream& operator<<(std::ostream& os, const ResetStatusEnum& reset_status_enum); // from: SendLocalListRequest @@ -1987,7 +2051,8 @@ SendLocalListStatusEnum string_to_send_local_list_status_enum(const std::string& } // namespace conversions /// \brief Writes the string representation of the given SendLocalListStatusEnum \p send_local_list_status_enum to the -/// given output stream \p os \returns an output stream with the SendLocalListStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the SendLocalListStatusEnum written to std::ostream& operator<<(std::ostream& os, const SendLocalListStatusEnum& send_local_list_status_enum); // from: SetDefaultTariffResponse @@ -2010,7 +2075,8 @@ TariffSetStatusEnum string_to_tariff_set_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given TariffSetStatusEnum \p tariff_set_status_enum to the given -/// output stream \p os \returns an output stream with the TariffSetStatusEnum written to +/// output stream \p os +/// \returns an output stream with the TariffSetStatusEnum written to std::ostream& operator<<(std::ostream& os, const TariffSetStatusEnum& tariff_set_status_enum); // from: SetDisplayMessageResponse @@ -2035,7 +2101,8 @@ DisplayMessageStatusEnum string_to_display_message_status_enum(const std::string } // namespace conversions /// \brief Writes the string representation of the given DisplayMessageStatusEnum \p display_message_status_enum to the -/// given output stream \p os \returns an output stream with the DisplayMessageStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the DisplayMessageStatusEnum written to std::ostream& operator<<(std::ostream& os, const DisplayMessageStatusEnum& display_message_status_enum); // from: SetMonitoringBaseRequest @@ -2056,7 +2123,8 @@ MonitoringBaseEnum string_to_monitoring_base_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MonitoringBaseEnum \p monitoring_base_enum to the given output -/// stream \p os \returns an output stream with the MonitoringBaseEnum written to +/// stream \p os +/// \returns an output stream with the MonitoringBaseEnum written to std::ostream& operator<<(std::ostream& os, const MonitoringBaseEnum& monitoring_base_enum); // from: SetNetworkProfileRequest @@ -2078,7 +2146,8 @@ APNAuthenticationEnum string_to_apnauthentication_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given APNAuthenticationEnum \p apnauthentication_enum to the given -/// output stream \p os \returns an output stream with the APNAuthenticationEnum written to +/// output stream \p os +/// \returns an output stream with the APNAuthenticationEnum written to std::ostream& operator<<(std::ostream& os, const APNAuthenticationEnum& apnauthentication_enum); // from: SetNetworkProfileRequest @@ -2102,7 +2171,8 @@ OCPPVersionEnum string_to_ocppversion_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given OCPPVersionEnum \p ocppversion_enum to the given output stream -/// \p os \returns an output stream with the OCPPVersionEnum written to +/// \p os +/// \returns an output stream with the OCPPVersionEnum written to std::ostream& operator<<(std::ostream& os, const OCPPVersionEnum& ocppversion_enum); // from: SetNetworkProfileRequest @@ -2129,7 +2199,8 @@ OCPPInterfaceEnum string_to_ocppinterface_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given OCPPInterfaceEnum \p ocppinterface_enum to the given output -/// stream \p os \returns an output stream with the OCPPInterfaceEnum written to +/// stream \p os +/// \returns an output stream with the OCPPInterfaceEnum written to std::ostream& operator<<(std::ostream& os, const OCPPInterfaceEnum& ocppinterface_enum); // from: SetNetworkProfileRequest @@ -2149,7 +2220,8 @@ OCPPTransportEnum string_to_ocpptransport_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given OCPPTransportEnum \p ocpptransport_enum to the given output -/// stream \p os \returns an output stream with the OCPPTransportEnum written to +/// stream \p os +/// \returns an output stream with the OCPPTransportEnum written to std::ostream& operator<<(std::ostream& os, const OCPPTransportEnum& ocpptransport_enum); // from: SetNetworkProfileRequest @@ -2192,7 +2264,8 @@ SetNetworkProfileStatusEnum string_to_set_network_profile_status_enum(const std: } // namespace conversions /// \brief Writes the string representation of the given SetNetworkProfileStatusEnum \p set_network_profile_status_enum -/// to the given output stream \p os \returns an output stream with the SetNetworkProfileStatusEnum written to +/// to the given output stream \p os +/// \returns an output stream with the SetNetworkProfileStatusEnum written to std::ostream& operator<<(std::ostream& os, const SetNetworkProfileStatusEnum& set_network_profile_status_enum); // from: SetVariableMonitoringResponse @@ -2216,7 +2289,8 @@ SetMonitoringStatusEnum string_to_set_monitoring_status_enum(const std::string& } // namespace conversions /// \brief Writes the string representation of the given SetMonitoringStatusEnum \p set_monitoring_status_enum to the -/// given output stream \p os \returns an output stream with the SetMonitoringStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the SetMonitoringStatusEnum written to std::ostream& operator<<(std::ostream& os, const SetMonitoringStatusEnum& set_monitoring_status_enum); // from: SetVariablesResponse @@ -2240,7 +2314,8 @@ SetVariableStatusEnum string_to_set_variable_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given SetVariableStatusEnum \p set_variable_status_enum to the given -/// output stream \p os \returns an output stream with the SetVariableStatusEnum written to +/// output stream \p os +/// \returns an output stream with the SetVariableStatusEnum written to std::ostream& operator<<(std::ostream& os, const SetVariableStatusEnum& set_variable_status_enum); // from: StatusNotificationRequest @@ -2263,7 +2338,8 @@ ConnectorStatusEnum string_to_connector_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ConnectorStatusEnum \p connector_status_enum to the given -/// output stream \p os \returns an output stream with the ConnectorStatusEnum written to +/// output stream \p os +/// \returns an output stream with the ConnectorStatusEnum written to std::ostream& operator<<(std::ostream& os, const ConnectorStatusEnum& connector_status_enum); // from: TransactionEventRequest @@ -2288,7 +2364,8 @@ CostDimensionEnum string_to_cost_dimension_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given CostDimensionEnum \p cost_dimension_enum to the given output -/// stream \p os \returns an output stream with the CostDimensionEnum written to +/// stream \p os +/// \returns an output stream with the CostDimensionEnum written to std::ostream& operator<<(std::ostream& os, const CostDimensionEnum& cost_dimension_enum); // from: TransactionEventRequest @@ -2309,7 +2386,8 @@ TariffCostEnum string_to_tariff_cost_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given TariffCostEnum \p tariff_cost_enum to the given output stream -/// \p os \returns an output stream with the TariffCostEnum written to +/// \p os +/// \returns an output stream with the TariffCostEnum written to std::ostream& operator<<(std::ostream& os, const TariffCostEnum& tariff_cost_enum); // from: TransactionEventRequest @@ -2330,7 +2408,8 @@ TransactionEventEnum string_to_transaction_event_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given TransactionEventEnum \p transaction_event_enum to the given -/// output stream \p os \returns an output stream with the TransactionEventEnum written to +/// output stream \p os +/// \returns an output stream with the TransactionEventEnum written to std::ostream& operator<<(std::ostream& os, const TransactionEventEnum& transaction_event_enum); // from: TransactionEventRequest @@ -2377,7 +2456,8 @@ TriggerReasonEnum string_to_trigger_reason_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given TriggerReasonEnum \p trigger_reason_enum to the given output -/// stream \p os \returns an output stream with the TriggerReasonEnum written to +/// stream \p os +/// \returns an output stream with the TriggerReasonEnum written to std::ostream& operator<<(std::ostream& os, const TriggerReasonEnum& trigger_reason_enum); // from: TransactionEventRequest @@ -2399,7 +2479,8 @@ PreconditioningStatusEnum string_to_preconditioning_status_enum(const std::strin } // namespace conversions /// \brief Writes the string representation of the given PreconditioningStatusEnum \p preconditioning_status_enum to the -/// given output stream \p os \returns an output stream with the PreconditioningStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the PreconditioningStatusEnum written to std::ostream& operator<<(std::ostream& os, const PreconditioningStatusEnum& preconditioning_status_enum); // from: TransactionEventRequest @@ -2422,7 +2503,8 @@ ChargingStateEnum string_to_charging_state_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given ChargingStateEnum \p charging_state_enum to the given output -/// stream \p os \returns an output stream with the ChargingStateEnum written to +/// stream \p os +/// \returns an output stream with the ChargingStateEnum written to std::ostream& operator<<(std::ostream& os, const ChargingStateEnum& charging_state_enum); // from: TransactionEventRequest @@ -2491,7 +2573,8 @@ MessageTriggerEnum string_to_message_trigger_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given MessageTriggerEnum \p message_trigger_enum to the given output -/// stream \p os \returns an output stream with the MessageTriggerEnum written to +/// stream \p os +/// \returns an output stream with the MessageTriggerEnum written to std::ostream& operator<<(std::ostream& os, const MessageTriggerEnum& message_trigger_enum); // from: TriggerMessageResponse @@ -2512,7 +2595,8 @@ TriggerMessageStatusEnum string_to_trigger_message_status_enum(const std::string } // namespace conversions /// \brief Writes the string representation of the given TriggerMessageStatusEnum \p trigger_message_status_enum to the -/// given output stream \p os \returns an output stream with the TriggerMessageStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the TriggerMessageStatusEnum written to std::ostream& operator<<(std::ostream& os, const TriggerMessageStatusEnum& trigger_message_status_enum); // from: UnlockConnectorResponse @@ -2534,7 +2618,8 @@ UnlockStatusEnum string_to_unlock_status_enum(const std::string& s); } // namespace conversions /// \brief Writes the string representation of the given UnlockStatusEnum \p unlock_status_enum to the given output -/// stream \p os \returns an output stream with the UnlockStatusEnum written to +/// stream \p os +/// \returns an output stream with the UnlockStatusEnum written to std::ostream& operator<<(std::ostream& os, const UnlockStatusEnum& unlock_status_enum); // from: UnpublishFirmwareResponse @@ -2555,7 +2640,8 @@ UnpublishFirmwareStatusEnum string_to_unpublish_firmware_status_enum(const std:: } // namespace conversions /// \brief Writes the string representation of the given UnpublishFirmwareStatusEnum \p unpublish_firmware_status_enum -/// to the given output stream \p os \returns an output stream with the UnpublishFirmwareStatusEnum written to +/// to the given output stream \p os +/// \returns an output stream with the UnpublishFirmwareStatusEnum written to std::ostream& operator<<(std::ostream& os, const UnpublishFirmwareStatusEnum& unpublish_firmware_status_enum); // from: UpdateFirmwareResponse @@ -2578,7 +2664,8 @@ UpdateFirmwareStatusEnum string_to_update_firmware_status_enum(const std::string } // namespace conversions /// \brief Writes the string representation of the given UpdateFirmwareStatusEnum \p update_firmware_status_enum to the -/// given output stream \p os \returns an output stream with the UpdateFirmwareStatusEnum written to +/// given output stream \p os +/// \returns an output stream with the UpdateFirmwareStatusEnum written to std::ostream& operator<<(std::ostream& os, const UpdateFirmwareStatusEnum& update_firmware_status_enum); // from: UsePriorityChargingResponse @@ -2599,7 +2686,8 @@ PriorityChargingStatusEnum string_to_priority_charging_status_enum(const std::st } // namespace conversions /// \brief Writes the string representation of the given PriorityChargingStatusEnum \p priority_charging_status_enum to -/// the given output stream \p os \returns an output stream with the PriorityChargingStatusEnum written to +/// the given output stream \p os +/// \returns an output stream with the PriorityChargingStatusEnum written to std::ostream& operator<<(std::ostream& os, const PriorityChargingStatusEnum& priority_charging_status_enum); } // namespace v2 diff --git a/include/ocpp/v2/ocpp_types.hpp b/include/ocpp/v2/ocpp_types.hpp index 3360f5c34..5c9e0dd66 100644 --- a/include/ocpp/v2/ocpp_types.hpp +++ b/include/ocpp/v2/ocpp_types.hpp @@ -478,7 +478,8 @@ void to_json(json& j, const CertificateStatusRequestInfo& k); void from_json(const json& j, CertificateStatusRequestInfo& k); /// \brief Writes the string representation of the given CertificateStatusRequestInfo \p k to the given output stream \p -/// os \returns an output stream with the CertificateStatusRequestInfo written to +/// os +/// \returns an output stream with the CertificateStatusRequestInfo written to std::ostream& operator<<(std::ostream& os, const CertificateStatusRequestInfo& k); struct CertificateStatus { @@ -1020,7 +1021,8 @@ void to_json(json& j, const AdditionalSelectedServices& k); void from_json(const json& j, AdditionalSelectedServices& k); /// \brief Writes the string representation of the given AdditionalSelectedServices \p k to the given output stream \p -/// os \returns an output stream with the AdditionalSelectedServices written to +/// os +/// \returns an output stream with the AdditionalSelectedServices written to std::ostream& operator<<(std::ostream& os, const AdditionalSelectedServices& k); struct AbsolutePriceSchedule { @@ -1245,7 +1247,8 @@ void to_json(json& j, const EVAbsolutePriceScheduleEntry& k); void from_json(const json& j, EVAbsolutePriceScheduleEntry& k); /// \brief Writes the string representation of the given EVAbsolutePriceScheduleEntry \p k to the given output stream \p -/// os \returns an output stream with the EVAbsolutePriceScheduleEntry written to +/// os +/// \returns an output stream with the EVAbsolutePriceScheduleEntry written to std::ostream& operator<<(std::ostream& os, const EVAbsolutePriceScheduleEntry& k); struct EVAbsolutePriceSchedule { diff --git a/include/ocpp/v2/ocsp_updater.hpp b/include/ocpp/v2/ocsp_updater.hpp index 0249eb6c0..3bd680f40 100644 --- a/include/ocpp/v2/ocsp_updater.hpp +++ b/include/ocpp/v2/ocsp_updater.hpp @@ -35,7 +35,7 @@ class OcspUpdateFailedException : public std::exception { const bool _allows_retry; }; -typedef std::function cert_status_func; +using cert_status_func = std::function; // Forward declarations to avoid include loops class ChargePoint; @@ -43,8 +43,7 @@ class UnexpectedMessageTypeFromCSMS; class OcspUpdaterInterface { public: - virtual ~OcspUpdaterInterface() { - } + virtual ~OcspUpdaterInterface() = default; virtual void start() = 0; virtual void stop() = 0; // Wake up the updater thread and tell it to update @@ -58,8 +57,7 @@ class OcspUpdater : public OcspUpdaterInterface { OcspUpdater(std::shared_ptr evse_security, cert_status_func get_cert_status_from_csms, std::chrono::seconds ocsp_cache_update_interval = std::chrono::hours(167), std::chrono::seconds ocsp_cache_update_retry_interval = std::chrono::hours(24)); - virtual ~OcspUpdater() { - } + ~OcspUpdater() override = default; void start() override; void stop() override; diff --git a/include/ocpp/v2/profile.hpp b/include/ocpp/v2/profile.hpp index a6c68acfa..a05841a33 100644 --- a/include/ocpp/v2/profile.hpp +++ b/include/ocpp/v2/profile.hpp @@ -86,7 +86,7 @@ std::vector calculate_start(const DateTime& now, const DateTime& end, /// \return the list of start times std::vector calculate_profile_entry(const DateTime& now, const DateTime& end, const std::optional& session_start, - const ChargingProfile& profile, std::uint8_t period_index); + const ChargingProfile& profile, std::size_t period_index); /// \brief generate an ordered list of valid schedule periods for the profile /// \param now the current date and time diff --git a/include/ocpp/v21/functional_blocks/bidirectional.hpp b/include/ocpp/v21/functional_blocks/bidirectional.hpp index 2b94af4e9..b72be8f0a 100644 --- a/include/ocpp/v21/functional_blocks/bidirectional.hpp +++ b/include/ocpp/v21/functional_blocks/bidirectional.hpp @@ -12,14 +12,13 @@ namespace ocpp::v2 { -typedef std::function allowed_energy_transfer_modes, - const CiString<36> transaction_id)> - NotifyAllowedEnergyTransferCallback; +using NotifyAllowedEnergyTransferCallback = + std::function allowed_energy_transfer_modes, + const CiString<36> transaction_id)>; class BidirectionalInterface : public MessageHandlerInterface { public: - virtual ~BidirectionalInterface() { - } + ~BidirectionalInterface() override = default; }; class Bidirectional : public BidirectionalInterface { @@ -31,12 +30,13 @@ class Bidirectional : public BidirectionalInterface { public: explicit Bidirectional(const FunctionalBlockContext& context, std::optional notify_allowed_energy_transfer_callback); - ~Bidirectional(); + ~Bidirectional() override; void handle_message(const ocpp::EnhancedMessage& message) override; private: // Functions - void handle_notify_allowed_energy_transfer(Call msg); + void + handle_notify_allowed_energy_transfer(Call notify_allowed_energy_transfer); }; } // namespace ocpp::v2 diff --git a/include/ocpp/v21/messages/AdjustPeriodicEventStream.hpp b/include/ocpp/v21/messages/AdjustPeriodicEventStream.hpp index 9a167c523..0d3f82636 100644 --- a/include/ocpp/v21/messages/AdjustPeriodicEventStream.hpp +++ b/include/ocpp/v21/messages/AdjustPeriodicEventStream.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const AdjustPeriodicEventStreamRequest& k); void from_json(const json& j, AdjustPeriodicEventStreamRequest& k); /// \brief Writes the string representation of the given AdjustPeriodicEventStreamRequest \p k to the given output -/// stream \p os \returns an output stream with the AdjustPeriodicEventStreamRequest written to +/// stream \p os +/// \returns an output stream with the AdjustPeriodicEventStreamRequest written to std::ostream& operator<<(std::ostream& os, const AdjustPeriodicEventStreamRequest& k); /// \brief Contains a OCPP AdjustPeriodicEventStreamResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const AdjustPeriodicEventStreamResponse& k); void from_json(const json& j, AdjustPeriodicEventStreamResponse& k); /// \brief Writes the string representation of the given AdjustPeriodicEventStreamResponse \p k to the given output -/// stream \p os \returns an output stream with the AdjustPeriodicEventStreamResponse written to +/// stream \p os +/// \returns an output stream with the AdjustPeriodicEventStreamResponse written to std::ostream& operator<<(std::ostream& os, const AdjustPeriodicEventStreamResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/ChangeTransactionTariff.hpp b/include/ocpp/v21/messages/ChangeTransactionTariff.hpp index ccfd13a7b..f50d5a8df 100644 --- a/include/ocpp/v21/messages/ChangeTransactionTariff.hpp +++ b/include/ocpp/v21/messages/ChangeTransactionTariff.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const ChangeTransactionTariffRequest& k); void from_json(const json& j, ChangeTransactionTariffRequest& k); /// \brief Writes the string representation of the given ChangeTransactionTariffRequest \p k to the given output stream -/// \p os \returns an output stream with the ChangeTransactionTariffRequest written to +/// \p os +/// \returns an output stream with the ChangeTransactionTariffRequest written to std::ostream& operator<<(std::ostream& os, const ChangeTransactionTariffRequest& k); /// \brief Contains a OCPP ChangeTransactionTariffResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const ChangeTransactionTariffResponse& k); void from_json(const json& j, ChangeTransactionTariffResponse& k); /// \brief Writes the string representation of the given ChangeTransactionTariffResponse \p k to the given output stream -/// \p os \returns an output stream with the ChangeTransactionTariffResponse written to +/// \p os +/// \returns an output stream with the ChangeTransactionTariffResponse written to std::ostream& operator<<(std::ostream& os, const ChangeTransactionTariffResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/ClosePeriodicEventStream.hpp b/include/ocpp/v21/messages/ClosePeriodicEventStream.hpp index e6185fb9d..dd0d27546 100644 --- a/include/ocpp/v21/messages/ClosePeriodicEventStream.hpp +++ b/include/ocpp/v21/messages/ClosePeriodicEventStream.hpp @@ -32,7 +32,8 @@ void to_json(json& j, const ClosePeriodicEventStreamRequest& k); void from_json(const json& j, ClosePeriodicEventStreamRequest& k); /// \brief Writes the string representation of the given ClosePeriodicEventStreamRequest \p k to the given output stream -/// \p os \returns an output stream with the ClosePeriodicEventStreamRequest written to +/// \p os +/// \returns an output stream with the ClosePeriodicEventStreamRequest written to std::ostream& operator<<(std::ostream& os, const ClosePeriodicEventStreamRequest& k); /// \brief Contains a OCPP ClosePeriodicEventStreamResponse message @@ -51,7 +52,8 @@ void to_json(json& j, const ClosePeriodicEventStreamResponse& k); void from_json(const json& j, ClosePeriodicEventStreamResponse& k); /// \brief Writes the string representation of the given ClosePeriodicEventStreamResponse \p k to the given output -/// stream \p os \returns an output stream with the ClosePeriodicEventStreamResponse written to +/// stream \p os +/// \returns an output stream with the ClosePeriodicEventStreamResponse written to std::ostream& operator<<(std::ostream& os, const ClosePeriodicEventStreamResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/GetCertificateChainStatus.hpp b/include/ocpp/v21/messages/GetCertificateChainStatus.hpp index eba00d9f5..df1d90945 100644 --- a/include/ocpp/v21/messages/GetCertificateChainStatus.hpp +++ b/include/ocpp/v21/messages/GetCertificateChainStatus.hpp @@ -33,7 +33,8 @@ void to_json(json& j, const GetCertificateChainStatusRequest& k); void from_json(const json& j, GetCertificateChainStatusRequest& k); /// \brief Writes the string representation of the given GetCertificateChainStatusRequest \p k to the given output -/// stream \p os \returns an output stream with the GetCertificateChainStatusRequest written to +/// stream \p os +/// \returns an output stream with the GetCertificateChainStatusRequest written to std::ostream& operator<<(std::ostream& os, const GetCertificateChainStatusRequest& k); /// \brief Contains a OCPP GetCertificateChainStatusResponse message @@ -53,7 +54,8 @@ void to_json(json& j, const GetCertificateChainStatusResponse& k); void from_json(const json& j, GetCertificateChainStatusResponse& k); /// \brief Writes the string representation of the given GetCertificateChainStatusResponse \p k to the given output -/// stream \p os \returns an output stream with the GetCertificateChainStatusResponse written to +/// stream \p os +/// \returns an output stream with the GetCertificateChainStatusResponse written to std::ostream& operator<<(std::ostream& os, const GetCertificateChainStatusResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/GetPeriodicEventStream.hpp b/include/ocpp/v21/messages/GetPeriodicEventStream.hpp index 3763e71be..a9231885c 100644 --- a/include/ocpp/v21/messages/GetPeriodicEventStream.hpp +++ b/include/ocpp/v21/messages/GetPeriodicEventStream.hpp @@ -31,7 +31,8 @@ void to_json(json& j, const GetPeriodicEventStreamRequest& k); void from_json(const json& j, GetPeriodicEventStreamRequest& k); /// \brief Writes the string representation of the given GetPeriodicEventStreamRequest \p k to the given output stream -/// \p os \returns an output stream with the GetPeriodicEventStreamRequest written to +/// \p os +/// \returns an output stream with the GetPeriodicEventStreamRequest written to std::ostream& operator<<(std::ostream& os, const GetPeriodicEventStreamRequest& k); /// \brief Contains a OCPP GetPeriodicEventStreamResponse message @@ -51,7 +52,8 @@ void to_json(json& j, const GetPeriodicEventStreamResponse& k); void from_json(const json& j, GetPeriodicEventStreamResponse& k); /// \brief Writes the string representation of the given GetPeriodicEventStreamResponse \p k to the given output stream -/// \p os \returns an output stream with the GetPeriodicEventStreamResponse written to +/// \p os +/// \returns an output stream with the GetPeriodicEventStreamResponse written to std::ostream& operator<<(std::ostream& os, const GetPeriodicEventStreamResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/NotifyAllowedEnergyTransfer.hpp b/include/ocpp/v21/messages/NotifyAllowedEnergyTransfer.hpp index 5d1cefee1..96a9d8b59 100644 --- a/include/ocpp/v21/messages/NotifyAllowedEnergyTransfer.hpp +++ b/include/ocpp/v21/messages/NotifyAllowedEnergyTransfer.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const NotifyAllowedEnergyTransferRequest& k); void from_json(const json& j, NotifyAllowedEnergyTransferRequest& k); /// \brief Writes the string representation of the given NotifyAllowedEnergyTransferRequest \p k to the given output -/// stream \p os \returns an output stream with the NotifyAllowedEnergyTransferRequest written to +/// stream \p os +/// \returns an output stream with the NotifyAllowedEnergyTransferRequest written to std::ostream& operator<<(std::ostream& os, const NotifyAllowedEnergyTransferRequest& k); /// \brief Contains a OCPP NotifyAllowedEnergyTransferResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const NotifyAllowedEnergyTransferResponse& k); void from_json(const json& j, NotifyAllowedEnergyTransferResponse& k); /// \brief Writes the string representation of the given NotifyAllowedEnergyTransferResponse \p k to the given output -/// stream \p os \returns an output stream with the NotifyAllowedEnergyTransferResponse written to +/// stream \p os +/// \returns an output stream with the NotifyAllowedEnergyTransferResponse written to std::ostream& operator<<(std::ostream& os, const NotifyAllowedEnergyTransferResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/NotifyDERStartStop.hpp b/include/ocpp/v21/messages/NotifyDERStartStop.hpp index cd2816427..5e4556e94 100644 --- a/include/ocpp/v21/messages/NotifyDERStartStop.hpp +++ b/include/ocpp/v21/messages/NotifyDERStartStop.hpp @@ -54,7 +54,8 @@ void to_json(json& j, const NotifyDERStartStopResponse& k); void from_json(const json& j, NotifyDERStartStopResponse& k); /// \brief Writes the string representation of the given NotifyDERStartStopResponse \p k to the given output stream \p -/// os \returns an output stream with the NotifyDERStartStopResponse written to +/// os +/// \returns an output stream with the NotifyDERStartStopResponse written to std::ostream& operator<<(std::ostream& os, const NotifyDERStartStopResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/NotifyPriorityCharging.hpp b/include/ocpp/v21/messages/NotifyPriorityCharging.hpp index 88275ce26..7a74a94e6 100644 --- a/include/ocpp/v21/messages/NotifyPriorityCharging.hpp +++ b/include/ocpp/v21/messages/NotifyPriorityCharging.hpp @@ -33,7 +33,8 @@ void to_json(json& j, const NotifyPriorityChargingRequest& k); void from_json(const json& j, NotifyPriorityChargingRequest& k); /// \brief Writes the string representation of the given NotifyPriorityChargingRequest \p k to the given output stream -/// \p os \returns an output stream with the NotifyPriorityChargingRequest written to +/// \p os +/// \returns an output stream with the NotifyPriorityChargingRequest written to std::ostream& operator<<(std::ostream& os, const NotifyPriorityChargingRequest& k); /// \brief Contains a OCPP NotifyPriorityChargingResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const NotifyPriorityChargingResponse& k); void from_json(const json& j, NotifyPriorityChargingResponse& k); /// \brief Writes the string representation of the given NotifyPriorityChargingResponse \p k to the given output stream -/// \p os \returns an output stream with the NotifyPriorityChargingResponse written to +/// \p os +/// \returns an output stream with the NotifyPriorityChargingResponse written to std::ostream& operator<<(std::ostream& os, const NotifyPriorityChargingResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/NotifyWebPaymentStarted.hpp b/include/ocpp/v21/messages/NotifyWebPaymentStarted.hpp index 574e0e7ce..186cd9954 100644 --- a/include/ocpp/v21/messages/NotifyWebPaymentStarted.hpp +++ b/include/ocpp/v21/messages/NotifyWebPaymentStarted.hpp @@ -33,7 +33,8 @@ void to_json(json& j, const NotifyWebPaymentStartedRequest& k); void from_json(const json& j, NotifyWebPaymentStartedRequest& k); /// \brief Writes the string representation of the given NotifyWebPaymentStartedRequest \p k to the given output stream -/// \p os \returns an output stream with the NotifyWebPaymentStartedRequest written to +/// \p os +/// \returns an output stream with the NotifyWebPaymentStartedRequest written to std::ostream& operator<<(std::ostream& os, const NotifyWebPaymentStartedRequest& k); /// \brief Contains a OCPP NotifyWebPaymentStartedResponse message @@ -52,7 +53,8 @@ void to_json(json& j, const NotifyWebPaymentStartedResponse& k); void from_json(const json& j, NotifyWebPaymentStartedResponse& k); /// \brief Writes the string representation of the given NotifyWebPaymentStartedResponse \p k to the given output stream -/// \p os \returns an output stream with the NotifyWebPaymentStartedResponse written to +/// \p os +/// \returns an output stream with the NotifyWebPaymentStartedResponse written to std::ostream& operator<<(std::ostream& os, const NotifyWebPaymentStartedResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/OpenPeriodicEventStream.hpp b/include/ocpp/v21/messages/OpenPeriodicEventStream.hpp index 140e4b6b4..44e3ae14e 100644 --- a/include/ocpp/v21/messages/OpenPeriodicEventStream.hpp +++ b/include/ocpp/v21/messages/OpenPeriodicEventStream.hpp @@ -33,7 +33,8 @@ void to_json(json& j, const OpenPeriodicEventStreamRequest& k); void from_json(const json& j, OpenPeriodicEventStreamRequest& k); /// \brief Writes the string representation of the given OpenPeriodicEventStreamRequest \p k to the given output stream -/// \p os \returns an output stream with the OpenPeriodicEventStreamRequest written to +/// \p os +/// \returns an output stream with the OpenPeriodicEventStreamRequest written to std::ostream& operator<<(std::ostream& os, const OpenPeriodicEventStreamRequest& k); /// \brief Contains a OCPP OpenPeriodicEventStreamResponse message @@ -54,7 +55,8 @@ void to_json(json& j, const OpenPeriodicEventStreamResponse& k); void from_json(const json& j, OpenPeriodicEventStreamResponse& k); /// \brief Writes the string representation of the given OpenPeriodicEventStreamResponse \p k to the given output stream -/// \p os \returns an output stream with the OpenPeriodicEventStreamResponse written to +/// \p os +/// \returns an output stream with the OpenPeriodicEventStreamResponse written to std::ostream& operator<<(std::ostream& os, const OpenPeriodicEventStreamResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/PullDynamicScheduleUpdate.hpp b/include/ocpp/v21/messages/PullDynamicScheduleUpdate.hpp index 65125e7e6..80ed786a8 100644 --- a/include/ocpp/v21/messages/PullDynamicScheduleUpdate.hpp +++ b/include/ocpp/v21/messages/PullDynamicScheduleUpdate.hpp @@ -33,7 +33,8 @@ void to_json(json& j, const PullDynamicScheduleUpdateRequest& k); void from_json(const json& j, PullDynamicScheduleUpdateRequest& k); /// \brief Writes the string representation of the given PullDynamicScheduleUpdateRequest \p k to the given output -/// stream \p os \returns an output stream with the PullDynamicScheduleUpdateRequest written to +/// stream \p os +/// \returns an output stream with the PullDynamicScheduleUpdateRequest written to std::ostream& operator<<(std::ostream& os, const PullDynamicScheduleUpdateRequest& k); /// \brief Contains a OCPP PullDynamicScheduleUpdateResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const PullDynamicScheduleUpdateResponse& k); void from_json(const json& j, PullDynamicScheduleUpdateResponse& k); /// \brief Writes the string representation of the given PullDynamicScheduleUpdateResponse \p k to the given output -/// stream \p os \returns an output stream with the PullDynamicScheduleUpdateResponse written to +/// stream \p os +/// \returns an output stream with the PullDynamicScheduleUpdateResponse written to std::ostream& operator<<(std::ostream& os, const PullDynamicScheduleUpdateResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/RequestBatterySwap.hpp b/include/ocpp/v21/messages/RequestBatterySwap.hpp index cee9e78e1..d9ea5bb99 100644 --- a/include/ocpp/v21/messages/RequestBatterySwap.hpp +++ b/include/ocpp/v21/messages/RequestBatterySwap.hpp @@ -55,7 +55,8 @@ void to_json(json& j, const RequestBatterySwapResponse& k); void from_json(const json& j, RequestBatterySwapResponse& k); /// \brief Writes the string representation of the given RequestBatterySwapResponse \p k to the given output stream \p -/// os \returns an output stream with the RequestBatterySwapResponse written to +/// os +/// \returns an output stream with the RequestBatterySwapResponse written to std::ostream& operator<<(std::ostream& os, const RequestBatterySwapResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/UpdateDynamicSchedule.hpp b/include/ocpp/v21/messages/UpdateDynamicSchedule.hpp index f1400c68f..059475caa 100644 --- a/include/ocpp/v21/messages/UpdateDynamicSchedule.hpp +++ b/include/ocpp/v21/messages/UpdateDynamicSchedule.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const UpdateDynamicScheduleRequest& k); void from_json(const json& j, UpdateDynamicScheduleRequest& k); /// \brief Writes the string representation of the given UpdateDynamicScheduleRequest \p k to the given output stream \p -/// os \returns an output stream with the UpdateDynamicScheduleRequest written to +/// os +/// \returns an output stream with the UpdateDynamicScheduleRequest written to std::ostream& operator<<(std::ostream& os, const UpdateDynamicScheduleRequest& k); /// \brief Contains a OCPP UpdateDynamicScheduleResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const UpdateDynamicScheduleResponse& k); void from_json(const json& j, UpdateDynamicScheduleResponse& k); /// \brief Writes the string representation of the given UpdateDynamicScheduleResponse \p k to the given output stream -/// \p os \returns an output stream with the UpdateDynamicScheduleResponse written to +/// \p os +/// \returns an output stream with the UpdateDynamicScheduleResponse written to std::ostream& operator<<(std::ostream& os, const UpdateDynamicScheduleResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/UsePriorityCharging.hpp b/include/ocpp/v21/messages/UsePriorityCharging.hpp index 19e2a9965..56c095830 100644 --- a/include/ocpp/v21/messages/UsePriorityCharging.hpp +++ b/include/ocpp/v21/messages/UsePriorityCharging.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const UsePriorityChargingRequest& k); void from_json(const json& j, UsePriorityChargingRequest& k); /// \brief Writes the string representation of the given UsePriorityChargingRequest \p k to the given output stream \p -/// os \returns an output stream with the UsePriorityChargingRequest written to +/// os +/// \returns an output stream with the UsePriorityChargingRequest written to std::ostream& operator<<(std::ostream& os, const UsePriorityChargingRequest& k); /// \brief Contains a OCPP UsePriorityChargingResponse message @@ -55,7 +56,8 @@ void to_json(json& j, const UsePriorityChargingResponse& k); void from_json(const json& j, UsePriorityChargingResponse& k); /// \brief Writes the string representation of the given UsePriorityChargingResponse \p k to the given output stream \p -/// os \returns an output stream with the UsePriorityChargingResponse written to +/// os +/// \returns an output stream with the UsePriorityChargingResponse written to std::ostream& operator<<(std::ostream& os, const UsePriorityChargingResponse& k); } // namespace v21 diff --git a/include/ocpp/v21/messages/VatNumberValidation.hpp b/include/ocpp/v21/messages/VatNumberValidation.hpp index 219c6f8e8..f7491dbaf 100644 --- a/include/ocpp/v21/messages/VatNumberValidation.hpp +++ b/include/ocpp/v21/messages/VatNumberValidation.hpp @@ -34,7 +34,8 @@ void to_json(json& j, const VatNumberValidationRequest& k); void from_json(const json& j, VatNumberValidationRequest& k); /// \brief Writes the string representation of the given VatNumberValidationRequest \p k to the given output stream \p -/// os \returns an output stream with the VatNumberValidationRequest written to +/// os +/// \returns an output stream with the VatNumberValidationRequest written to std::ostream& operator<<(std::ostream& os, const VatNumberValidationRequest& k); /// \brief Contains a OCPP VatNumberValidationResponse message @@ -58,7 +59,8 @@ void to_json(json& j, const VatNumberValidationResponse& k); void from_json(const json& j, VatNumberValidationResponse& k); /// \brief Writes the string representation of the given VatNumberValidationResponse \p k to the given output stream \p -/// os \returns an output stream with the VatNumberValidationResponse written to +/// os +/// \returns an output stream with the VatNumberValidationResponse written to std::ostream& operator<<(std::ostream& os, const VatNumberValidationResponse& k); } // namespace v21 diff --git a/lib/ocpp/common/call_types.cpp b/lib/ocpp/common/call_types.cpp index 20b7eaf4b..e0e1a3c4b 100644 --- a/lib/ocpp/common/call_types.cpp +++ b/lib/ocpp/common/call_types.cpp @@ -11,7 +11,7 @@ namespace ocpp { MessageId create_message_id() { static boost::uuids::random_generator uuid_generator; - boost::uuids::uuid uuid = uuid_generator(); + const boost::uuids::uuid uuid = uuid_generator(); std::stringstream s; s << uuid; return MessageId(s.str()); diff --git a/lib/ocpp/common/database/database_handler_common.cpp b/lib/ocpp/common/database/database_handler_common.cpp index 7ce0080f2..175304bb9 100644 --- a/lib/ocpp/common/database/database_handler_common.cpp +++ b/lib/ocpp/common/database/database_handler_common.cpp @@ -42,11 +42,12 @@ std::vector DatabaseHandlerCommon::get_message_queue_messa const std::string table_name = queue_type == QueueType::Normal ? "NORMAL_QUEUE" : "TRANSACTION_QUEUE"; - std::string sql = "SELECT UNIQUE_ID, MESSAGE, MESSAGE_TYPE, MESSAGE_ATTEMPTS, MESSAGE_TIMESTAMP FROM " + table_name; + const std::string sql = + "SELECT UNIQUE_ID, MESSAGE, MESSAGE_TYPE, MESSAGE_ATTEMPTS, MESSAGE_TIMESTAMP FROM " + table_name; auto stmt = this->database->new_statement(sql); - int status; + int status = SQLITE_ERROR; while ((status = stmt->step()) == SQLITE_ROW) { try { const std::string message = stmt->column_text(1); @@ -55,7 +56,7 @@ std::vector DatabaseHandlerCommon::get_message_queue_messa const std::string message_timestamp = stmt->column_text(4); const int message_attempts = stmt->column_int(3); - json json_message = json::parse(message); + const json json_message = json::parse(message); DBTransactionMessage control_message; control_message.message_attempts = message_attempts; @@ -105,7 +106,7 @@ void DatabaseHandlerCommon::insert_message_queue_message(const DBTransactionMess void DatabaseHandlerCommon::remove_message_queue_message(const std::string& unique_id, const QueueType queue_type) { const std::string table_name = queue_type == QueueType::Normal ? "NORMAL_QUEUE" : "TRANSACTION_QUEUE"; - std::string sql = "DELETE FROM " + table_name + " WHERE UNIQUE_ID = @unique_id"; + const std::string sql = "DELETE FROM " + table_name + " WHERE UNIQUE_ID = @unique_id"; auto stmt = this->database->new_statement(sql); diff --git a/lib/ocpp/common/evse_security.cpp b/lib/ocpp/common/evse_security.cpp index 0fc5dac81..89fc59c7e 100644 --- a/lib/ocpp/common/evse_security.cpp +++ b/lib/ocpp/common/evse_security.cpp @@ -58,19 +58,20 @@ ocpp::v2::HashAlgorithmEnum to_ocpp_v2(ocpp::HashAlgorithmEnumType other) { ocpp::v2::InstallCertificateStatusEnum to_ocpp_v2(ocpp::InstallCertificateResult other) { switch (other) { - case ocpp::InstallCertificateResult::InvalidSignature: + case ocpp::InstallCertificateResult::InvalidSignature: // NOLINT(bugprone-branch-clone): readability return ocpp::v2::InstallCertificateStatusEnum::Rejected; - case ocpp::InstallCertificateResult::InvalidCertificateChain: + case ocpp::InstallCertificateResult::InvalidCertificateChain: // NOLINT(bugprone-branch-clone): readability return ocpp::v2::InstallCertificateStatusEnum::Rejected; - case ocpp::InstallCertificateResult::InvalidFormat: + case ocpp::InstallCertificateResult::InvalidFormat: // NOLINT(bugprone-branch-clone): readability return ocpp::v2::InstallCertificateStatusEnum::Rejected; - case ocpp::InstallCertificateResult::InvalidCommonName: + case ocpp::InstallCertificateResult::InvalidCommonName: // NOLINT(bugprone-branch-clone): readability return ocpp::v2::InstallCertificateStatusEnum::Rejected; - case ocpp::InstallCertificateResult::NoRootCertificateInstalled: + case ocpp::InstallCertificateResult::NoRootCertificateInstalled: // NOLINT(bugprone-branch-clone): readability return ocpp::v2::InstallCertificateStatusEnum::Rejected; - case ocpp::InstallCertificateResult::Expired: + case ocpp::InstallCertificateResult::Expired: // NOLINT(bugprone-branch-clone): readability return ocpp::v2::InstallCertificateStatusEnum::Rejected; - case ocpp::InstallCertificateResult::CertificateStoreMaxLengthExceeded: + case ocpp::InstallCertificateResult::CertificateStoreMaxLengthExceeded: // NOLINT(bugprone-branch-clone): + // readability return ocpp::v2::InstallCertificateStatusEnum::Rejected; case ocpp::InstallCertificateResult::WriteError: return ocpp::v2::InstallCertificateStatusEnum::Failed; @@ -130,7 +131,7 @@ ocpp::v2::OCSPRequestData to_ocpp_v2(ocpp::OCSPRequestData other) { std::vector to_ocpp_v2(const std::vector& ocsp_request_data) { std::vector ocsp_request_data_list; for (const auto& ocsp_data : ocsp_request_data) { - ocpp::v2::OCSPRequestData request = to_ocpp_v2(ocsp_data); + const ocpp::v2::OCSPRequestData request = to_ocpp_v2(ocsp_data); ocsp_request_data_list.push_back(request); } return ocsp_request_data_list; @@ -157,6 +158,7 @@ ocpp::CertificateType from_ocpp_v2(ocpp::v2::GetCertificateIdUseEnum other) { std::vector from_ocpp_v2(const std::vector& other) { std::vector certificate_types; + certificate_types.reserve(other.size()); for (const auto& certificate_id_use_enum : other) { certificate_types.push_back(from_ocpp_v2(certificate_id_use_enum)); } diff --git a/lib/ocpp/common/evse_security_impl.cpp b/lib/ocpp/common/evse_security_impl.cpp index 1fa26b0f1..ace8ec840 100644 --- a/lib/ocpp/common/evse_security_impl.cpp +++ b/lib/ocpp/common/evse_security_impl.cpp @@ -53,6 +53,7 @@ EvseSecurityImpl::verify_certificate(const std::string& certificate_chain, const std::vector& certificate_types) { std::vector _certificate_types; + _certificate_types.reserve(certificate_types.size()); for (const auto& certificate_type : certificate_types) { _certificate_types.push_back(conversions::from_ocpp(certificate_type)); } @@ -66,12 +67,14 @@ EvseSecurityImpl::get_installed_certificates(const std::vector& std::vector _certificate_types; + _certificate_types.reserve(certificate_types.size()); for (const auto& certificate_type : certificate_types) { _certificate_types.push_back(conversions::from_ocpp(certificate_type)); } const auto installed_certificates = this->evse_security->get_installed_certificates(_certificate_types); + result.reserve(installed_certificates.certificate_hash_data_chain.size()); for (const auto& certificate_hash_data : installed_certificates.certificate_hash_data_chain) { result.push_back(conversions::to_ocpp(certificate_hash_data)); } @@ -82,6 +85,7 @@ std::vector EvseSecurityImpl::get_v2g_ocsp_request_data() { std::vector result; const auto ocsp_request_data = this->evse_security->get_v2g_ocsp_request_data(); + result.reserve(ocsp_request_data.ocsp_request_data_list.size()); for (const auto& ocsp_request_entry : ocsp_request_data.ocsp_request_data_list) { result.push_back(conversions::to_ocpp(ocsp_request_entry)); } @@ -93,6 +97,7 @@ std::vector EvseSecurityImpl::get_mo_ocsp_request_data(const st std::vector result; const auto ocsp_request_data = this->evse_security->get_mo_ocsp_request_data(certificate_chain); + result.reserve(ocsp_request_data.ocsp_request_data_list.size()); for (const auto& ocsp_request_entry : ocsp_request_data.ocsp_request_data_list) { result.push_back(conversions::to_ocpp(ocsp_request_entry)); } @@ -306,6 +311,7 @@ CertificateHashDataChain to_ocpp(evse_security::CertificateHashDataChain other) lhs.certificateHashData = to_ocpp(other.certificate_hash_data); std::vector v; + v.reserve(other.child_certificate_hash_data.size()); for (const auto& certificate_hash_data : other.child_certificate_hash_data) { v.push_back(to_ocpp(certificate_hash_data)); } diff --git a/lib/ocpp/common/ocpp_logging.cpp b/lib/ocpp/common/ocpp_logging.cpp index 094e405e1..01468a267 100644 --- a/lib/ocpp/common/ocpp_logging.cpp +++ b/lib/ocpp/common/ocpp_logging.cpp @@ -13,6 +13,19 @@ using json = nlohmann::json; namespace ocpp { +namespace { +/// \brief Add opening html tags to the given stream \p os +void open_html_tags(std::ofstream& os); + +/// \brief Add closing html tags to the given stream \p os +void close_html_tags(std::ofstream& os); + +/// \returns a datetime string in YearMonthDayHourMinuteSecond format +std::string get_datetime_string(); + +/// \returns file size of the given path or 0 if the file does not exist +std::uintmax_t safe_file_size(const std::filesystem::path& path); +} // namespace MessageLogging::MessageLogging( bool log_messages, const std::string& message_log_path, const std::string& output_file_name, bool log_to_console, @@ -98,14 +111,13 @@ void MessageLogging::initialize() { this->html_raw_log_file = std::filesystem::path(raw_html_file_path); this->html_raw_log_os.open(html_raw_log_file, std::ofstream::app); this->rotate_log_if_needed( - this->html_raw_log_file, this->html_raw_log_os, - [this](std::ofstream& os) { this->close_html_tags(os); }, - [this](std::ofstream& os) { this->open_html_tags(os); }); + this->html_raw_log_file, this->html_raw_log_os, [this](std::ofstream& os) { close_html_tags(os); }, + [this](std::ofstream& os) { open_html_tags(os); }); - if (this->file_size(this->html_raw_log_file) > 0) { + if (safe_file_size(this->html_raw_log_file) > 0) { // TODO: try to remove the end tags in the HTML if present } else { - this->open_html_tags(this->html_raw_log_os); + open_html_tags(this->html_raw_log_os); } } html_file_path += ".html"; @@ -113,13 +125,13 @@ void MessageLogging::initialize() { this->html_log_file = std::filesystem::path(html_file_path); this->html_log_os.open(html_log_file, std::ofstream::app); this->rotate_log_if_needed( - this->html_log_file, this->html_log_os, [this](std::ofstream& os) { this->close_html_tags(os); }, - [this](std::ofstream& os) { this->open_html_tags(os); }); + this->html_log_file, this->html_log_os, [this](std::ofstream& os) { close_html_tags(os); }, + [this](std::ofstream& os) { open_html_tags(os); }); - if (this->file_size(this->html_log_file) > 0) { + if (safe_file_size(this->html_log_file) > 0) { // TODO: try to remove the end tags in the HTML if present } else { - this->open_html_tags(this->html_log_os); + open_html_tags(this->html_log_os); } } if (this->log_security) { @@ -135,7 +147,8 @@ void MessageLogging::initialize() { } } -void MessageLogging::open_html_tags(std::ofstream& os) { +namespace { +void open_html_tags(std::ofstream& os) { os << "EVerest OCPP log session\n"; os << "