]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/DescriptorSet.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / DescriptorSet.h
index 44846c7c6b23511fa5651ef349be3bbfbaa0ed2d..3079c03b8466abd1ad57f09c6b425cc69fbf5f9b 100644 (file)
@@ -1,15 +1,22 @@
+/*
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef SQUID_DESCRIPTOR_SET_H
 #define SQUID_DESCRIPTOR_SET_H
 
-#include "squid.h"
-
-/** \ingroup Comm
+#include <iosfwd>
 
-    \todo: Should we use std::set<int> with its flexibility? Our implementation
+/* 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 */
-class DescriptorSet {
+*/
+/// An unordered collection of unique descriptors with O(1) add/del/has ops
+class DescriptorSet
+{
 public:
     // for STL compatibility, should we decide to switch to std::set or similar
     typedef const int *const_iterator;
@@ -18,8 +25,10 @@ public:
     ~DescriptorSet();
 
     /// checks whether fd is in the set
-    bool has(const int fd) const { return 0 <= fd && fd < capacity_ &&
-        index_[fd] >= 0; }
+    bool has(const int fd) const {
+        return 0 <= fd && fd < capacity_ &&
+               index_[fd] >= 0;
+    }
 
     bool add(int fd); ///< adds if unique; returns true if added
     bool del(int fd); ///< deletes if there; returns true if deleted