All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Classes | Typedefs | Enumerations | Functions | Variables
net Namespace Reference

Classes

class  ClientHandler
 Server side of the SimDB socket interface. This class provides the client side functions to simplify the connections creation and the messages sending/receiving. More...
 
class  DataSetRequest
 A GET or REMOVE request message. More...
 
class  GetResponse
 A response message to GET requests. A response message to GET requests is defined by the SetDescriptor and by the DataItems of the requested DataSet. More...
 
class  InsertRequest
 An INSERT request message. More...
 
class  InsertResponse
 A response message to INSERT requests. A response message to INSERT requests is simply defined through the sequence number assigned by the server to the given DataSet. More...
 
class  ProtocolHandler
 Convenience class to simplify the protocol messages handling. This class is useful to parse the "raw" message received by the server into much more handy ResponseMessage objects. It also features convenience function to create INSERT and SEARCH requests. More...
 
class  ProtocolSyntaxError
 
class  RequestMessage
 A generic request message of the protocol. More...
 
class  ResponseMessage
 A generic response message of the protocol. A response message is defined by a return code which specifies whether the request has been accepted or there has been an error. More...
 
class  SearchRequest
 A SEARCH request message. More...
 
class  SearchResponse
 A response message to SEARCH request. A response message to SEARCH requests is defined by the SetDescriptors list matching the given query parameters provided by the client. More...
 
class  ServerHandler
 Server side of the SimDB socket interface. This class provides the server side functions to simplify the incoming connections handling and the messages sending/receiving. More...
 
class  SocketHandler
 Base Class with basic convenience support for its derived classes. More...
 
class  SpeclistResponse
 A response message to SPECLIST requests. A reponse message to SPECLIST request may be negative, if no DSS are found in the system (error code 99). If some DSS is found, the response shows how may they are and their names. More...
 

Typedefs

typedef unsigned short Port
 

Enumerations

enum  SocketState {
  UNUSABLE, INACTIVE, READY, LISTENING,
  CONNECTED, DISCONNECTED
}
 
enum  Command {
  UNSPECIFIED_COMMAND, INSERT, REMOVE, GET,
  SEARCH, SPECLIST
}
 
enum  ResponseCode {
  OK, WRONG_AUTH, INCOMPLETE_SET, NO_SUCH_SPEC,
  TOO_MUCH_DATA, NO_SUCH_SET, WRONG_TYPE, UNKNOWN_NAME,
  UNKNOWN_FIELD, GENERIC_ERROR =99, UNSPECIFIED_CODE
}
 

Functions

ostream & operator<< (ostream &os, const ResponseMessage &msg)
 
ostream & operator<< (std::ostream &os, const InsertResponse &msg)
 
ostream & operator<< (ostream &os, const GetResponse &msg)
 
ostream & operator<< (ostream &os, const SearchResponse &msg)
 
ostream & operator<< (ostream &os, const SpeclistResponse &msg)
 
std::string responseCodeString (ResponseCode code)
 
ostream & operator<< (ostream &os, const RequestMessage &msg)
 
ostream & operator<< (ostream &os, const InsertRequest &msg)
 
ostream & operator<< (ostream &os, const DataSetRequest &msg)
 
ostream & operator<< (ostream &os, const SearchRequest &msg)
 
std::string commandString (Command cmd)
 

Variables

const int VALID_PORT_NUMBER = 1024
 
const std::string INSERT_CMD = "INSERT"
 
const std::string REMOVE_CMD = "REMOVE"
 
const std::string GET_CMD = "GET"
 
const std::string SEARCH_CMD = "SEARCH"
 
const std::string SPECLIST_CMD = "SPECLIST"
 
const std::string OK_CODE = "0"
 
const std::string WRONG_AUTH_CODE = "1"
 
const std::string INCOMPLETE_SET_CODE = "2"
 
const std::string NO_SUCH_SPEC_CODE = "3"
 
const std::string TOO_MUCH_DATA_CODE = "4"
 
const std::string NO_SUCH_SET_CODE = "5"
 
const std::string WRONG_TYPE_CODE = "6"
 
const std::string UNKNOWN_NAME_CODE = "7"
 
const std::string UNKNOWN_FIELD_CODE = "8"
 
const std::string GENERIC_ERROR_CODE = "99"
 
const std::string OK_MSG = "OK"
 
const std::string WRONG_AUTH_MSG = "Wrong authentication"
 
const std::string INCOMPLETE_SET_MSG = "Incomplete set"
 
const std::string NO_SUCH_SPEC_MSG = "No such specifier"
 
const std::string TOO_MUCH_DATA_MSG = "Too much data"
 
const std::string NO_SUCH_SET_MSG = "No such set"
 
const std::string WRONG_TYPE_MSG = "Wrong type"
 
const std::string UNKNOWN_NAME_MSG = "Unknown name"
 
const std::string UNKNOWN_FIELD_MSG = "Unknown field"
 
const std::string GENERIC_ERROR_MSG = "Generic error"
 
const std::string FILE_ACK = "ACK"
 
const std::string DSS_MARKER = "DSS"
 
const std::string SD_MARKER = "SD"
 
const std::string DI_MARKER = "DI"
 
const std::string DIFILES_MARKER = "DIFILES"
 
const std::string FOUND_MARKER = "FOUND"
 
const std::string SN_SPECIAL_KEY = "SequenceNumber"
 

Detailed Description

A namespace with all the necessary stuff for the SimDB network communication.

Enumeration Type Documentation

Protocol Commands enum.

Protocol Return Codes enum.

Enumerator
UNUSABLE 

Win32 WSAStartup() has failed, the host cannot use the Windows network service.

INACTIVE 

Socket not yet created.

READY 

Socket created and ready to be used.

LISTENING 

Socket in the listening state.

CONNECTED 

Socket connected.

DISCONNECTED 

Socket disconnected. The (multi-thread) server side shouldn't try to use again the thread with a new connection.

Function Documentation

string net::commandString ( Command  cmd)

Translate a request command from enum to string.

Parameters
cmdA certain request command enum value.
Returns
The relevant string for the given command.
string net::responseCodeString ( ResponseCode  code)

Translate a response code from enum to string.

Parameters
codea ResponseCode of a certain server response.
Returns
the relevant string for the given response code.

Variable Documentation

const std::string net::DSS_MARKER = "DSS"

Extra syntax element to simplify the client-server interaction while sending/receiving the files.