Skip to content

Commit

Permalink
Added a method to check how many channels a connection has
Browse files Browse the repository at this point in the history
  • Loading branch information
Toon Schoenmakers committed Sep 10, 2015
1 parent 6f230eb commit 12af6e8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

# Compiled Dynamic libraries
*.so
*.so.*
*.dylib

# Compiled Static libraries
*.lai
*.la
*.a
*.a.*
9 changes: 9 additions & 0 deletions include/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ class Connection
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
*/
Expand Down
9 changes: 9 additions & 0 deletions include/connectionimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,15 @@ class ConnectionImpl : public Watchable
_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
*/
Expand Down

0 comments on commit 12af6e8

Please sign in to comment.