fixed compiler warning

This commit is contained in:
Emiel Bruijntjes 2018-11-07 17:34:35 +01:00
parent 428219ad83
commit f0ad90dd65
2 changed files with 38 additions and 1 deletions

View File

@ -41,6 +41,34 @@ private:
std::cout << "connected" << std::endl; std::cout << "connected" << std::endl;
} }
/**
* Method that is called when the TCP connection ends up in a ready
* @param connection The TCP connection
*/
virtual void onReady(AMQP::TcpConnection *connection) override
{
std::cout << "ready" << std::endl;
}
/**
* Method that is called when the TCP connection is closed
* @param connection The TCP connection
*/
virtual void onClosed(AMQP::TcpConnection *connection) override
{
std::cout << "closed" << std::endl;
}
/**
* Method that is called when the TCP connection is detached
* @param connection The TCP connection
*/
virtual void onDetached(AMQP::TcpConnection *connection) override
{
std::cout << "detached" << std::endl;
}
public: public:
/** /**
* Constructor * Constructor
@ -105,7 +133,7 @@ public:
_channel(channel), _queue(std::move(queue)) _channel(channel), _queue(std::move(queue))
{ {
// initialize the libev structure // initialize the libev structure
ev_timer_init(&_timer, callback, 0.005, 0.005); ev_timer_init(&_timer, callback, 0.005, 1.005);
// this object is the data // this object is the data
_timer.data = this; _timer.data = this;
@ -169,6 +197,8 @@ int main()
// construct a timer that is going to publish stuff // construct a timer that is going to publish stuff
auto *timer = new MyTimer(loop, &channel, name); auto *timer = new MyTimer(loop, &channel, name);
//connection.close();
}); });
// run the loop // run the loop

View File

@ -22,6 +22,7 @@ namespace AMQP {
* Forward declarations * Forward declarations
*/ */
class TcpState; class TcpState;
class TcpChannel;
/** /**
* Class definition * Class definition
@ -51,6 +52,12 @@ private:
*/ */
Connection _connection; Connection _connection;
/**
* The channel may access out _connection
* @friend
*/
friend TcpChannel;
/** /**
* Method that is called when the heartbeat frequency is negotiated. * Method that is called when the heartbeat frequency is negotiated.