OverSim
PubSubSubspaceId Class Reference

#include <PubSubSubspaceId.h>

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
idThe group ID of the new group
_maxYThe number of subspaces per row

Definition at line 43 of file PubSubSubspaceId.h.

: spaceId(id), maxY(_maxY) {};
PubSubSubspaceId::PubSubSubspaceId ( int  x,
int  y,
int  _maxY 
)
inline

Definition at line 44 of file PubSubSubspaceId.h.

: spaceId( x*_maxY + y), maxY(_maxY) {};
PubSubSubspaceId::~PubSubSubspaceId ( )
inline

Definition at line 45 of file PubSubSubspaceId.h.

{};

Member Function Documentation

int PubSubSubspaceId::getX ( ) const
inline

Definition at line 48 of file PubSubSubspaceId.h.

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

{ return (int) spaceId / maxY; }
int PubSubSubspaceId::getY ( ) const
inline

Definition at line 49 of file PubSubSubspaceId.h.

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

{ return (int) spaceId % maxY; }
bool PubSubSubspaceId::operator< ( const PubSubSubspaceId  x) const
inline

Definition at line 51 of file PubSubSubspaceId.h.

{ return spaceId < x.spaceId; }
bool PubSubSubspaceId::operator== ( const PubSubSubspaceId  x) const
inline

Definition at line 52 of file PubSubSubspaceId.h.

{ 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.

{
o << subspaceId.spaceId;
return o;
}

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: