This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
SDi-STOMP/stomp.h
2023-11-29 11:53:20 +01:00

36 lines
1009 B
C++

#ifndef STOMP_H
#define STOMP_H
#include <QObject>
#include "interface/iStompSubject.h"
#define MAX_OBSERVER 5
class Stomp : public QObject, public interface::iStompSubject{
public:
Stomp();
// iStompSubject interface
public:
bool subscribe(interface::iStompObserver* obs);
void unsubscribe(interface::iStompObserver* obs);
void connectRequest(QString host, int port, QString vhost, QString username, QString password);
void sendRequest(QString destination, QString body);
void subscribeRequest(QString destination, int id);
void disconnectRequest();
protected:
void notifyConnectConfirmation(bool success, int version);
void notifySendConfirmation(bool success);
void notifySubscribeConfirmation(bool success);
void notifyReceiveIndication(int id, QString destination, QString body);
void notifyDisconnectConfirmation();
void notifyDisconnectIndication();
protected:
interface::iStompObserver* observer_[MAX_OBSERVER];
};
#endif // STOMP_H