icinga2/jsonrpc/jsonrpcclient.h

34 lines
624 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
JsonRpcMessage::Ptr 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:
int DataAvailableHandler(EventArgs::Ptr 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
void SendMessage(JsonRpcMessage::Ptr message);
2012-03-28 13:24:49 +02:00
virtual void Start(void);
Event<NewMessageEventArgs::Ptr> OnNewMessage;
2012-03-28 13:24:49 +02:00
};
}
#endif /* JSONRPCCLIENT_H */