icinga2/jsonrpc/jsonrpcclient.h

34 lines
604 B
C
Raw Normal View History

#ifndef JSONRPCCLIENT_H
#define JSONRPCCLIENT_H
2012-03-28 13:24:49 +02:00
namespace icinga
{
struct I2_JSONRPC_API NewMessageEventArgs : public EventArgs
2012-03-28 13:24:49 +02:00
{
typedef shared_ptr<NewMessageEventArgs> Ptr;
typedef weak_ptr<NewMessageEventArgs> WeakPtr;
2012-03-28 13:24:49 +02:00
2012-04-18 15:22:25 +02:00
Message Message;
2012-03-28 13:24:49 +02:00
};
class I2_JSONRPC_API JsonRpcClient : public TCPClient
2012-03-28 13:24:49 +02:00
{
private:
2012-04-18 15:22:25 +02:00
int DataAvailableHandler(const EventArgs& ea);
2012-03-28 13:24:49 +02:00
public:
typedef shared_ptr<JsonRpcClient> Ptr;
typedef weak_ptr<JsonRpcClient> WeakPtr;
2012-03-28 13:24:49 +02:00
2012-04-18 15:22:25 +02:00
void SendMessage(const Message& message);
2012-03-28 13:24:49 +02:00
virtual void Start(void);
2012-04-18 15:22:25 +02:00
Event<NewMessageEventArgs> OnNewMessage;
2012-03-28 13:24:49 +02:00
};
}
#endif /* JSONRPCCLIENT_H */