Rename struct to class (to help new C++ users who are unfamiliar that structs are classes).

This commit is contained in:
David Baird
2013-09-27 04:15:13 -06:00
parent 09c3ba8054
commit 1feac2e054
2 changed files with 9 additions and 8 deletions
+7 -7
View File
@@ -47,14 +47,10 @@ int hostname_connect(std::string hostname, int port) {
return sockfd;
}
}
namespace easywsclient {
struct _DummyWebSocket : public WebSocket
class _DummyWebSocket : public easywsclient::WebSocket
{
public:
void poll() { }
void send(std::string message) { }
void close() { }
@@ -64,8 +60,9 @@ struct _DummyWebSocket : public WebSocket
struct _RealWebSocket : public WebSocket
class _RealWebSocket : public easywsclient::WebSocket
{
public:
// http://tools.ietf.org/html/rfc6455#section-5.2 Base Framing Protocol
//
// 0 1 2 3
@@ -264,9 +261,12 @@ struct _RealWebSocket : public WebSocket
} // end of module-only namespace
namespace easywsclient {
WebSocket::pointer WebSocket::create_dummy() {
static pointer dummy = pointer(new _DummyWebSocket);
return dummy;
+2 -1
View File
@@ -12,7 +12,8 @@
namespace easywsclient {
struct WebSocket {
class WebSocket {
public:
typedef WebSocket * pointer;
typedef enum readyStateValues { CLOSING, CLOSED, CONNECTING, OPEN } readyStateValues;