From 12af6e854aeff6c0e16211961711afee7e192377 Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Thu, 10 Sep 2015 14:33:25 +0200 Subject: [PATCH] Added a method to check how many channels a connection has --- .gitignore | 2 ++ include/connection.h | 9 +++++++++ include/connectionimpl.h | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/.gitignore b/.gitignore index 620d3dc..4a62ba7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,11 @@ # Compiled Dynamic libraries *.so +*.so.* *.dylib # Compiled Static libraries *.lai *.la *.a +*.a.* diff --git a/include/connection.h b/include/connection.h index 599ff01..64e63e1 100644 --- a/include/connection.h +++ b/include/connection.h @@ -144,6 +144,15 @@ public: return _implementation.close(); } + /** + * Retrieve the amount of channels this connection has + * @return std::size_t + */ + std::size_t channels() const + { + return _implementation.channels(); + } + /** * Some classes have access to private properties */ diff --git a/include/connectionimpl.h b/include/connectionimpl.h index ccd1509..ced61dd 100644 --- a/include/connectionimpl.h +++ b/include/connectionimpl.h @@ -333,6 +333,15 @@ public: _handler->onClosed(_parent); } + /** + * Retrieve the amount of channels this connection has + * @return std::size_t + */ + std::size_t channels() const + { + return _channels.size(); + } + /** * The actual connection is a friend and can construct this class */