CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
stor::QueueID Class Reference

#include <QueueID.h>

Public Types

typedef enquing_policy::PolicyTag PolicyType
 

Public Member Functions

size_t index () const
 
bool isValid () const
 
bool operator!= (QueueID const &other) const
 
bool operator< (QueueID const &other) const
 
bool operator== (QueueID const &other) const
 
PolicyType policy () const
 
 QueueID ()
 
 QueueID (PolicyType policy, size_t index)
 

Private Attributes

size_t index_
 
PolicyType policy_
 

Detailed Description

Uniquely identifies the consumer queues

Author:
mommsen
Revision:
1.4
Date:
2011/03/07 15:31:32

Definition at line 23 of file QueueID.h.

Member Typedef Documentation

Definition at line 27 of file QueueID.h.

Constructor & Destructor Documentation

stor::QueueID::QueueID ( )
inline

A default-constructed QueueID is invalid; it can not be used to identify an actual queue.

Definition at line 83 of file QueueID.h.

83  :
84  index_(0),
86  { }
PolicyType policy_
Definition: QueueID.h:76
size_t index_
Definition: QueueID.h:75
stor::QueueID::QueueID ( PolicyType  policy,
size_t  index 
)
inline

Create a QueueID used to identify a queue with enquing policy denoted by policy and with identifier index.

Definition at line 89 of file QueueID.h.

89  :
90  index_(index),
92  { }
size_t index() const
Definition: QueueID.h:103
PolicyType policy_
Definition: QueueID.h:76
size_t index_
Definition: QueueID.h:75
PolicyType policy() const
Definition: QueueID.h:96

Member Function Documentation

size_t stor::QueueID::index ( ) const
inline

Return the index for this queue.

Definition at line 103 of file QueueID.h.

References index_.

Referenced by BeautifulSoup.PageElement::_invert(), and stor::operator<<().

104  {
105  return index_;
106  }
size_t index_
Definition: QueueID.h:75
bool stor::QueueID::isValid ( void  ) const
inline

Test for validity of a QueueID. Invalid QueueIDs do not represent the identity of any actual queue.

Definition at line 110 of file QueueID.h.

References stor::enquing_policy::Max, and policy_.

111  {
112  return policy_ != enquing_policy::Max;
113  }
PolicyType policy_
Definition: QueueID.h:76
bool stor::QueueID::operator!= ( QueueID const &  other) const
inline

operator!= is the negation of operator==.

Definition at line 133 of file QueueID.h.

References operator==().

134  {
135  return !( operator==(other));
136  }
bool operator==(QueueID const &other) const
Definition: QueueID.h:126
bool stor::QueueID::operator< ( QueueID const &  other) const
inline

operator< induces a strict weak ordering, so that QueueID can be used as a key in std::map.

Definition at line 117 of file QueueID.h.

References index_, and policy_.

118  {
119  return policy_ == other.policy_
120  ? index_ < other.index_
121  : policy_ < other.policy_;
122  }
PolicyType policy_
Definition: QueueID.h:76
size_t index_
Definition: QueueID.h:75
bool stor::QueueID::operator== ( QueueID const &  other) const
inline

operator== returns true if both the policies and indices are equal.

Definition at line 126 of file QueueID.h.

References index_, and policy_.

Referenced by operator!=().

127  {
128  return policy_ == other.policy_ && index_ == other.index_;
129  }
PolicyType policy_
Definition: QueueID.h:76
size_t index_
Definition: QueueID.h:75
QueueID::PolicyType stor::QueueID::policy ( ) const
inline

Return the tag for the queing policy of *this.

Definition at line 96 of file QueueID.h.

References policy_.

Referenced by stor::operator<<().

97  {
98  return policy_;
99  }
PolicyType policy_
Definition: QueueID.h:76

Member Data Documentation

size_t stor::QueueID::index_
private

Definition at line 75 of file QueueID.h.

Referenced by index(), operator<(), and operator==().

PolicyType stor::QueueID::policy_
private

Definition at line 76 of file QueueID.h.

Referenced by isValid(), operator<(), operator==(), and policy().