Savarese Software Research Corporation
Protocols.h File Reference

This header defines the WSPR protocol framework. More...

#include <ssrc/wispers-packages.h>
#include <ssrc/wisp/protocol.h>
Include dependency graph for Protocols.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ServiceProtocol< protocol_, PT >

Defines

#define WSPR_SERVICE_TYPE(service_base)   "wspr.srv." #service_base
#define WSPR_EVENT_GROUP(service_base, event)   "wspr.evt." service_base "." event
#define WSPR_DEFINE_PROTOCOL(protocol_base, service_base)
#define WSPR_SERVICE_CUSTOM_TYPE(service_base)   "wspr.cust." #service_base
#define WSPR_DEFINE_CUSTOM_PROTOCOL(protocol_base, service_base)

Enumerations

enum  MessageProtocol {
  Unspecified = 0, Service = 1, Registry = 2, Log = 3,
  Session = 4, Renderer = 5, Relay = 6, WebService = 7,
  GroupSession = 8, Login = 9, Talk = 10, Documents = 11,
  Preferences = 12, Forum = 13, Issues = 14, Wiki = 15,
  Blog = 16, Notify = 17, SiteSearch = 18, Subscribe = 19,
  TextShards = 20, SimpleFS = 21, MaxReserved = 1023
}

Functions

template<NS_SSRC_WISP_PROTOCOL::wisp_message_protocol protocol_>
std::string service_type ()
std::string service_type_unknown ()
 Returns a string identifying an unnkown service type.

Detailed Description

This header defines the WSPR protocol framework.

Definition in file Protocols.h.


Define Documentation

#define WSPR_DEFINE_CUSTOM_PROTOCOL (   protocol_base,
  service_base 
)
Value:
inline std::string service_type_ ## service_base () {  \
    return WSPR_SERVICE_CUSTOM_TYPE(service_base); \
  } \
  template<NS_SSRC_WISP_PROTOCOL::wisp_message_id _id>    \
  struct Message ## protocol_base : public NS_SSRC_WISP_UTILITY::wisp_struct { \
    static_assert(static_cast<int>(protocol_base) > NS_SSRC_WSPR_PROTOCOL::MaxReserved, "protocol number out of range"); \
    enum { protocol = protocol_base }; \
    enum { id = _id }; \
    template<class Archive> \
    void serialize(Archive & ar, const unsigned int) { } \
  }

Definition at line 108 of file Protocols.h.

#define WSPR_DEFINE_PROTOCOL (   protocol_base,
  service_base 
)
Value:
template<> inline std::string service_type<protocol_base>() { \
    return WSPR_SERVICE_TYPE(service_base); \
  } \
  inline std::string service_type_ ## service_base () {  \
    return WSPR_SERVICE_TYPE(service_base); \
  } \
  template<NS_SSRC_WISP_PROTOCOL::wisp_message_id _id> \
  struct Message ## protocol_base : public NS_SSRC_WISP_UTILITY::wisp_struct { \
    static_assert(NS_SSRC_WSPR_PROTOCOL::protocol_base >= 0 &&         \
                  NS_SSRC_WSPR_PROTOCOL::protocol_base <= NS_SSRC_WSPR_PROTOCOL::MaxReserved, \
                  "protocol number out of range");                    \
    enum { protocol = NS_SSRC_WSPR_PROTOCOL::protocol_base };         \
    enum { id = _id }; \
    template<class Archive> \
    void serialize(Archive & ar, const unsigned int) { } \
  }

Definition at line 88 of file Protocols.h.

#define WSPR_EVENT_GROUP (   service_base,
  event 
)    "wspr.evt." service_base "." event
#define WSPR_SERVICE_CUSTOM_TYPE (   service_base)    "wspr.cust." #service_base

Definition at line 106 of file Protocols.h.

#define WSPR_SERVICE_TYPE (   service_base)    "wspr.srv." #service_base

Definition at line 84 of file Protocols.h.

Referenced by service_type_unknown(), and ServletRunner::ServletRunner().


Enumeration Type Documentation

Enumerator:
Unspecified 
Service 
Registry 
Log 
Session 
Renderer 
Relay 
WebService 
GroupSession 
Login 
Talk 
Documents 
Preferences 
Forum 
Issues 
Wiki 
Blog 
Notify 
SiteSearch 
Subscribe 
TextShards 
SimpleFS 
MaxReserved 

Definition at line 40 of file Protocols.h.


Function Documentation

Returns a string identifying an unnkown service type.

Returns:
A string identifying an unnkown service type.

Definition at line 125 of file Protocols.h.

References WSPR_SERVICE_TYPE.

Referenced by Registry::register_service(), Registry::service_join(), and Registry::unregister_service().


Savarese Software Research Corporation
Copyright © 2006-2011 Savarese Software Research Corporation. All rights reserved.