]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Undo trunk r13269: "Vector refactor: move almost all clients to std::vector"
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 17 Mar 2014 23:44:19 +0000 (17:44 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 17 Mar 2014 23:44:19 +0000 (17:44 -0600)
to avoid stability issues related to std::vector migration.

61 files changed:
src/ClientDelayConfig.h
src/ConfigOption.cc
src/ConfigOption.h
src/CpuAffinityMap.cc
src/CpuAffinityMap.h
src/DelayPools.h
src/DelayTagged.h
src/DelayVector.h
src/DiskIO/DiskIOModule.cc
src/DiskIO/DiskIOModule.h
src/EventLoop.h
src/FadingCounter.h
src/FwdState.cc
src/FwdState.h
src/HttpHdrRange.cc
src/HttpHeader.cc
src/HttpHeader.h
src/HttpHeaderRange.h
src/Notes.cc
src/Notes.h
src/PeerSelectState.h
src/StoreFileSystem.cc
src/StoreFileSystem.h
src/StoreHashIndex.h
src/acl/Acl.cc
src/acl/Acl.h
src/acl/NoteData.cc
src/adaptation/AccessCheck.cc
src/adaptation/AccessCheck.h
src/adaptation/AccessRule.h
src/adaptation/Config.cc
src/adaptation/Config.h
src/adaptation/DynamicGroupCfg.h
src/adaptation/History.h
src/adaptation/Service.h
src/adaptation/ServiceGroups.h
src/adaptation/icap/Config.cc
src/adaptation/icap/Options.h
src/adaptation/icap/ServiceRep.cc
src/adaptation/icap/ServiceRep.h
src/auth/Config.h
src/auth/Scheme.cc
src/auth/Scheme.h
src/cache_cf.cc
src/client_side.cc
src/client_side_request.cc
src/comm/AcceptLimiter.cc
src/comm/AcceptLimiter.h
src/comm/forward.h
src/delay_pools.cc
src/errorpage.cc
src/esi/CustomParser.cc
src/esi/VarState.h
src/event.h
src/fs/rock/RockSwapDir.h
src/ipc/Coordinator.h
src/ipc/Kids.h
src/ipc/Queue.h
src/tests/stub_DiskIOModule.cc
src/tests/stub_libauth.cc
src/tunnel.cc

index 30cd5abcf9a40ce36e7d431d076b671d9c6e4109..d9e3c69707560b8c0435a8a5ab2dca439c47f954 100644 (file)
@@ -2,8 +2,7 @@
 #define SQUID_CLIENTDELAYCONFIG_H
 
 #include "acl/forward.h"
-
-#include <vector>
+#include "base/Vector.h"
 
 class StoreEntry;
 class ConfigParser;
@@ -22,7 +21,7 @@ public:
     int64_t highwatermark;
 };
 
-typedef std::vector<ClientDelayPool> ClientDelayPools;
+typedef Vector<ClientDelayPool> ClientDelayPools;
 
 /* represents configuration of client write limiting delay pools */
 class ClientDelayConfig
index 93f691a4a0571131fb5e30aae30a0097266dbbcf..2b771479ee8abac07e48cfef351587babb5a9c37 100644 (file)
@@ -44,7 +44,7 @@ ConfigOptionVector::~ConfigOptionVector()
 bool
 ConfigOptionVector::parse(char const *option, const char *value, int isaReconfig)
 {
-    std::vector<ConfigOption *>::iterator i = options.begin();
+    Vector<ConfigOption *>::iterator i = options.begin();
 
     while (i != options.end()) {
         if ((*i)->parse(option,value, isaReconfig))
@@ -59,7 +59,7 @@ ConfigOptionVector::parse(char const *option, const char *value, int isaReconfig
 void
 ConfigOptionVector::dump(StoreEntry * e) const
 {
-    for (std::vector<ConfigOption *>::const_iterator i = options.begin();
+    for (Vector<ConfigOption *>::const_iterator i = options.begin();
             i != options.end(); ++i)
         (*i)->dump(e);
 }
index 9ca1c00f7b6b6295f082bbccd87d0cd556521362..2016eb6b7f2a023e9c79f87447b8272ac9a0c261 100644 (file)
@@ -30,7 +30,7 @@
 #ifndef SQUID_CONFIGOPTION_H
 #define SQUID_CONFIGOPTION_H
 
-#include <vector>
+#include "base/Vector.h"
 
 class StoreEntry;
 
@@ -53,7 +53,7 @@ public:
     virtual ~ConfigOptionVector();
     virtual bool parse(char const *option, const char *value, int reconfiguring);
     virtual void dump(StoreEntry * e) const;
-    std::vector<ConfigOption *>options;
+    Vector<ConfigOption *>options;
 };
 
 template <class C>
index d4132f03657c9daa26daf9f0d058b7be2bfa209d..2d616263e847717fa7228b6c331bb0b925438976 100644 (file)
@@ -10,7 +10,7 @@
 #include "Debug.h"
 
 bool
-CpuAffinityMap::add(const std::vector<int> &aProcesses, const std::vector<int> &aCores)
+CpuAffinityMap::add(const Vector<int> &aProcesses, const Vector<int> &aCores)
 {
     if (aProcesses.size() != aCores.size())
         return false;
index e2038cfcb7097272fec713fd75611c9ae6533e63..d322573f3d60b04bf17893222f202f0b5c3246df 100644 (file)
@@ -4,7 +4,7 @@
 #ifndef SQUID_CPU_AFFINITY_MAP_H
 #define SQUID_CPU_AFFINITY_MAP_H
 
-#include <vector>
+#include "base/Vector.h"
 
 class CpuAffinitySet;
 
@@ -13,20 +13,20 @@ class CpuAffinityMap
 {
 public:
     /// append cpu_affinity_map option
-    bool add(const std::vector<int> &aProcesses, const std::vector<int> &aCores);
+    bool add(const Vector<int> &aProcesses, const Vector<int> &aCores);
 
     /// calculate CPU set for this process
     CpuAffinitySet *calculateSet(const int targetProcess) const;
 
     /// returns list of process numbers
-    const std::vector<int> &processes() const { return theProcesses; }
+    const Vector<int> &processes() const { return theProcesses; }
 
     /// returns list of cores
-    const std::vector<int> &cores() const { return theCores; }
+    const Vector<int> &cores() const { return theCores; }
 
 private:
-    std::vector<int> theProcesses; ///< list of process numbers
-    std::vector<int> theCores; ///< list of cores
+    Vector<int> theProcesses; ///< list of process numbers
+    Vector<int> theCores; ///< list of cores
 };
 
 #endif // SQUID_CPU_AFFINITY_MAP_H
index 182df498a8f74e5e60b16be6186ddcc25de0a962..f7748e262a3ceea40dd8a768496c009f661d7e9a 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef SQUID_DELAYPOOLS_H
 #define SQUID_DELAYPOOLS_H
 
-#include <vector>
+#include "base/Vector.h"
 
 class DelayPool;
 class Updateable;
@@ -75,7 +75,7 @@ private:
     static time_t LastUpdate;
     static unsigned short pools_;
     static void FreeDelayData ();
-    static std::vector<Updateable *> toUpdate;
+    static Vector<Updateable *> toUpdate;
     static void RegisterWithCacheManager(void);
 };
 
index f0c15d6a692a617ca6b294bec5e67315bc26017b..61b6e4c620ef5993ed4ca39d1150f61dc9ec1463 100644 (file)
@@ -37,6 +37,7 @@
 #if USE_DELAY_POOLS
 
 #include "auth/Gadgets.h"
+#include "base/Vector.h"
 #include "CompositePoolNode.h"
 #include "DelayBucket.h"
 #include "DelayIdComposite.h"
index 33bc2c58348470e9d11a1ceb814194ecec3a3985..f0cb9a72d657455eae1b15c19fe1aadfba9e333b 100644 (file)
@@ -72,16 +72,16 @@ private:
 
     private:
         RefCount<DelayVector> theVector;
-        std::vector<DelayIdComposite::Pointer> ids;
-        typedef std::vector<DelayIdComposite::Pointer>::iterator iterator;
-        typedef std::vector<DelayIdComposite::Pointer>::const_iterator const_iterator;
+        Vector<DelayIdComposite::Pointer> ids;
+        typedef Vector<DelayIdComposite::Pointer>::iterator iterator;
+        typedef Vector<DelayIdComposite::Pointer>::const_iterator const_iterator;
     };
 
     friend class Id;
 
-    std::vector<CompositePoolNode::Pointer> pools;
-    typedef std::vector<CompositePoolNode::Pointer>::iterator iterator;
-    typedef std::vector<CompositePoolNode::Pointer>::const_iterator const_iterator;
+    Vector<CompositePoolNode::Pointer> pools;
+    typedef Vector<CompositePoolNode::Pointer>::iterator iterator;
+    typedef Vector<CompositePoolNode::Pointer>::const_iterator const_iterator;
 };
 
 #endif /* USE_DELAY_POOLS */
index 8d151b20b75259cfa6faacc95dc34e8c39447cb5..2992f2237dd0f0acebebc6563fd052481c110a97 100644 (file)
@@ -35,7 +35,7 @@
 #include "squid.h"
 #include "DiskIOModule.h"
 
-std::vector<DiskIOModule*> *DiskIOModule::_Modules = NULL;
+Vector<DiskIOModule*> *DiskIOModule::_Modules = NULL;
 
 //DiskIOModule() : initialised (false) {}
 
@@ -70,17 +70,17 @@ DiskIOModule::ModuleAdd(DiskIOModule &instance)
     GetModules().push_back (&instance);
 }
 
-std::vector<DiskIOModule *> const &
+Vector<DiskIOModule *> const &
 DiskIOModule::Modules()
 {
     return GetModules();
 }
 
-std::vector<DiskIOModule*> &
+Vector<DiskIOModule*> &
 DiskIOModule::GetModules()
 {
     if (!_Modules)
-        _Modules = new std::vector<DiskIOModule *>;
+        _Modules = new Vector<DiskIOModule *>;
 
     return *_Modules;
 }
index a7696d5557df80b54d00952a48aaedb13a7796f5..ad05153c942482e2e5b1baf9f19ae0076bd88d4f 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef SQUID_DISKIOMODULE_H
 #define SQUID_DISKIOMODULE_H
 
-#include <vector>
+#include "base/Vector.h"
 
 /* forward decls */
 
@@ -57,9 +57,9 @@ public:
      * available module for this system.
      */
     static DiskIOModule *FindDefault();
-    static std::vector<DiskIOModule*> const &Modules();
-    typedef std::vector<DiskIOModule*>::iterator iterator;
-    typedef std::vector<DiskIOModule*>::const_iterator const_iterator;
+    static Vector<DiskIOModule*> const &Modules();
+    typedef Vector<DiskIOModule*>::iterator iterator;
+    typedef Vector<DiskIOModule*>::const_iterator const_iterator;
     DiskIOModule();
     virtual ~DiskIOModule() {}
 
@@ -78,8 +78,8 @@ protected:
     static void RegisterAllModulesWithCacheManager(void);
 
 private:
-    static std::vector<DiskIOModule*> &GetModules();
-    static std::vector<DiskIOModule*> *_Modules;
+    static Vector<DiskIOModule*> &GetModules();
+    static Vector<DiskIOModule*> *_Modules;
 };
 
 #endif /* SQUID_DISKIOMODULE_H */
index a2778f618eb5cd5000b59d3bfee13468ac099cd6..3070051053d42705f0f0be560e74cdfa417c1269 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef SQUID_EVENTLOOP_H
 #define SQUID_EVENTLOOP_H
 
-#include <vector>
+#include "base/Vector.h"
 
 #define EVENT_LOOP_TIMEOUT     1000 /* 1s timeout */
 
@@ -104,7 +104,7 @@ private:
     bool dispatchCalls();
 
     bool last_loop;
-    typedef std::vector<AsyncEngine *> engine_vector;
+    typedef Vector<AsyncEngine *> engine_vector;
     engine_vector engines;
     TimeEngine * timeService;
     AsyncEngine * primaryEngine;
index ee65f92e4dc9fa17ff3c1707b00a6869d09f793b..9430ef14f68ce0d5aa7d5e371051be4c8f8aa8d1 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_FADING_COUNTER_H
 #define SQUID_FADING_COUNTER_H
 
-#include <vector>
+#include "base/Vector.h"
 
 /// Counts events, forgetting old ones. Usefull for "3 errors/minute" limits.
 class FadingCounter
@@ -25,7 +25,7 @@ private:
     double delta; ///< sub-interval duration = horizon/precision
 
     double lastTime; ///< time of the last update
-    std::vector<int> counters; ///< events per delta (possibly stale)
+    Vector<int> counters; ///< events per delta (possibly stale)
     int total; ///< number of remembered events (possibly stale)
 };
 
index 3a8d11e82b90dbf07404562ad9a00499ad9d8eed..881cb94dad15ab2e855c3cd1a5d39530ee53c830 100644 (file)
@@ -472,7 +472,7 @@ FwdState::complete()
         entry->reset();
 
         // drop the last path off the selection list. try the next one.
-        serverDestinations.erase(serverDestinations.begin());
+        serverDestinations.shift();
         startConnectionOrFail();
 
     } else {
@@ -611,7 +611,7 @@ FwdState::retryOrBail()
         if (pconnRace == raceHappened)
             debugs(17, 4, HERE << "retrying the same destination");
         else
-            serverDestinations.erase(serverDestinations.begin()); // last one failed. try another.
+            serverDestinations.shift(); // last one failed. try another.
         startConnectionOrFail();
         return;
     }
index 88b577508899df9b3d1057adc719518f8a1ba0f3..5472b5164be55b238ef942e3aac34a358d34d0b0 100644 (file)
@@ -2,6 +2,7 @@
 #define SQUID_FORWARD_H
 
 #include "base/RefCount.h"
+#include "base/Vector.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "err_type.h"
index 541a23e1de2de62cd2dce852c351f4398eb93ccf..32d71f1fcf250e9e7d2fca5244525494737e4bcd 100644 (file)
@@ -342,7 +342,7 @@ HttpHdrRange::packInto(Packer * packer) const
 }
 
 void
-HttpHdrRange::merge (std::vector<HttpHdrRangeSpec *> &basis)
+HttpHdrRange::merge (Vector<HttpHdrRangeSpec *> &basis)
 {
     /* reset old array */
     specs.clear();
@@ -368,7 +368,7 @@ HttpHdrRange::merge (std::vector<HttpHdrRangeSpec *> &basis)
 }
 
 void
-HttpHdrRange::getCanonizedSpecs(std::vector<HttpHdrRangeSpec *> &copy)
+HttpHdrRange::getCanonizedSpecs (Vector<HttpHdrRangeSpec *> &copy)
 {
     /* canonize each entry and destroy bad ones if any */
 
@@ -379,7 +379,8 @@ HttpHdrRange::getCanonizedSpecs(std::vector<HttpHdrRangeSpec *> &copy)
             delete (*pos);
     }
 
-    debugs(64, 3, "found " << specs.size() - copy.size() << " bad specs");
+    debugs(64, 3, "HttpHdrRange::getCanonizedSpecs: found " <<
+           specs.size() - copy.size() << " bad specs");
 }
 
 #include "HttpHdrContRange.h"
@@ -410,7 +411,7 @@ HttpHdrRange::canonize (int64_t newClen)
     clen = newClen;
     debugs(64, 3, "HttpHdrRange::canonize: started with " << specs.size() <<
            " specs, clen: " << clen);
-    std::vector<HttpHdrRangeSpec*> goods;
+    Vector<HttpHdrRangeSpec*> goods;
     getCanonizedSpecs(goods);
     merge (goods);
     debugs(64, 3, "HttpHdrRange::canonize: finished with " << specs.size() <<
@@ -578,7 +579,7 @@ HttpHdrRange::contains(HttpHdrRangeSpec& r) const
 const HttpHdrRangeSpec *
 HttpHdrRangeIter::currentSpec() const
 {
-    if (pos != end)
+    if (pos.incrementable())
         return *pos;
 
     return NULL;
@@ -590,7 +591,7 @@ HttpHdrRangeIter::updateSpec()
     assert (debt_size == 0);
     assert (valid);
 
-    if (pos != end) {
+    if (pos.incrementable()) {
         debt(currentSpec()->length);
     }
 }
index 26677530c6b94258aa7c35893fb2155a448495f0..f0f3e454ea8d25bbaa1dd7fdc72ec88be583b838 100644 (file)
@@ -50,8 +50,6 @@
 #include "StrList.h"
 #include "TimeOrTag.h"
 
-#include <algorithm>
-
 /*
  * On naming conventions:
  *
@@ -889,10 +887,7 @@ HttpHeader::delAt(HttpHeaderPos pos, int &headers_deleted)
 void
 HttpHeader::compact()
 {
-    // TODO: optimize removal, or possibly make it so that's not needed.
-    std::vector<HttpHeaderEntry *>::iterator newend;
-    newend = std::remove(entries.begin(), entries.end(), static_cast<HttpHeaderEntry *>(NULL));
-    entries.resize(newend-entries.begin());
+    entries.prune(NULL);
 }
 
 /*
@@ -948,7 +943,7 @@ HttpHeader::insertEntry(HttpHeaderEntry * e)
     else
         CBIT_SET(mask, e->id);
 
-    entries.insert(entries.begin(),e);
+    entries.insert(e);
 
     /* increment header length, allow for ": " and crlf */
     len += e->name.size() + 2 + e->value.size() + 2;
index 7f08ee8a01245746be57c1190c107ba87cb0367a..8681d1aaca020564d88cb977ca5d44a9c2d693e4 100644 (file)
@@ -36,8 +36,6 @@
 #include "MemPool.h"
 #include "SquidString.h"
 
-#include <vector>
-
 /* class forward declarations */
 class HttpHdrCc;
 class HttpHdrContRange;
@@ -285,7 +283,7 @@ public:
     inline bool chunked() const; ///< whether message uses chunked Transfer-Encoding
 
     /* protected, do not use these, use interface functions instead */
-    std::vector<HttpHeaderEntry *> entries;            /**< parsed fields in raw format */
+    Vector<HttpHeaderEntry *> entries;         /**< parsed fields in raw format */
     HttpHeaderMask mask;       /**< bit set <=> entry present */
     http_hdr_owner_type owner; /**< request or reply */
     int len;                   /**< length when packed, not counting terminating null-byte */
index 2c20633e7c1fa3f31ee01d5902eeb35e8d9a0e7f..0a66b83d06328cbf9ede264efb3ef28ab864003a 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
 #ifndef SQUID_HTTPHEADERRANGE_H
 #define SQUID_HTTPHEADERRANGE_H
 
+#include "base/Vector.h"
 #include "MemPool.h"
 #include "Packer.h"
 #include "Range.h"
 #include "SquidString.h"
 
-#include <vector>
-
 class HttpReply;
 /* http byte-range-spec */
 
@@ -83,8 +83,8 @@ public:
     ~HttpHdrRange();
     HttpHdrRange &operator= (HttpHdrRange const &);
 
-    typedef std::vector<HttpHdrRangeSpec *>::iterator iterator;
-    typedef std::vector<HttpHdrRangeSpec *>::const_iterator const_iterator;
+    typedef Vector<HttpHdrRangeSpec *>::iterator iterator;
+    typedef Vector<HttpHdrRangeSpec *>::const_iterator const_iterator;
     iterator begin();
     const_iterator begin () const;
     iterator end();
@@ -103,11 +103,11 @@ public:
     int64_t lowestOffset(int64_t) const;
     bool offsetLimitExceeded(const int64_t limit) const;
     bool contains(HttpHdrRangeSpec& r) const;
-    std::vector<HttpHdrRangeSpec *> specs;
+    Vector<HttpHdrRangeSpec *> specs;
 
 private:
-    void getCanonizedSpecs (std::vector<HttpHdrRangeSpec *> &copy);
-    void merge (std::vector<HttpHdrRangeSpec *> &basis);
+    void getCanonizedSpecs (Vector<HttpHdrRangeSpec *> &copy);
+    void merge (Vector<HttpHdrRangeSpec *> &basis);
     int64_t clen;
 };
 
@@ -121,7 +121,6 @@ class HttpHdrRangeIter
 
 public:
     HttpHdrRange::iterator pos;
-    HttpHdrRange::iterator end;
     const HttpHdrRangeSpec *currentSpec() const;
     void updateSpec();
     int64_t debt() const;
index 3a93ee3e5c49814f7eecad530e7e9029cf0121bf..b35029c6b99303f39bd2a54288a8d0f6b1e6bbc1 100644 (file)
@@ -162,7 +162,7 @@ NotePairs::find(const char *noteKey) const
 {
     static String value;
     value.clean();
-    for (std::vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
+    for (Vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
         if ((*i)->name.cmp(noteKey) == 0) {
             if (value.size())
                 value.append(", ");
@@ -177,7 +177,7 @@ NotePairs::toString(const char *sep) const
 {
     static String value;
     value.clean();
-    for (std::vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
+    for (Vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
         value.append((*i)->name);
         value.append(": ");
         value.append(ConfigParser::QuoteString((*i)->value));
@@ -189,7 +189,7 @@ NotePairs::toString(const char *sep) const
 const char *
 NotePairs::findFirst(const char *noteKey) const
 {
-    for (std::vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
+    for (Vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
         if ((*i)->name.cmp(noteKey) == 0)
             return (*i)->value.termedBuf();
     }
@@ -219,7 +219,7 @@ NotePairs::addStrList(const char *key, const char *values)
 bool
 NotePairs::hasPair(const char *key, const char *value) const
 {
-    for (std::vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
+    for (Vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
         if ((*i)->name.cmp(key) == 0 && (*i)->value.cmp(value) == 0)
             return true;
     }
@@ -229,7 +229,7 @@ NotePairs::hasPair(const char *key, const char *value) const
 void
 NotePairs::append(const NotePairs *src)
 {
-    for (std::vector<NotePairs::Entry *>::const_iterator  i = src->entries.begin(); i != src->entries.end(); ++i) {
+    for (Vector<NotePairs::Entry *>::const_iterator  i = src->entries.begin(); i != src->entries.end(); ++i) {
         entries.push_back(new NotePairs::Entry((*i)->name.termedBuf(), (*i)->value.termedBuf()));
     }
 }
@@ -237,7 +237,7 @@ NotePairs::append(const NotePairs *src)
 void
 NotePairs::appendNewOnly(const NotePairs *src)
 {
-    for (std::vector<NotePairs::Entry *>::const_iterator  i = src->entries.begin(); i != src->entries.end(); ++i) {
+    for (Vector<NotePairs::Entry *>::const_iterator  i = src->entries.begin(); i != src->entries.end(); ++i) {
         if (!hasPair((*i)->name.termedBuf(), (*i)->value.termedBuf()))
             entries.push_back(new NotePairs::Entry((*i)->name.termedBuf(), (*i)->value.termedBuf()));
     }
index 274d3bb145e72cfe4c993eca10cf0978aeeb6f90..6490f5d24e5870d4e9849b7d745a2b23cacd9588 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "acl/forward.h"
 #include "base/RefCount.h"
+#include "base/Vector.h"
 #include "CbDataList.h"
 #include "format/Format.h"
 #include "MemPool.h"
@@ -10,7 +11,6 @@
 #include "typedefs.h"
 
 #include <string>
-#include <vector>
 
 class HttpRequest;
 class HttpReply;
@@ -38,7 +38,7 @@ public:
         explicit Value(const String &aVal) : value(aVal), aclList(NULL), valueFormat(NULL) {}
         ~Value();
     };
-    typedef std::vector<Value::Pointer> Values;
+    typedef Vector<Value::Pointer> Values;
 
     explicit Note(const String &aKey): key(aKey) {}
 
@@ -68,7 +68,7 @@ class ConfigParser;
 class Notes
 {
 public:
-    typedef std::vector<Note::Pointer> NotesList;
+    typedef Vector<Note::Pointer> NotesList;
     typedef NotesList::iterator iterator; ///< iterates over the notes list
     typedef NotesList::const_iterator const_iterator; ///< iterates over the notes list
 
@@ -182,7 +182,7 @@ public:
      */
     bool empty() const {return entries.empty();}
 
-    std::vector<NotePairs::Entry *> entries;     ///< The key/value pair entries
+    Vector<NotePairs::Entry *> entries;          ///< The key/value pair entries
 
 private:
     NotePairs &operator = (NotePairs const &); // Not implemented
index 3bd6bd196bd9d3ac3ed1930b8a4a70ac26576faf..f58885edec8a8386a89bbe9388de553e1489ca5a 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "AccessLogEntry.h"
 #include "acl/Checklist.h"
+#include "base/Vector.h"
 #include "cbdata.h"
 #include "comm/forward.h"
 #include "hier_code.h"
index fb73ae921c4bbb0d867591812046ec7156d4276d..293c37f4e20108fc934e2e450734c0fa7efbf8d0 100644 (file)
@@ -35,7 +35,7 @@
 #include "squid.h"
 #include "StoreFileSystem.h"
 
-std::vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = NULL;
+Vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = NULL;
 
 void
 StoreFileSystem::RegisterAllFsWithCacheManager(void)
@@ -65,17 +65,17 @@ StoreFileSystem::FsAdd(StoreFileSystem &instance)
     GetFileSystems().push_back (&instance);
 }
 
-std::vector<StoreFileSystem *> const &
+Vector<StoreFileSystem *> const &
 StoreFileSystem::FileSystems()
 {
     return GetFileSystems();
 }
 
-std::vector<StoreFileSystem*> &
+Vector<StoreFileSystem*> &
 StoreFileSystem::GetFileSystems()
 {
     if (!_FileSystems)
-        _FileSystems = new std::vector<StoreFileSystem *>;
+        _FileSystems = new Vector<StoreFileSystem *>;
 
     return *_FileSystems;
 }
index a5410b3c54229fba6edc955c8eaf742103b00cc3..81dd906bb6371f4116aa65752ac314a009e7e3fd 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef SQUID_STOREFILESYSTEM_H
 #define SQUID_STOREFILESYSTEM_H
 
-#include <vector>
+#include "base/Vector.h"
 
 /* ****** DOCUMENTATION ***** */
 
@@ -116,9 +116,9 @@ public:
     static void SetupAllFs();
     static void FsAdd(StoreFileSystem &);
     static void FreeAllFs();
-    static std::vector<StoreFileSystem*> const &FileSystems();
-    typedef std::vector<StoreFileSystem*>::iterator iterator;
-    typedef std::vector<StoreFileSystem*>::const_iterator const_iterator;
+    static Vector<StoreFileSystem*> const &FileSystems();
+    typedef Vector<StoreFileSystem*>::iterator iterator;
+    typedef Vector<StoreFileSystem*>::const_iterator const_iterator;
     StoreFileSystem() : initialised(false) {}
 
     virtual ~StoreFileSystem() {}
@@ -136,8 +136,8 @@ protected:
     virtual void registerWithCacheManager(void);
 
 private:
-    static std::vector<StoreFileSystem*> &GetFileSystems();
-    static std::vector<StoreFileSystem*> *_FileSystems;
+    static Vector<StoreFileSystem*> &GetFileSystems();
+    static Vector<StoreFileSystem*> *_FileSystems;
     static void RegisterAllFsWithCacheManager(void);
 };
 
index 22460566c72be9cac4fe130adad5896f85fa6ae8..5a33860f484ee340a0fce308cdac53023ff59f28 100644 (file)
@@ -117,7 +117,7 @@ private:
     void *cbdata;
     bool _done;
     int bucket;
-    std::vector<StoreEntry *> entries;
+    Vector<StoreEntry *> entries;
 
     // keep this last. it plays with private/public
     CBDATA_CLASS2(StoreSearchHashIndex);
index 574d66a9ed79c7d9970353c558b57eb8dcaf0b05..1e925e7542f02f858a5b91727322f478de462cc1 100644 (file)
@@ -41,8 +41,6 @@
 #include "profiler/Profiler.h"
 #include "SquidConfig.h"
 
-#include <vector>
-
 const ACLFlag ACLFlags::NoFlags[1] = {ACL_F_END};
 
 const char *AclMatchedName = NULL;
@@ -407,7 +405,7 @@ ACL::Prototype::Prototype (ACL const *aPrototype, char const *aType) : prototype
     registerMe ();
 }
 
-std::vector<ACL::Prototype const *> * ACL::Prototype::Registry;
+Vector<ACL::Prototype const *> * ACL::Prototype::Registry;
 void *ACL::Prototype::Initialized;
 
 bool
@@ -431,7 +429,7 @@ ACL::Prototype::registerMe ()
     if (!Registry || (Initialized != ((char *)Registry - 5))  ) {
         /* TODO: extract this */
         /* Not initialised */
-        Registry = new std::vector<ACL::Prototype const *>;
+        Registry = new Vector <ACL::Prototype const *>;
         Initialized = (char *)Registry - 5;
     }
 
index cbefd6423ed2e1a14243623952dc86de47b5b8bd..1fb45dbe7dbe325787c371eda418b59ee37df0de 100644 (file)
@@ -34,6 +34,7 @@
 #define SQUID_ACL_H
 
 #include "acl/forward.h"
+#include "base/Vector.h"
 #include "cbdata.h"
 #include "defines.h"
 #include "dlink.h"
@@ -41,7 +42,6 @@
 
 #include <ostream>
 #include <string>
-#include <vector>
 
 class ConfigParser;
 
@@ -153,10 +153,10 @@ public:
         char const *typeString;
 
     private:
-        static std::vector<Prototype const *> * Registry;
+        static Vector<Prototype const *> * Registry;
         static void *Initialized;
-        typedef std::vector<Prototype const*>::iterator iterator;
-        typedef std::vector<Prototype const*>::const_iterator const_iterator;
+        typedef Vector<Prototype const*>::iterator iterator;
+        typedef Vector<Prototype const*>::const_iterator const_iterator;
         void registerMe();
     };
 
index cb8b0322078b523807947341522465f8be805ee3..ab4e4cfb67197083e0e1ca32dff4b7ba51762377 100644 (file)
@@ -29,7 +29,7 @@ ACLNoteData::matchNotes(NotePairs *note)
     if (values->empty())
         return (note->findFirst(name.termedBuf()) != NULL);
 
-    for (std::vector<NotePairs::Entry *>::iterator i = note->entries.begin(); i!= note->entries.end(); ++i) {
+    for (Vector<NotePairs::Entry *>::iterator i = note->entries.begin(); i!= note->entries.end(); ++i) {
         if ((*i)->name.cmp(name.termedBuf()) == 0) {
             if (values->match((*i)->value.termedBuf()))
                 return true;
index deb36118f9d3c4e12a3b06fb15f70010dd25abe3..19ee86346bce58c48c7965165cd14aeb60e35464 100644 (file)
@@ -131,7 +131,7 @@ Adaptation::AccessCheck::checkCandidates()
             return;
         }
 
-        candidates.erase(candidates.begin()); // the rule apparently went away (reconfigure)
+        candidates.shift(); // the rule apparently went away (reconfigure)
     }
 
     debugs(93, 4, HERE << "NO candidates left");
@@ -176,7 +176,7 @@ Adaptation::AccessCheck::noteAnswer(allow_t answer)
     }
 
     // no match or the group disappeared during reconfiguration
-    candidates.erase(candidates.begin());
+    candidates.shift();
     checkCandidates();
 }
 
index ba3add39e43c1adbd5edb33c87b40e53ddcb72d7..3a931a832481bf9574500181c03c1a9feb0eee01 100644 (file)
@@ -39,7 +39,7 @@ private:
     ACLFilledChecklist *acl_checklist;
 
     typedef int Candidate;
-    typedef std::vector<Candidate> Candidates;
+    typedef Vector<Candidate> Candidates;
     Candidates candidates;
     Candidate topCandidate() const { return *candidates.begin(); }
     ServiceGroupPointer topGroup() const; // may return nil
index a8a2d1a7d62ec0bd2a0fc58ee9af87915b8646d3..9fae4ded79b1c96e2662a2158055acc35a5cbdb3 100644 (file)
@@ -5,8 +5,6 @@
 #include "adaptation/forward.h"
 #include "SquidString.h"
 
-#include <vector>
-
 class ConfigParser;
 
 namespace Adaptation
@@ -36,7 +34,7 @@ private:
     static Id LastId;
 };
 
-typedef std::vector<Adaptation::AccessRule*> AccessRules;
+typedef Vector<Adaptation::AccessRule*> AccessRules;
 AccessRules &AllRules();
 AccessRule *FindRule(const AccessRule::Id &id);
 AccessRule *FindRuleByGroupId(const String &groupId);
index 62f68c3ee5b3f6bbe688fa57b2e1e95111cae332..d133c493e61f05d32ad444d8a2b2f5ef5bf1039c 100644 (file)
 #include "adaptation/History.h"
 #include "adaptation/Service.h"
 #include "adaptation/ServiceGroups.h"
+#include "base/Vector.h"
 #include "ConfigParser.h"
 #include "globals.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
 #include "Store.h"
 
-#include <algorithm>
-
 bool Adaptation::Config::Enabled = false;
 char *Adaptation::Config::masterx_shared_name = NULL;
 int Adaptation::Config::service_iteration_limit = 16;
@@ -88,19 +87,15 @@ Adaptation::Config::removeService(const String& service)
         for (SGSI it = services.begin(); it != services.end(); ++it) {
             if (*it == service) {
                 group->removedServices.push_back(service);
-                ServiceGroup::Store::iterator newend;
-                newend = std::remove(group->services.begin(), group->services.end(), service);
-                group->services.resize(newend-group->services.begin());
-                debugs(93, 5, "adaptation service " << service <<
+                group->services.prune(service);
+                debugs(93, 5, HERE << "adaptation service " << service <<
                        " removed from group " << group->id);
                 break;
             }
         }
         if (services.empty()) {
             removeRule(group->id);
-            Groups::iterator newend;
-            newend = std::remove(AllGroups().begin(), AllGroups().end(), group);
-            AllGroups().resize(newend-AllGroups().begin());
+            AllGroups().prune(group);
         } else {
             ++i;
         }
@@ -127,10 +122,8 @@ Adaptation::Config::removeRule(const String& id)
     for (ARI it = rules.begin(); it != rules.end(); ++it) {
         AccessRule* rule = *it;
         if (rule->groupId == id) {
-            debugs(93, 5, "removing access rules for:" << id);
-            AccessRules::iterator newend;
-            newend = std::remove(AllRules().begin(), AllRules().end(), rule);
-            AllRules().resize(newend-AllRules().begin());
+            debugs(93, 5, HERE << "removing access rules for:" << id);
+            AllRules().prune(rule);
             delete (rule);
             break;
         }
index f744ad27f6d2541ff9521331c16178771a11c61e..5da85bebb79b050be52152b763ed8f724cbc38d9 100644 (file)
@@ -51,7 +51,7 @@ public:
 
     static bool needHistory; ///< HttpRequest adaptation history should recorded
 
-    typedef std::vector<ServiceConfigPointer> ServiceConfigs;
+    typedef Vector<ServiceConfigPointer> ServiceConfigs;
     ServiceConfigs serviceConfigs;
 
     Config();
index efd1523fa2ccbd7db2557e3fafb82a03a433cd9c..8f70ee4bf4eedaf9100abe608f02e5e67f9fcee7 100644 (file)
@@ -1,10 +1,9 @@
 #ifndef SQUID_ADAPTATION__DYNAMIC_GROUP_CFG_H
 #define SQUID_ADAPTATION__DYNAMIC_GROUP_CFG_H
 
+#include "base/Vector.h"
 #include "SquidString.h"
 
-#include <vector>
-
 namespace Adaptation
 {
 
@@ -12,7 +11,7 @@ namespace Adaptation
 class DynamicGroupCfg
 {
 public:
-    typedef std::vector<String> Store;
+    typedef Vector<String> Store;
     typedef String Id;
 
     Id id; ///< group id
index 614a875c9298767f36816a43f24962f915c8b0c9..b502838b89d62024f2ac73eaee3fdeb9afca1740 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "adaptation/DynamicGroupCfg.h"
 #include "base/RefCount.h"
+#include "base/Vector.h"
 #include "HttpHeader.h"
 #include "Notes.h"
 #include "SBuf.h"
@@ -56,7 +57,7 @@ public:
     /// AccessLogEntry::notes when ALE becomes available
     NotePairs::Pointer metaHeaders;
 
-    typedef std::vector<SBuf> AdaptationServices;
+    typedef Vector<SBuf> AdaptationServices;
     AdaptationServices theAdaptationServices; ///< The service groups used
 
     /// sets future services for the Adaptation::AccessCheck to notice
@@ -86,7 +87,7 @@ private:
         bool retried; ///< whether the xaction was replaced by another
     };
 
-    typedef std::vector<Entry> Entries;
+    typedef Vector<Entry> Entries;
     Entries theEntries; ///< historical record, in the order of xact starts
 
     // theXx* will become a map<string,string>, but we only support one record
index 7a020ff4d97c17802f5a71b0f1cb9aeb6820fde2..f149ce1f2fff0887f173b9171e29960b9d05e2be 100644 (file)
@@ -61,7 +61,7 @@ private:
 
 typedef Service::Pointer ServicePointer;
 
-typedef std::vector<Adaptation::ServicePointer> Services;
+typedef Vector<Adaptation::ServicePointer> Services;
 Services &AllServices();
 ServicePointer FindService(const Service::Id &key);
 
index 33d56024e14d7dd14fbfa63655cad9f41dfbeb6a..ab7bc6f711f160fc3a1456c0d0f83c04feeb3f78 100644 (file)
@@ -4,10 +4,9 @@
 #include "adaptation/Elements.h"
 #include "adaptation/forward.h"
 #include "base/RefCount.h"
+#include "base/Vector.h"
 #include "SquidString.h"
 
-#include <vector>
-
 namespace Adaptation
 {
 
@@ -18,9 +17,9 @@ class ServiceGroup: public RefCountable
 public:
     typedef RefCount<ServiceGroup> Pointer;
 
-    typedef std::vector<String> Store;
+    typedef Vector<String> Store;
     typedef String Id;
-    typedef unsigned int Pos; // vector<>::position_type
+    typedef unsigned int Pos; // Vector<>::poistion_type
     friend class ServicePlan;
 
 public:
@@ -114,7 +113,7 @@ public:
 class ServicePlan
 {
 public:
-    typedef unsigned int Pos; // vector<>::position_type
+    typedef unsigned int Pos; // Vector<>::poistion_type
 
 public:
     ServicePlan();
@@ -142,7 +141,7 @@ std::ostream &operator <<(std::ostream &os, const ServicePlan &p)
     return p.print(os);
 }
 
-typedef std::vector<ServiceGroupPointer> Groups;
+typedef Vector<ServiceGroupPointer> Groups;
 Groups &AllGroups();
 ServiceGroupPointer FindGroup(const ServiceGroup::Id &id);
 
index 74506632e08184fb7336de957b6f2aaf0e854744..d66c3f67c940a951960577d173d3a08936af3202 100644 (file)
@@ -33,6 +33,7 @@
 #include "squid.h"
 #include "adaptation/icap/Config.h"
 #include "adaptation/icap/ServiceRep.h"
+#include "base/Vector.h"
 #include "ConfigParser.h"
 #include "HttpReply.h"
 #include "HttpRequest.h"
index 0d7e96c4f3e4101740473aacbbe11719be6a225f..0a0f772cb3bd5d014c7c1f758987b11db57e23b8 100644 (file)
@@ -71,7 +71,7 @@ public:
     const char *error; // human-readable information; set iff !valid()
 
     // ICAP server MUST supply this info
-    std::vector<ICAP::Method> methods;
+    Vector<ICAP::Method> methods;
     String istag;
 
     // ICAP server MAY supply this info. If not, Squid supplies defaults.
index 4c4136c04c9826ce5da7fcec5d9c81ea9bbf27c1..ac295a767e916a0191652b98d7fdd2b725dd060f 100644 (file)
@@ -470,7 +470,7 @@ void Adaptation::Icap::ServiceRep::checkOptions()
     if (!theOptions->methods.empty()) {
         bool method_found = false;
         String method_list;
-        std::vector <ICAP::Method>::iterator iter = theOptions->methods.begin();
+        Vector <ICAP::Method>::iterator iter = theOptions->methods.begin();
 
         while (iter != theOptions->methods.end()) {
 
index 2843bff6bde1b6cff82b6d5bd46776e9b3c5bf10..fad4d76eac86dbca824275e8d9cbf52ace815994 100644 (file)
@@ -140,7 +140,7 @@ private:
         AsyncCall::Pointer callback;
     };
 
-    typedef std::vector<Client> Clients;
+    typedef Vector<Client> Clients;
     // TODO: rename to theUpWaiters
     Clients theClients; // all clients waiting for a call back
 
index ad4da18ab9b527751a0bf0fbe3ff36f9c97a480c..aa731adfa3e5d5eea410632312de8b59ac09ba2e 100644 (file)
@@ -150,7 +150,7 @@ public:
     Format::Format *keyExtras; ///< The compiled request format
 };
 
-typedef std::vector<Config *> ConfigVector;
+typedef Vector<Config *> ConfigVector;
 
 extern ConfigVector TheConfig;
 
index 996f1908d16505d6dfb6eb8280a83ca75e7a311d..bce72370c424505ddd90bf83f4bfc2220bd57920 100644 (file)
@@ -37,7 +37,7 @@
 #include "auth/Scheme.h"
 #include "globals.h"
 
-std::vector<Auth::Scheme::Pointer> *Auth::Scheme::_Schemes = NULL;
+Vector<Auth::Scheme::Pointer> *Auth::Scheme::_Schemes = NULL;
 
 void
 Auth::Scheme::AddScheme(Auth::Scheme::Pointer instance)
@@ -63,11 +63,11 @@ Auth::Scheme::Find(const char *typestr)
     return Auth::Scheme::Pointer(NULL);
 }
 
-std::vector<Auth::Scheme::Pointer> &
+Vector<Auth::Scheme::Pointer> &
 Auth::Scheme::GetSchemes()
 {
     if (!_Schemes)
-        _Schemes = new std::vector<Auth::Scheme::Pointer>;
+        _Schemes = new Vector<Auth::Scheme::Pointer>;
 
     return *_Schemes;
 }
index 19d592a3751bebb62b365ce6fe65fa7010f528c3..f5d22fa01f87c81a61e7b35f24c19be39d5382cf 100644 (file)
@@ -34,8 +34,7 @@
 #if USE_AUTH
 
 #include "base/RefCount.h"
-
-#include <vector>
+#include "base/Vector.h"
 
 /**
  \defgroup AuthSchemeAPI       Authentication Scheme API
@@ -61,8 +60,8 @@ class Scheme : public RefCountable
 {
 public:
     typedef RefCount<Scheme> Pointer;
-    typedef std::vector<Scheme::Pointer>::iterator iterator;
-    typedef std::vector<Scheme::Pointer>::const_iterator const_iterator;
+    typedef Vector<Scheme::Pointer>::iterator iterator;
+    typedef Vector<Scheme::Pointer>::const_iterator const_iterator;
 
 public:
     Scheme() : initialised (false) {};
@@ -94,13 +93,13 @@ public:
     Scheme(Scheme const &);
     Scheme &operator=(Scheme const&);
 
-    static std::vector<Scheme::Pointer> &GetSchemes();
+    static Vector<Scheme::Pointer> &GetSchemes();
 
 protected:
     bool initialised;
 
 private:
-    static std::vector<Scheme::Pointer> *_Schemes;
+    static Vector<Scheme::Pointer> *_Schemes;
 };
 
 } // namespace Auth
index caf65c1ad46485780a5769a257b1ca32ece53515..7e24e9206d5e160559b9431fb8293d4bb35f93d0 100644 (file)
@@ -246,7 +246,7 @@ static void free_sslproxy_ssl_bump(acl_access **ssl_bump);
 static void parse_b_size_t(size_t * var);
 static void parse_b_int64_t(int64_t * var);
 
-static bool parseNamedIntList(const char *data, const String &name, std::vector<int> &list);
+static bool parseNamedIntList(const char *data, const String &name, Vector<int> &list);
 
 static void parse_CpuAffinityMap(CpuAffinityMap **const cpuAffinityMap);
 static void dump_CpuAffinityMap(StoreEntry *const entry, const char *const name, const CpuAffinityMap *const cpuAffinityMap);
@@ -486,7 +486,7 @@ parseOneConfigFile(const char *file_name, unsigned int depth)
 
     config_lineno = 0;
 
-    std::vector<bool> if_states;
+    Vector<bool> if_states;
     while (fgets(config_input_line, BUFSIZ, fp)) {
         ++config_lineno;
 
@@ -4272,7 +4272,7 @@ free_access_log(CustomLog ** definitions)
 
 /// parses list of integers form name=N1,N2,N3,...
 static bool
-parseNamedIntList(const char *data, const String &name, std::vector<int> &list)
+parseNamedIntList(const char *data, const String &name, Vector<int> &list)
 {
     if (data && (strncmp(data, name.rawBuf(), name.size()) == 0)) {
         data += name.size();
@@ -4305,7 +4305,7 @@ parse_CpuAffinityMap(CpuAffinityMap **const cpuAffinityMap)
 
     const char *const pToken = ConfigParser::NextToken();
     const char *const cToken = ConfigParser::NextToken();
-    std::vector<int> processes, cores;
+    Vector<int> processes, cores;
     if (!parseNamedIntList(pToken, "process_numbers", processes)) {
         debugs(3, DBG_CRITICAL, "FATAL: bad 'process_numbers' parameter " <<
                "in 'cpu_affinity_map'");
index a0f95eed00c021e5d6412bb98bc17432b79d511b..df1fdb8eed417bdfaee8cb8bfc2448af6243d8dc 100644 (file)
@@ -1705,7 +1705,7 @@ ClientSocketContext::canPackMoreRanges() const
     if (!http->range_iter.debt()) {
         debugs(33, 5, HERE << "At end of current range spec for " << clientConnection);
 
-        if (http->range_iter.pos != http->range_iter.end)
+        if (http->range_iter.pos.incrementable())
             ++http->range_iter.pos;
 
         http->range_iter.updateSpec();
index b2f2beb8f2d82887d6bf9d533344b2ea4e7fa3ce..3125b1e2cae05769852e2de54f61693ac0fce4eb 100644 (file)
@@ -1140,7 +1140,6 @@ clientInterpretRequestHeaders(ClientHttpRequest * http)
              */
             node->readBuffer.offset = request->range->lowestOffset(0);
             http->range_iter.pos = request->range->begin();
-            http->range_iter.end = request->range->end();
             http->range_iter.valid = true;
         }
     }
index 6e144f9308f8284f8246cd03cbfcfaead345af89..7af4beaaf82eb058757adf917fbea30184ded9c5 100644 (file)
@@ -47,8 +47,7 @@ Comm::AcceptLimiter::kick()
     debugs(5, 5, "size=" << deferred_.size());
     while (deferred_.size() > 0 && fdNFree() >= RESERVED_FD) {
         /* NP: shift() is equivalent to pop_front(). Giving us a FIFO queue. */
-        TcpAcceptor::Pointer temp = deferred_.front();
-        deferred_.erase(deferred_.begin());
+        TcpAcceptor::Pointer temp = deferred_.shift();
         if (temp.valid()) {
             debugs(5, 5, "doing one.");
             -- temp->isLimited;
index d6c28f3cb6398c06fb3a408d37495ecc86fa23b1..50689efaed27d57f44a15901986bf4ac6496c96e 100644 (file)
@@ -1,10 +1,9 @@
 #ifndef _SQUID_SRC_COMM_ACCEPT_LIMITER_H
 #define _SQUID_SRC_COMM_ACCEPT_LIMITER_H
 
+#include "base/Vector.h"
 #include "comm/TcpAcceptor.h"
 
-#include <vector>
-
 namespace Comm
 {
 
@@ -25,7 +24,7 @@ namespace Comm
  * or to NULL an entry while scanning the list for empty spaces.
  * Side effect: TcpAcceptor->kick() becomes allowed to pull off multiple accept()'s in bunches
  *
- * 2) re-implement as a std::queue instead of std::vector
+ * 2) re-implement as a list instead of vector?
  * storing head/tail pointers for fast push/pop and avoiding the whole shift() overhead
  */
 class AcceptLimiter
@@ -48,7 +47,7 @@ private:
     static AcceptLimiter Instance_;
 
     /** FIFO queue */
-    std::vector<TcpAcceptor::Pointer> deferred_;
+    Vector<TcpAcceptor::Pointer> deferred_;
 };
 
 }; // namepace Comm
index caa4e2c6b8ed1a096cd303a4f311de71d4dc5a57..711c546814edeedb0b378b3fcc5f2a8d120bde9e 100644 (file)
@@ -2,8 +2,7 @@
 #define _SQUID_COMM_FORWARD_H
 
 #include "base/RefCount.h"
-
-#include <vector>
+#include "base/Vector.h"
 
 namespace Comm
 {
@@ -12,7 +11,7 @@ class Connection;
 
 typedef RefCount<Comm::Connection> ConnectionPointer;
 
-typedef std::vector<Comm::ConnectionPointer> ConnectionList;
+typedef Vector<Comm::ConnectionPointer> ConnectionList;
 
 bool IsConnOpen(const Comm::ConnectionPointer &conn);
 
index 78b7628946f1160402df0f5f9cce0301384b6c10..96489686ebfcc56782088ca33b246457bc174315 100644 (file)
@@ -42,6 +42,7 @@
 #include "squid.h"
 
 #if USE_DELAY_POOLS
+#include "base/Vector.h"
 #include "client_side_request.h"
 #include "comm/Connection.h"
 #include "CommonPool.h"
@@ -591,7 +592,7 @@ DelayPools::Update(void *unused)
 
     LastUpdate = squid_curtime;
 
-    std::vector<Updateable *>::iterator pos = toUpdate.begin();
+    Vector<Updateable *>::iterator pos = toUpdate.begin();
 
     while (pos != toUpdate.end()) {
         (*pos)->update(incr);
@@ -609,7 +610,7 @@ DelayPools::registerForUpdates(Updateable *anObject)
 void
 DelayPools::deregisterForUpdates (Updateable *anObject)
 {
-    std::vector<Updateable *>::iterator pos = toUpdate.begin();
+    Vector<Updateable *>::iterator pos = toUpdate.begin();
 
     while (pos != toUpdate.end() && *pos != anObject) {
         ++pos;
@@ -617,7 +618,7 @@ DelayPools::deregisterForUpdates (Updateable *anObject)
 
     if (pos != toUpdate.end()) {
         /* move all objects down one */
-        std::vector<Updateable *>::iterator temp = pos;
+        Vector<Updateable *>::iterator temp = pos;
         ++pos;
 
         while (pos != toUpdate.end()) {
@@ -630,7 +631,7 @@ DelayPools::deregisterForUpdates (Updateable *anObject)
     }
 }
 
-std::vector<Updateable *> DelayPools::toUpdate;
+Vector<Updateable *> DelayPools::toUpdate;
 
 void
 DelayPools::Stats(StoreEntry * sentry)
index c93ffd9d0d50fdbd4311d61b3d048db2b7a53a9e..942588e91c0f88a63b018acaa82ddc6de7376653 100644 (file)
@@ -119,7 +119,7 @@ error_hard_text[] = {
 };
 
 /// \ingroup ErrorPageInternal
-static std::vector<ErrorDynamicPageInfo *> ErrorDynamicPages;
+static Vector<ErrorDynamicPageInfo *> ErrorDynamicPages;
 
 /* local prototypes */
 
index 90143b67810b612263b337bb0237da63a45f257a..986406240cfebb1653322e483bc4dae6dce0b861 100644 (file)
  */
 
 #include "squid.h"
+#include "base/Vector.h"
 #include "Debug.h"
 #include "esi/CustomParser.h"
-#include "fatal.h"
 #include "libTrie/Trie.h"
 #include "libTrie/TrieCharTransform.h"
 
-#include <vector>
-
 Trie *ESICustomParser::SearchTrie=NULL;
 
 EsiParserDefinition(ESICustomParser);
@@ -149,7 +147,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool
 
             *tagEnd = '\0';
 
-            std::vector<char *>attributes;
+            Vector<char *>attributes;
 
             char *attribute = const_cast<char *>(endofName + 1);
 
index 87b4b53ef60adf9735a87aa81a94b435cc7618ff..7a00daf244df63c69eb4b2452c205d95219af371 100644 (file)
 #ifndef SQUID_ESIVARSTATE_H
 #define SQUID_ESIVARSTATE_H
 
+#include "base/Vector.h"
 #include "esi/Segment.h"
 #include "HttpHeader.h"
 #include "libTrie/Trie.h"
 
-#include <vector>
-
 class HttpReply;
 
 /* esi variable replacement logic */
@@ -118,7 +117,7 @@ private:
     void doIt ();
     void setupUserAgent();
     Trie variables;
-    std::vector<Variable*> variablesForCleanup;
+    Vector<Variable*> variablesForCleanup;
     Variable *defaultVariable;
 };
 
index b6d61aea22b250796813e733cc597678026363d4..41b7895891f94758168c35a08a476084e413e4ec 100644 (file)
@@ -33,6 +33,7 @@
 #define SQUID_EVENT_H
 
 #include "AsyncEngine.h"
+#include "base/Vector.h"
 #include "MemPool.h"
 
 class StoreEntry;
index a8c61cf25ddb9be9ff1160684b252bcdb5c91b63..dc90fd001ce95fb2ff44d432a79f9985c3ebe180 100644 (file)
@@ -146,8 +146,8 @@ protected:
     virtual void create();
 
 private:
-    std::vector<SwapDir::DirMap::Owner *> mapOwners;
-    std::vector< Ipc::Mem::Owner<Ipc::Mem::PageStack> *> freeSlotsOwners;
+    Vector<SwapDir::DirMap::Owner *> mapOwners;
+    Vector< Ipc::Mem::Owner<Ipc::Mem::PageStack> *> freeSlotsOwners;
 };
 
 } // namespace Rock
index 507fe90b21abfde998f9a03aae01832a3641eb40..69631380a66724bcc165dfcf708ef4596f70084f 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef SQUID_IPC_COORDINATOR_H
 #define SQUID_IPC_COORDINATOR_H
 
+#include "base/Vector.h"
 #include "ipc/Messages.h"
 #include "ipc/Port.h"
 #include "ipc/SharedListen.h"
index 052ae64686260897bdad3034ba037507929e7c58..2263189b6018ee7cb01499c46ad9754d1e364d00 100644 (file)
@@ -4,10 +4,9 @@
 #ifndef SQUID_IPC_KIDS_H
 #define SQUID_IPC_KIDS_H
 
+#include "base/Vector.h"
 #include "ipc/Kid.h"
 
-#include <vector>
-
 /// a collection of kids
 class Kids
 {
@@ -47,7 +46,7 @@ public:
     size_t count() const;
 
 private:
-    std::vector<Kid> storage;
+    Vector<Kid> storage;
 };
 
 extern Kids TheKids; ///< All kids being maintained
index 79a7654788060329af97ef4d65ce24dde423269a..eca2ca477c13901013fcd9cb9f490b36b5363949 100644 (file)
@@ -5,6 +5,7 @@
 #define SQUID_IPC_QUEUE_H
 
 #include "base/InstanceId.h"
+#include "base/Vector.h"
 #include "Debug.h"
 #include "ipc/AtomicWord.h"
 #include "ipc/mem/FlexibleArray.h"
index c3136e0bab94b51bc9c1cd90d0eae3453d7693a6..457726bc7bba69ea428ed222c96cb95870d34ae2 100644 (file)
@@ -4,13 +4,10 @@
 #include "tests/STUB.h"
 
 #include "DiskIO/DiskIOModule.h"
-
-#include <vector>
-
 void DiskIOModule::SetupAllModules() STUB
 void DiskIOModule::ModuleAdd(DiskIOModule &) STUB
 void DiskIOModule::FreeAllModules() STUB
 void DiskIOModule::PokeAllModules() STUB
 DiskIOModule *DiskIOModule::Find(char const *) STUB_RETVAL(NULL)
 DiskIOModule *DiskIOModule::FindDefault() STUB_RETVAL(NULL)
-std::vector<DiskIOModule*> const &DiskIOModule::Modules() STUB_RETSTATREF(std::vector<DiskIOModule*>)
+Vector<DiskIOModule*> const &DiskIOModule::Modules() STUB_RETSTATREF(Vector<DiskIOModule*>)
index accf8e90dc3e4053fd394ccb9546e53ce256f30a..a14c3151b79c73b7502cd7409315fdd43c664834 100644 (file)
@@ -21,11 +21,10 @@ AuthUserHashPointer::AuthUserHashPointer(Auth::User::Pointer anAuth_user) STUB
 Auth::User::Pointer AuthUserHashPointer::user() const STUB_RETVAL(NULL)
 
 #include "auth/Scheme.h"
-#include <vector>
-std::vector<Auth::Scheme::Pointer> *Auth::Scheme::_Schemes = NULL;
+Vector<Auth::Scheme::Pointer> *Auth::Scheme::_Schemes = NULL;
 void Auth::Scheme::AddScheme(Auth::Scheme::Pointer) STUB
 Auth::Scheme::Pointer Auth::Scheme::Find(const char *) STUB_RETVAL(NULL)
-std::vector<Auth::Scheme::Pointer> & Auth::Scheme::GetSchemes() STUB_RETVAL(*_Schemes);
+Vector<Auth::Scheme::Pointer> & Auth::Scheme::GetSchemes() STUB_RETVAL(*_Schemes);
 void Auth::Scheme::FreeAll() STUB
 
 #include "auth/User.h"
index 6f9aecd3b4efdf98fc11bb3c3ccce5a7f0fce24c..98fe5a433d01ae93da89dff8bf84624679b41994 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "squid.h"
 #include "acl/FilledChecklist.h"
+#include "base/Vector.h"
 #include "CachePeer.h"
 #include "client_side.h"
 #include "client_side_request.h"
@@ -774,7 +775,7 @@ tunnelConnectDone(const Comm::ConnectionPointer &conn, comm_err_t status, int xe
         /* At this point only the TCP handshake has failed. no data has been passed.
          * we are allowed to re-try the TCP-level connection to alternate IPs for CONNECT.
          */
-        tunnelState->serverDestinations.erase(tunnelState->serverDestinations.begin());
+        tunnelState->serverDestinations.shift();
         if (status != COMM_TIMEOUT && tunnelState->serverDestinations.size() > 0) {
             /* Try another IP of this destination host */