diff options
author | Determinant <tederminant@gmail.com> | 2018-08-01 13:30:43 -0400 |
---|---|---|
committer | Determinant <tederminant@gmail.com> | 2018-08-01 13:30:43 -0400 |
commit | bc078abd9d5fcc420dfbcda06869a95aba39b1ea (patch) | |
tree | 41ecd1a541abd7744d18f8c118f1984bafbe75b0 /include/salticidae/conn.h | |
parent | 8c965718031f0de6401aa30579da2e10afbcaf96 (diff) |
use reference in place of pointers
Diffstat (limited to 'include/salticidae/conn.h')
-rw-r--r-- | include/salticidae/conn.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/salticidae/conn.h b/include/salticidae/conn.h index 4f17665..4cc8b11 100644 --- a/include/salticidae/conn.h +++ b/include/salticidae/conn.h @@ -147,7 +147,7 @@ class ConnPool { /** The handle to a bi-directional connection. */ using conn_t = RcObj<Conn>; /** The type of callback invoked when connection status is changed. */ - using conn_callback_t = std::function<void(Conn *)>; + using conn_callback_t = std::function<void(Conn &)>; /** Abstraction for a bi-directional connection. */ class Conn { @@ -228,15 +228,15 @@ class ConnPool { /** Called when new data is available. */ virtual void on_read() { - if (cpool->read_cb) cpool->read_cb(this); + if (cpool->read_cb) cpool->read_cb(*this); } /** Called when the underlying connection is established. */ virtual void on_setup() { - if (cpool->conn_cb) cpool->conn_cb(this); + if (cpool->conn_cb) cpool->conn_cb(*this); } /** Called when the underlying connection breaks. */ virtual void on_teardown() { - if (cpool->conn_cb) cpool->conn_cb(this); + if (cpool->conn_cb) cpool->conn_cb(*this); } }; |