Savarese Software Research Corporation
group_session/protocol.h File Reference

This header defines the GroupSession messaging protocol. More...

#include <ssrc/wispers/protocol.h>
#include <ssrc/wispers/utility/Properties.h>
#include <ssrc/wispers/utility/ToString.h>
#include <ssrc/wispers/group_session/types.h>
#include <boost/serialization/utility.hpp>
Include dependency graph for group_session/protocol.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GroupSessionProtocol
struct  GroupSessionProtocol::MessageCreateGroupSession
struct  GroupSessionProtocol::MessageCreateReservation
class  GSToGroup
 GSToGroup is a utility class for deriving the group name for a group session service based on the provided gsid or protocol and/or partition id. More...

Typedefs

typedef std::vector< gsid_typegsid_container
typedef std::vector< uid_typeuid_container
typedef std::vector< GroupSessiongroup_session_container
typedef std::vector< Reservation > reservation_container
typedef std::vector< Member > member_container

Functions

__BEGIN_NS_SSRC_WSPR_PROTOCOL WSPR_DEFINE_PROTOCOL (GroupSession, group_session)
template<typename session_type >
void bind_group_session_properties (const session_type &session, Properties &node)
 Binds the public properties of a GroupSession instance to a Properties node for use with a WebServiceEvent.
gsid_type gsid_min (const wisp_message_protocol protocol)
 Returns the minimum gsid value associated with the specified protocol.
gsid_type gsid_max (const wisp_message_protocol protocol)
 Returns the maximum gsid value associated with the specified protocol.
gsid_type gsid_min (const wisp_message_protocol protocol, const unsigned int partition_id, const unsigned int num_partitions)
 Returns the minimum gsid value associated with a partition of the specified protocol.
gsid_type gsid_max (const wisp_message_protocol protocol, const unsigned int partition_id, const unsigned int num_partitions)
 Returns the maximum gsid value associated with a partition of the specified protocol.
wisp_message_protocol gsid_to_protocol (const gsid_type gsid)
 Returns the protocol number that a specified gsid belongs to.
unsigned int gsid_to_protocol_partition (gsid_type gsid, const unsigned int num_partitions)
 Returns the protocol partition number associated with a given gsid for a protocol with a specified number of partitions.
string gs_protocol_group (const wisp_message_protocol protocol)
 Returns the group name reserved for group session services for a protocol.
string gs_protocol_partition_group (const wisp_message_protocol protocol, const unsigned int partition_id)
 Returns the group name reserved for the single group session service responsible for a partition of a protocol.
string gsid_protocol_group (const gsid_type gsid)
 Returns the protocol group name reserved for the group sessions services for the protocol associated with the specified gsid.

Detailed Description

This header defines the GroupSession messaging protocol.

Definition in file group_session/protocol.h.


Typedef Documentation

typedef std::vector<GroupSession> group_session_container

Definition at line 49 of file group_session/protocol.h.

typedef std::vector<gsid_type> gsid_container

Definition at line 47 of file group_session/protocol.h.

typedef std::vector<Member> member_container

Definition at line 51 of file group_session/protocol.h.

typedef std::vector<Reservation> reservation_container

Definition at line 50 of file group_session/protocol.h.

typedef std::vector<uid_type> uid_container

Definition at line 48 of file group_session/protocol.h.


Function Documentation

template<typename session_type >
void bind_group_session_properties ( const session_type &  session,
Properties node 
) [inline]

Binds the public properties of a GroupSession instance to a Properties node for use with a WebServiceEvent.

You should use this function instead of visit(BindProperties(node)) to avoid leaking internal information such as the session group name.

Parameters:
sessionThe GroupSession to bind.
nodeThe Properties node that will store the session properties.

Definition at line 379 of file group_session/protocol.h.

References Properties::set().

Referenced by process_find_group_sessions_result().

string gs_protocol_group ( const wisp_message_protocol  protocol) [inline]

Returns the group name reserved for group session services for a protocol.

The format for the group is wspr.gs.protocol.N where N is the protocol number.

Parameters:
protocolThe protocol number.
Returns:
The group name reserved for group session services for the specified protocol.

Definition at line 555 of file group_session/protocol.h.

References GSToGroup::gs_protocol_group().

Referenced by GroupSessionService::transition().

string gs_protocol_partition_group ( const wisp_message_protocol  protocol,
const unsigned int  partition_id 
) [inline]

Returns the group name reserved for the single group session service responsible for a partition of a protocol.

The format for the group is wspr.gs.protocol.N.M where N is the protocol number and M is the partition number..

Parameters:
protocolThe protocol number.
partition_idThe parition number.
Returns:
The group name reserved for the single group session service responsible for the specified partition of a protocol.

Definition at line 572 of file group_session/protocol.h.

References GSToGroup::gs_protocol_partition_group().

Referenced by GroupSessionService::transition().

gsid_type gsid_max ( const wisp_message_protocol  protocol) [inline]

Returns the maximum gsid value associated with the specified protocol.

Parameters:
protocolA Wispers protocol number.
Returns:
The maximum gsid value associated with the specified protocol.

Definition at line 407 of file group_session/protocol.h.

References GroupSessionProtocol::GSIDMin, and GroupSessionProtocol::GSIDSpace.

Referenced by gsid_max().

gsid_type gsid_max ( const wisp_message_protocol  protocol,
const unsigned int  partition_id,
const unsigned int  num_partitions 
) [inline]

Returns the maximum gsid value associated with a partition of the specified protocol.

Parameters:
protocolA Wispers protocol number.
partition_idThe partiion number (0 to num_partions - 1).
num_partitionsThe number of partitions the protocol has been divided into.
Returns:
The maximum gsid value associated with a partition of the specified protocol.

Definition at line 445 of file group_session/protocol.h.

References gsid_max(), and gsid_min().

gsid_type gsid_min ( const wisp_message_protocol  protocol) [inline]

Returns the minimum gsid value associated with the specified protocol.

Parameters:
protocolA Wispers protocol number.
Returns:
The minimum gsid value associated with the specified protocol.

Definition at line 395 of file group_session/protocol.h.

References GroupSessionProtocol::GSIDMin, and GroupSessionProtocol::GSIDSpace.

Referenced by gsid_max(), gsid_min(), and gsid_to_protocol_partition().

gsid_type gsid_min ( const wisp_message_protocol  protocol,
const unsigned int  partition_id,
const unsigned int  num_partitions 
) [inline]

Returns the minimum gsid value associated with a partition of the specified protocol.

Parameters:
protocolA Wispers protocol number.
partition_idThe partiion number (0 to num_partions - 1).
num_partitionsThe number of partitions the protocol has been divided into.
Returns:
The minimum gsid value associated with a partition of the specified protocol.

Definition at line 424 of file group_session/protocol.h.

References gsid_min(), and GroupSessionProtocol::GSIDSpace.

string gsid_protocol_group ( const gsid_type  gsid) [inline]

Returns the protocol group name reserved for the group sessions services for the protocol associated with the specified gsid.

Parameters:
gsidThe group session id.
Returns:
The protocol group name reserved for the group sessions services for the protocol associated with the specified gsid.

Definition at line 587 of file group_session/protocol.h.

References GSToGroup::gsid_protocol_group().

wisp_message_protocol gsid_to_protocol ( const gsid_type  gsid) [inline]

Returns the protocol number that a specified gsid belongs to.

Parameters:
gsid_typeThe gsid to convert.
Returns:
The protocol number that a specified gsid belongs to.

Definition at line 462 of file group_session/protocol.h.

References GroupSessionProtocol::GSIDMin, and GroupSessionProtocol::GSIDSpace.

Referenced by GSToGroup::gsid_protocol_group(), and gsid_to_protocol_partition().

unsigned int gsid_to_protocol_partition ( gsid_type  gsid,
const unsigned int  num_partitions 
) [inline]

Returns the protocol partition number associated with a given gsid for a protocol with a specified number of partitions.

Parameters:
gsidThe gsid to convert.
num_partitionsThe number of partitions.
Returns:
The protocol partition number associated with a given gsid.

Definition at line 489 of file group_session/protocol.h.

References gsid(), gsid_min(), gsid_to_protocol(), and GroupSessionProtocol::GSIDSpace.


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