PubSubSubspaceId Class Reference

#include <PubSubSubspaceId.h>

List of all members.

Public Member Functions

 PubSubSubspaceId (int id, int _maxY)
 Creates a new PubSubSubspace.
 PubSubSubspaceId (int x, int y, int _maxY)
 ~PubSubSubspaceId ()
int getId () const
int getX () const
int getY () const
bool operator< (const PubSubSubspaceId x) const
bool operator== (const PubSubSubspaceId x) const

Protected Attributes

int spaceId
int maxY

Friends

std::ostream & operator<< (std::ostream &, const PubSubSubspaceId &)

Detailed Description

Definition at line 30 of file PubSubSubspaceId.h.


Constructor & Destructor Documentation

PubSubSubspaceId::PubSubSubspaceId ( int  id,
int  _maxY 
) [inline]

Creates a new PubSubSubspace.

Parameters:
id The group ID of the new group
_maxY The number of subspaces per row

Definition at line 43 of file PubSubSubspaceId.h.

00043 : spaceId(id), maxY(_maxY) {};

PubSubSubspaceId::PubSubSubspaceId ( int  x,
int  y,
int  _maxY 
) [inline]

Definition at line 44 of file PubSubSubspaceId.h.

00044 : spaceId( x*_maxY + y), maxY(_maxY) {};

PubSubSubspaceId::~PubSubSubspaceId (  )  [inline]

Definition at line 45 of file PubSubSubspaceId.h.

00045 {};


Member Function Documentation

int PubSubSubspaceId::getId (  )  const [inline]
int PubSubSubspaceId::getX (  )  const [inline]

Definition at line 48 of file PubSubSubspaceId.h.

Referenced by PubSubLobby::failedNode(), and PubSubLobby::replaceResponsibleNode().

00048 { return (int) spaceId / maxY; }

int PubSubSubspaceId::getY (  )  const [inline]

Definition at line 49 of file PubSubSubspaceId.h.

Referenced by PubSubLobby::failedNode(), and PubSubLobby::replaceResponsibleNode().

00049 { return (int) spaceId % maxY; }

bool PubSubSubspaceId::operator< ( const PubSubSubspaceId  x  )  const [inline]

Definition at line 51 of file PubSubSubspaceId.h.

00051 { return spaceId < x.spaceId; }

bool PubSubSubspaceId::operator== ( const PubSubSubspaceId  x  )  const [inline]

Definition at line 52 of file PubSubSubspaceId.h.

00052 { return spaceId == x.spaceId; }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const PubSubSubspaceId subspaceId 
) [friend]

Definition at line 27 of file PubSubSubspaceId.cc.

00028 {
00029     o << subspaceId.spaceId;
00030     return o;
00031 }


Member Data Documentation

int PubSubSubspaceId::maxY [protected]

Definition at line 34 of file PubSubSubspaceId.h.

Referenced by getX(), and getY().

int PubSubSubspaceId::spaceId [protected]

Definition at line 33 of file PubSubSubspaceId.h.

Referenced by getId(), getX(), getY(), operator<(), operator<<(), and operator==().


The documentation for this class was generated from the following file:
Generated on Wed May 26 16:21:18 2010 for OverSim by  doxygen 1.6.3