9#ifndef SQUID_SRC_DESCRIPTORSET_H
10#define SQUID_SRC_DESCRIPTORSET_H
28 bool has(
const int fd)
const {
45 void print(std::ostream &os)
const;
std::ostream & operator<<(std::ostream &os, const DescriptorSet &ds)
convenience wrapper to be used in debugs() context
An unordered collection of unique descriptors with O(1) add/del/has ops.
const_iterator begin() const
begin iterator a la STL; may become invalid if the object is modified
int pop()
deletes and returns one descriptor, in unspecified order
const_iterator end() const
end iterator a la STL; may become invalid if the object is modified
bool del(int fd)
deletes if there; returns true if deleted
DescriptorSet(const DescriptorSet &s)
int * index_
descriptor:position index into descriptors_
bool empty() const
number of descriptors in the set
int * descriptors_
descriptor values in random order
int size_
number of descriptors in the set
DescriptorSet & operator=(const DescriptorSet &s)
const int * const_iterator
bool has(const int fd) const
checks whether fd is in the set
void print(std::ostream &os) const
outputs debugging info about the set
int capacity_
total number of descriptor slots
bool add(int fd)
adds if unique; returns true if added