mirror of https://github.com/axmolengine/axmol.git
task: hiding non-interface methods in the SsocketIO and SIOClient classes, adding SIOClientImpl as friend to access
This commit is contained in:
parent
126ebb888c
commit
8791c8119e
|
@ -100,16 +100,18 @@ public:
|
||||||
*/
|
*/
|
||||||
static SIOClient* connect(SocketIO::SIODelegate& delegate, const std::string& uri);
|
static SIOClient* connect(SocketIO::SIODelegate& delegate, const std::string& uri);
|
||||||
|
|
||||||
SIOClientImpl* getSocket(const std::string& uri);
|
|
||||||
void addSocket(const std::string& uri, SIOClientImpl* socket);
|
|
||||||
void removeSocket(const std::string& uri);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
static SocketIO *_inst;
|
static SocketIO *_inst;
|
||||||
|
|
||||||
Dictionary* _sockets;
|
Dictionary* _sockets;
|
||||||
|
|
||||||
|
SIOClientImpl* getSocket(const std::string& uri);
|
||||||
|
void addSocket(const std::string& uri, SIOClientImpl* socket);
|
||||||
|
void removeSocket(const std::string& uri);
|
||||||
|
|
||||||
|
friend SIOClientImpl;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//c++11 style callbacks entities will be created using CC_CALLBACK (which uses std::bind)
|
//c++11 style callbacks entities will be created using CC_CALLBACK (which uses std::bind)
|
||||||
|
@ -133,16 +135,23 @@ private:
|
||||||
|
|
||||||
EventRegistry _eventRegistry;
|
EventRegistry _eventRegistry;
|
||||||
|
|
||||||
public:
|
void fireEvent(const std::string& eventName, const std::string& data);
|
||||||
SIOClient(const std::string& host, int port, const std::string& path, SIOClientImpl* impl, SocketIO::SIODelegate& delegate);
|
|
||||||
virtual ~SIOClient(void);
|
|
||||||
|
|
||||||
SocketIO::SIODelegate* getDelegate() { return _delegate; };
|
|
||||||
|
|
||||||
void onOpen();
|
void onOpen();
|
||||||
void onConnect();
|
void onConnect();
|
||||||
void receivedDisconnect();
|
void receivedDisconnect();
|
||||||
|
|
||||||
|
friend SIOClientImpl;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SIOClient(const std::string& host, int port, const std::string& path, SIOClientImpl* impl, SocketIO::SIODelegate& delegate);
|
||||||
|
virtual ~SIOClient(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the delegate for the client
|
||||||
|
*/
|
||||||
|
SocketIO::SIODelegate* getDelegate() { return _delegate; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disconnect from the endpoint, onClose will be called on the delegate when comlpete
|
* @brief Disconnect from the endpoint, onClose will be called on the delegate when comlpete
|
||||||
*/
|
*/
|
||||||
|
@ -160,7 +169,6 @@ public:
|
||||||
* Event argument should be passed using CC_CALLBACK2(&Base::function, this)
|
* Event argument should be passed using CC_CALLBACK2(&Base::function, this)
|
||||||
*/
|
*/
|
||||||
void on(const std::string& eventName, SIOEvent e);
|
void on(const std::string& eventName, SIOEvent e);
|
||||||
void fireEvent(const std::string& eventName, const std::string& data);
|
|
||||||
|
|
||||||
inline void setTag(const char* tag)
|
inline void setTag(const char* tag)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue