From 976e948cb03db87725504f600b97a4c7bcdfb217 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Fri, 11 May 2018 11:58:55 +0200 Subject: [PATCH] added comments --- include/amqpcpp/bytebuffer.h | 5 ++++- include/amqpcpp/connectionhandler.h | 26 ++++++++++++++++++++------ include/amqpcpp/deferred.h | 18 +++++++++++++----- include/amqpcpp/frame.h | 3 ++- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/include/amqpcpp/bytebuffer.h b/include/amqpcpp/bytebuffer.h index a20851c..eaedbd0 100644 --- a/include/amqpcpp/bytebuffer.h +++ b/include/amqpcpp/bytebuffer.h @@ -5,7 +5,7 @@ * around a buffer of bytes * * @author Emiel Bruijntjes - * @copyright 2014 Copernica BV + * @copyright 2014 - 2018 Copernica BV */ /** @@ -114,7 +114,10 @@ public: */ virtual const char *data(size_t pos, size_t size) const override { + // make sure compilers dont complain about unused parameters (void) size; + + // expose the data return _data + pos; } diff --git a/include/amqpcpp/connectionhandler.h b/include/amqpcpp/connectionhandler.h index 17c46cf..41915f1 100644 --- a/include/amqpcpp/connectionhandler.h +++ b/include/amqpcpp/connectionhandler.h @@ -6,7 +6,7 @@ * of methods that are called when data needs to be sent, or when the * AMQP connection ends up in a broken state. * - * @copyright 2014 Copernica BV + * @copyright 2014 - 2018 Copernica BV */ /** @@ -62,9 +62,11 @@ public: */ virtual uint16_t onNegotiate(Connection *connection, uint16_t interval) { - // default implementation, disable heartbeats + // make sure compilers dont complain about unused parameters (void) connection; (void) interval; + + // default implementation, disable heartbeats return 0; } @@ -90,7 +92,11 @@ public: * * @param connection The connection over which the heartbeat was received */ - virtual void onHeartbeat(Connection *connection) { (void) connection; } + virtual void onHeartbeat(Connection *connection) + { + // make sure compilers dont complain about unused parameters + (void) connection; + } /** * When the connection ends up in an error state this method is called. @@ -108,6 +114,7 @@ public: */ virtual void onError(Connection *connection, const char *message) { + // make sure compilers dont complain about unused parameters (void) connection; (void) message; } @@ -126,7 +133,11 @@ public: * * @param connection The connection that can now be used */ - virtual void onConnected(Connection *connection) { (void) connection; } + virtual void onConnected(Connection *connection) + { + // make sure compilers dont complain about unused parameters + (void) connection; + } /** * Method that is called when the connection was closed. @@ -136,8 +147,11 @@ public: * * @param connection The connection that was closed and that is now unusable */ - virtual void onClosed(Connection *connection) { (void) connection; } - + virtual void onClosed(Connection *connection) + { + // make sure compilers dont complain about unused parameters + (void) connection; + } }; /** diff --git a/include/amqpcpp/deferred.h b/include/amqpcpp/deferred.h index ee59f0d..89ed49e 100644 --- a/include/amqpcpp/deferred.h +++ b/include/amqpcpp/deferred.h @@ -5,7 +5,7 @@ * possibly happen in the future that can be * caught. * - * @copyright 2014 Copernica BV + * @copyright 2014 - 2018 Copernica BV */ /** @@ -97,10 +97,12 @@ protected: */ virtual const std::shared_ptr &reportSuccess(const std::string &name, uint32_t messagecount, uint32_t consumercount) const { - // this is the same as a regular success message + // make sure compilers dont complain about unused parameters (void) name; (void) messagecount; (void) consumercount; + + // this is the same as a regular success message return reportSuccess(); } @@ -111,8 +113,10 @@ protected: */ virtual const std::shared_ptr &reportSuccess(uint32_t messagecount) const { - // this is the same as a regular success message + // make sure compilers dont complain about unused parameters (void) messagecount; + + // this is the same as a regular success message return reportSuccess(); } @@ -125,10 +129,12 @@ protected: */ virtual const std::shared_ptr &reportSuccess(uint32_t messagecount, uint64_t deliveryTag, bool redelivered) { - // this is the same as a regular success message + // make sure compilers dont complain about unused parameters (void) messagecount; (void) deliveryTag; (void) redelivered; + + // this is the same as a regular success message return reportSuccess(); } @@ -139,8 +145,10 @@ protected: */ virtual const std::shared_ptr &reportSuccess(const std::string &name) { - // this is the same as a regular success message + // make sure compilers dont complain about unused parameters (void) name; + + // this is the same as a regular success message return reportSuccess(); } diff --git a/include/amqpcpp/frame.h b/include/amqpcpp/frame.h index 75ab438..d52eecb 100644 --- a/include/amqpcpp/frame.h +++ b/include/amqpcpp/frame.h @@ -4,7 +4,7 @@ * Base class for frames. This base class can not be constructed from outside * the library, and is only used internally. * - * @copyright 2014 Copernica BV + * @copyright 2014 - 2018 Copernica BV */ /** @@ -90,6 +90,7 @@ public: */ virtual bool process(ConnectionImpl *connection) { + // make sure compilers dont complain about unused parameters (void) connection; // this is an exception