Documentation of the code done by Sam
This commit is contained in:
parent
407f3c5c9a
commit
3c681352da
|
@ -13,6 +13,10 @@ namespace Oyster
|
|||
class IQueue
|
||||
{
|
||||
public:
|
||||
|
||||
//---------------------------------------------
|
||||
//standard operations of the std::queue
|
||||
//---------------------------------------------
|
||||
virtual ~IQueue() {};
|
||||
virtual void Push( Type item ) = 0;
|
||||
virtual Type Pop() = 0;
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
|
||||
////////////////////////////////////////////
|
||||
// Thread safe queue implemented
|
||||
// with single linked list.
|
||||
// with single linked list and template.
|
||||
// uses mutex to lock the queue
|
||||
// otherwise its a standard queue
|
||||
// Created by Sam Svensson 2013
|
||||
/////////////////////////////////////////////
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace Oyster
|
|||
Connection( int socket ) { this->socket = socket; };
|
||||
virtual ~Connection();
|
||||
|
||||
|
||||
virtual int InitiateServer( unsigned short port );
|
||||
virtual int InitiateClient();
|
||||
|
||||
|
@ -28,6 +29,7 @@ namespace Oyster
|
|||
|
||||
virtual int Disconnect();
|
||||
virtual int Connect( unsigned short port , const char serverName[] );
|
||||
|
||||
virtual int Listen();
|
||||
|
||||
private:
|
||||
|
|
|
@ -14,13 +14,25 @@ namespace Oyster
|
|||
{
|
||||
|
||||
public:
|
||||
virtual int Disconnect() = 0;
|
||||
|
||||
//sends and recieve functions with bytearrays,
|
||||
//will send to the users connection via socket
|
||||
virtual int Send( OysterByte& bytes ) = 0;
|
||||
virtual int Recieve( OysterByte& bytes) = 0;
|
||||
|
||||
//initiates sockets and address for server and client
|
||||
virtual int InitiateServer( unsigned short port ) { return false; };
|
||||
virtual int InitiateClient() { return false; };
|
||||
|
||||
//Listen function to let client connect, only used by the server
|
||||
virtual int Listen() { return -1; };
|
||||
|
||||
//enables the client to connect with a server with use of name and port
|
||||
//(servers uses Listen instead of connect)
|
||||
virtual int Connect( unsigned short port, const char serverName[] ) { return false; };
|
||||
|
||||
//Disconnects the client or server TODO: optimize!
|
||||
virtual int Disconnect() = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Oyster
|
|||
{
|
||||
|
||||
public:
|
||||
//packs and unpacks packages for sending or recieving over the connection
|
||||
virtual void Pack (Protocols::ProtocolHeader &header, OysterByte& bytes) = 0;
|
||||
virtual void Unpack (Protocols::ProtocolSet* set, OysterByte& bytes ) = 0;
|
||||
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
#ifndef NETWORK_DEPENDENCIES_PROTOCOLS_H
|
||||
#define NETWORK_DEPENDENCIES_PROTOCOLS_H
|
||||
|
||||
//////////////////////////////////
|
||||
// Created by Sam Svensson 2013 //
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////////
|
||||
// Created by Sam Svensson 2013
|
||||
// Holder structs for our protocols
|
||||
// with the use of union.
|
||||
// each packagetyp
|
||||
// is linked to a protocol
|
||||
//////////////////////////////////////
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
Loading…
Reference in New Issue