2012-04-02 08:56:30 +02:00
|
|
|
#ifndef JSONRPCCLIENT_H
|
|
|
|
#define JSONRPCCLIENT_H
|
2012-03-28 13:24:49 +02:00
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
|
|
|
struct NewMessageEventArgs : public EventArgs
|
|
|
|
{
|
|
|
|
typedef shared_ptr<NewMessageEventArgs> RefType;
|
|
|
|
typedef weak_ptr<NewMessageEventArgs> WeakRefType;
|
|
|
|
|
|
|
|
JsonRpcMessage::RefType Message;
|
|
|
|
};
|
|
|
|
|
|
|
|
class JsonRpcClient : public TCPClient
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
int DataAvailableHandler(EventArgs::RefType ea);
|
|
|
|
|
|
|
|
public:
|
|
|
|
typedef shared_ptr<JsonRpcClient> RefType;
|
|
|
|
typedef weak_ptr<JsonRpcClient> WeakRefType;
|
|
|
|
|
|
|
|
void SendMessage(JsonRpcMessage::RefType message);
|
|
|
|
|
|
|
|
virtual void Start(void);
|
|
|
|
|
|
|
|
event<NewMessageEventArgs::RefType> OnNewMessage;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-04-02 08:56:30 +02:00
|
|
|
#endif /* JSONRPCCLIENT_H */
|