DescriptorSet Class Reference
[Comm Module]
#include <DescriptorSet.h>

Public Types | |
| typedef const int * | const_iterator |
Public Member Functions | |
| DescriptorSet () | |
| ~DescriptorSet () | |
| bool | has (const int fd) const |
| checks whether fd is in the set | |
| bool | add (int fd) |
| adds if unique; returns true if added | |
| bool | del (int fd) |
| deletes if there; returns true if deleted | |
| int | pop () |
| deletes and returns one descriptor, in unspecified order | |
| bool | empty () const |
| number of descriptors in the set | |
| const_iterator | begin () const |
| begin iterator a la STL; may become invalid if the object is modified | |
| const_iterator | end () const |
| end iterator a la STL; may become invalid if the object is modified | |
| void | print (std::ostream &os) const |
| outputs debugging info about the set | |
Private Member Functions | |
| DescriptorSet (const DescriptorSet &s) | |
| DescriptorSet & | operator= (const DescriptorSet &s) |
Private Attributes | |
| int * | descriptors_ |
| descriptor values in random order | |
| int * | index_ |
| descriptor:position index into descriptors_ | |
| int | capacity_ |
| total number of descriptor slots | |
| int | size_ |
| number of descriptors in the set | |
Detailed Description
- Todo:
- : Should we use std::set<int> with its flexibility? Our implementation has constant overhead, which is smaller than log(n) of std::set.
an unordered collection of unique descriptors with O(1) add/del/has ops
Definition at line 12 of file DescriptorSet.h.
Member Typedef Documentation
| typedef const int* DescriptorSet::const_iterator |
Definition at line 16 of file DescriptorSet.h.
Constructor & Destructor Documentation
| DescriptorSet::DescriptorSet | ( | ) |
Definition at line 10 of file DescriptorSet.cc.
References capacity_, descriptors_, i, index_, and Squid_MaxFD.
| DescriptorSet::~DescriptorSet | ( | ) |
Definition at line 24 of file DescriptorSet.cc.
References descriptors_, and index_.
| DescriptorSet::DescriptorSet | ( | const DescriptorSet & | s | ) | [private] |
Member Function Documentation
| bool DescriptorSet::add | ( | int | fd | ) |
Definition at line 32 of file DescriptorSet.cc.
References assert, capacity_, descriptors_, has(), index_, and size_.
Referenced by commStartHalfClosedMonitor().
| const_iterator DescriptorSet::begin | ( | ) | const [inline] |
Definition at line 34 of file DescriptorSet.h.
References descriptors_.
Referenced by commHalfClosedCheck(), and end().
| bool DescriptorSet::del | ( | int | fd | ) |
Definition at line 48 of file DescriptorSet.cc.
References assert, capacity_, descriptors_, empty(), has(), index_, and size_.
Referenced by commStopHalfClosedMonitor().
| bool DescriptorSet::empty | ( | ) | const [inline] |
Definition at line 31 of file DescriptorSet.h.
References size_.
Referenced by commPlanHalfClosedCheck(), del(), and pop().
| const_iterator DescriptorSet::end | ( | ) | const [inline] |
Definition at line 36 of file DescriptorSet.h.
References begin(), and size_.
Referenced by commHalfClosedCheck().
| bool DescriptorSet::has | ( | const int | fd | ) | const [inline] |
Definition at line 22 of file DescriptorSet.h.
References capacity_, and index_.
Referenced by add(), commHasHalfClosedMonitor(), and del().
| DescriptorSet& DescriptorSet::operator= | ( | const DescriptorSet & | s | ) | [private] |
| int DescriptorSet::pop | ( | ) |
ejects one descriptor in unspecified order
Definition at line 76 of file DescriptorSet.cc.
References assert, capacity_, descriptors_, empty(), index_, and size_.
| void DescriptorSet::print | ( | std::ostream & | os | ) | const |
Member Data Documentation
int DescriptorSet::capacity_ [private] |
Definition at line 48 of file DescriptorSet.h.
Referenced by add(), del(), DescriptorSet(), has(), and pop().
int* DescriptorSet::descriptors_ [private] |
Definition at line 46 of file DescriptorSet.h.
Referenced by add(), begin(), del(), DescriptorSet(), pop(), and ~DescriptorSet().
int* DescriptorSet::index_ [private] |
Definition at line 47 of file DescriptorSet.h.
Referenced by add(), del(), DescriptorSet(), has(), pop(), and ~DescriptorSet().
int DescriptorSet::size_ [private] |
The documentation for this class was generated from the following files:
- src/DescriptorSet.h
- src/DescriptorSet.cc
Search
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Help Out
- Getting Squid
- Donate
- Squid Deployment Case-Studies
Documentation
- FAQ | Wiki | Book
- Configuration Reference
- Configuration Guide - Visolve
- Configuration Examples
- Users guide
- Non-English
- Security Advisories
- More...
Support
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products
