diff options
author | Determinant <ted.sybil@gmail.com> | 2018-07-31 20:48:37 -0400 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2018-07-31 20:48:37 -0400 |
commit | 8c965718031f0de6401aa30579da2e10afbcaf96 (patch) | |
tree | 6dbebc5f252ad93f2b28c24768bd547ffcdde31d /include/salticidae/conn.h | |
parent | c9faab354fb314bacd9849503d8b4566a8c9ea62 (diff) |
optimize by replacing RcObj with 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 f8156ee..4f17665 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(const conn_t &)>; + 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(self()); + 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(self()); + 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(self()); + if (cpool->conn_cb) cpool->conn_cb(this); } }; |