?
This commit is contained in:
1 parent
fd70c79282
commit
db199eaec3
218 files changed
+15584
-295
No files matched your search
@@ -0,0 +1,49 @@
|
||||
#ifndef __Subscription_h__
|
||||
#define __Subscription_h__
|
||||
|
||||
#include "SubscriptionHandler.h"
|
||||
#include "ZString.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace core
|
||||
{
|
||||
|
||||
class TCPSession;
|
||||
|
||||
class Subscription
|
||||
{
|
||||
|
||||
public:
|
||||
Subscription(std::string id, std::string mode = "*AUTHOR");
|
||||
Subscription(std::string id, TCPSession &session, std::string mode);
|
||||
Subscription(std::string id, TCPSession &session, std::string mode, std::string handler);
|
||||
virtual ~Subscription();
|
||||
|
||||
int subscribe(TCPSession &session);
|
||||
int unsubscribe(TCPSession &session);
|
||||
|
||||
virtual int process(coreutils::ZString &request, std::stringstream &out, TCPSession &session);
|
||||
|
||||
virtual int onSubscribe(TCPSession &session);
|
||||
|
||||
int event(std::stringstream &out);
|
||||
|
||||
bool ifSubscriber(TCPSession &session);
|
||||
|
||||
void setHandler(SubscriptionHandler *handler);
|
||||
|
||||
// int processCommand(coreutils::ZString &request, TCPSession &session) override;
|
||||
|
||||
std::string id;
|
||||
std::string mode;
|
||||
TCPSession *owner;
|
||||
std::string handler;
|
||||
|
||||
SubscriptionHandler *handler;
|
||||
|
||||
std::vector<TCPSession *> subscribers;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user