to avoid stability issues related to std::vector migration.
#define SQUID_CLIENTDELAYCONFIG_H
#include "acl/forward.h"
-
-#include <vector>
+#include "base/Vector.h"
class StoreEntry;
class ConfigParser;
int64_t highwatermark;
};
-typedef std::vector<ClientDelayPool> ClientDelayPools;
+typedef Vector<ClientDelayPool> ClientDelayPools;
/* represents configuration of client write limiting delay pools */
class ClientDelayConfig
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))
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);
}
#ifndef SQUID_CONFIGOPTION_H
#define SQUID_CONFIGOPTION_H
-#include <vector>
+#include "base/Vector.h"
class StoreEntry;
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>
#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;
#ifndef SQUID_CPU_AFFINITY_MAP_H
#define SQUID_CPU_AFFINITY_MAP_H
-#include <vector>
+#include "base/Vector.h"
class CpuAffinitySet;
{
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
#ifndef SQUID_DELAYPOOLS_H
#define SQUID_DELAYPOOLS_H
-#include <vector>
+#include "base/Vector.h"
class DelayPool;
class Updateable;
static time_t LastUpdate;
static unsigned short pools_;
static void FreeDelayData ();
- static std::vector<Updateable *> toUpdate;
+ static Vector<Updateable *> toUpdate;
static void RegisterWithCacheManager(void);
};
#if USE_DELAY_POOLS
#include "auth/Gadgets.h"
+#include "base/Vector.h"
#include "CompositePoolNode.h"
#include "DelayBucket.h"
#include "DelayIdComposite.h"
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 */
#include "squid.h"
#include "DiskIOModule.h"
-std::vector<DiskIOModule*> *DiskIOModule::_Modules = NULL;
+Vector<DiskIOModule*> *DiskIOModule::_Modules = NULL;
//DiskIOModule() : initialised (false) {}
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;
}
#ifndef SQUID_DISKIOMODULE_H
#define SQUID_DISKIOMODULE_H
-#include <vector>
+#include "base/Vector.h"
/* forward decls */
* 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() {}
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 */
#ifndef SQUID_EVENTLOOP_H
#define SQUID_EVENTLOOP_H
-#include <vector>
+#include "base/Vector.h"
#define EVENT_LOOP_TIMEOUT 1000 /* 1s timeout */
bool dispatchCalls();
bool last_loop;
- typedef std::vector<AsyncEngine *> engine_vector;
+ typedef Vector<AsyncEngine *> engine_vector;
engine_vector engines;
TimeEngine * timeService;
AsyncEngine * primaryEngine;
#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
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)
};
entry->reset();
// drop the last path off the selection list. try the next one.
- serverDestinations.erase(serverDestinations.begin());
+ serverDestinations.shift();
startConnectionOrFail();
} else {
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;
}
#define SQUID_FORWARD_H
#include "base/RefCount.h"
+#include "base/Vector.h"
#include "comm.h"
#include "comm/Connection.h"
#include "err_type.h"
}
void
-HttpHdrRange::merge (std::vector<HttpHdrRangeSpec *> &basis)
+HttpHdrRange::merge (Vector<HttpHdrRangeSpec *> &basis)
{
/* reset old array */
specs.clear();
}
void
-HttpHdrRange::getCanonizedSpecs(std::vector<HttpHdrRangeSpec *> ©)
+HttpHdrRange::getCanonizedSpecs (Vector<HttpHdrRangeSpec *> ©)
{
/* canonize each entry and destroy bad ones if any */
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"
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() <<
const HttpHdrRangeSpec *
HttpHdrRangeIter::currentSpec() const
{
- if (pos != end)
+ if (pos.incrementable())
return *pos;
return NULL;
assert (debt_size == 0);
assert (valid);
- if (pos != end) {
+ if (pos.incrementable()) {
debt(currentSpec()->length);
}
}
#include "StrList.h"
#include "TimeOrTag.h"
-#include <algorithm>
-
/*
* On naming conventions:
*
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);
}
/*
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;
#include "MemPool.h"
#include "SquidString.h"
-#include <vector>
-
/* class forward declarations */
class HttpHdrCc;
class HttpHdrContRange;
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 */
+
/*
*
* 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 */
~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();
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 *> ©);
- void merge (std::vector<HttpHdrRangeSpec *> &basis);
+ void getCanonizedSpecs (Vector<HttpHdrRangeSpec *> ©);
+ void merge (Vector<HttpHdrRangeSpec *> &basis);
int64_t clen;
};
public:
HttpHdrRange::iterator pos;
- HttpHdrRange::iterator end;
const HttpHdrRangeSpec *currentSpec() const;
void updateSpec();
int64_t debt() 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(", ");
{
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));
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();
}
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;
}
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()));
}
}
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()));
}
#include "acl/forward.h"
#include "base/RefCount.h"
+#include "base/Vector.h"
#include "CbDataList.h"
#include "format/Format.h"
#include "MemPool.h"
#include "typedefs.h"
#include <string>
-#include <vector>
class HttpRequest;
class HttpReply;
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) {}
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
*/
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
#include "AccessLogEntry.h"
#include "acl/Checklist.h"
+#include "base/Vector.h"
#include "cbdata.h"
#include "comm/forward.h"
#include "hier_code.h"
#include "squid.h"
#include "StoreFileSystem.h"
-std::vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = NULL;
+Vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = NULL;
void
StoreFileSystem::RegisterAllFsWithCacheManager(void)
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;
}
#ifndef SQUID_STOREFILESYSTEM_H
#define SQUID_STOREFILESYSTEM_H
-#include <vector>
+#include "base/Vector.h"
/* ****** DOCUMENTATION ***** */
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() {}
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);
};
void *cbdata;
bool _done;
int bucket;
- std::vector<StoreEntry *> entries;
+ Vector<StoreEntry *> entries;
// keep this last. it plays with private/public
CBDATA_CLASS2(StoreSearchHashIndex);
#include "profiler/Profiler.h"
#include "SquidConfig.h"
-#include <vector>
-
const ACLFlag ACLFlags::NoFlags[1] = {ACL_F_END};
const char *AclMatchedName = NULL;
registerMe ();
}
-std::vector<ACL::Prototype const *> * ACL::Prototype::Registry;
+Vector<ACL::Prototype const *> * ACL::Prototype::Registry;
void *ACL::Prototype::Initialized;
bool
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;
}
#define SQUID_ACL_H
#include "acl/forward.h"
+#include "base/Vector.h"
#include "cbdata.h"
#include "defines.h"
#include "dlink.h"
#include <ostream>
#include <string>
-#include <vector>
class ConfigParser;
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();
};
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;
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");
}
// no match or the group disappeared during reconfiguration
- candidates.erase(candidates.begin());
+ candidates.shift();
checkCandidates();
}
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
#include "adaptation/forward.h"
#include "SquidString.h"
-#include <vector>
-
class ConfigParser;
namespace Adaptation
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);
#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;
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;
}
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;
}
static bool needHistory; ///< HttpRequest adaptation history should recorded
- typedef std::vector<ServiceConfigPointer> ServiceConfigs;
+ typedef Vector<ServiceConfigPointer> ServiceConfigs;
ServiceConfigs serviceConfigs;
Config();
#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
{
class DynamicGroupCfg
{
public:
- typedef std::vector<String> Store;
+ typedef Vector<String> Store;
typedef String Id;
Id id; ///< group id
#include "adaptation/DynamicGroupCfg.h"
#include "base/RefCount.h"
+#include "base/Vector.h"
#include "HttpHeader.h"
#include "Notes.h"
#include "SBuf.h"
/// 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
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
typedef Service::Pointer ServicePointer;
-typedef std::vector<Adaptation::ServicePointer> Services;
+typedef Vector<Adaptation::ServicePointer> Services;
Services &AllServices();
ServicePointer FindService(const Service::Id &key);
#include "adaptation/Elements.h"
#include "adaptation/forward.h"
#include "base/RefCount.h"
+#include "base/Vector.h"
#include "SquidString.h"
-#include <vector>
-
namespace Adaptation
{
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:
class ServicePlan
{
public:
- typedef unsigned int Pos; // vector<>::position_type
+ typedef unsigned int Pos; // Vector<>::poistion_type
public:
ServicePlan();
return p.print(os);
}
-typedef std::vector<ServiceGroupPointer> Groups;
+typedef Vector<ServiceGroupPointer> Groups;
Groups &AllGroups();
ServiceGroupPointer FindGroup(const ServiceGroup::Id &id);
#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"
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.
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()) {
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
Format::Format *keyExtras; ///< The compiled request format
};
-typedef std::vector<Config *> ConfigVector;
+typedef Vector<Config *> ConfigVector;
extern ConfigVector TheConfig;
#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)
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;
}
#if USE_AUTH
#include "base/RefCount.h"
-
-#include <vector>
+#include "base/Vector.h"
/**
\defgroup AuthSchemeAPI Authentication Scheme API
{
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) {};
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
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);
config_lineno = 0;
- std::vector<bool> if_states;
+ Vector<bool> if_states;
while (fgets(config_input_line, BUFSIZ, fp)) {
++config_lineno;
/// 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();
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'");
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();
*/
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;
}
}
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;
#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
{
* 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
static AcceptLimiter Instance_;
/** FIFO queue */
- std::vector<TcpAcceptor::Pointer> deferred_;
+ Vector<TcpAcceptor::Pointer> deferred_;
};
}; // namepace Comm
#define _SQUID_COMM_FORWARD_H
#include "base/RefCount.h"
-
-#include <vector>
+#include "base/Vector.h"
namespace Comm
{
typedef RefCount<Comm::Connection> ConnectionPointer;
-typedef std::vector<Comm::ConnectionPointer> ConnectionList;
+typedef Vector<Comm::ConnectionPointer> ConnectionList;
bool IsConnOpen(const Comm::ConnectionPointer &conn);
#include "squid.h"
#if USE_DELAY_POOLS
+#include "base/Vector.h"
#include "client_side_request.h"
#include "comm/Connection.h"
#include "CommonPool.h"
LastUpdate = squid_curtime;
- std::vector<Updateable *>::iterator pos = toUpdate.begin();
+ Vector<Updateable *>::iterator pos = toUpdate.begin();
while (pos != toUpdate.end()) {
(*pos)->update(incr);
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;
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()) {
}
}
-std::vector<Updateable *> DelayPools::toUpdate;
+Vector<Updateable *> DelayPools::toUpdate;
void
DelayPools::Stats(StoreEntry * sentry)
};
/// \ingroup ErrorPageInternal
-static std::vector<ErrorDynamicPageInfo *> ErrorDynamicPages;
+static Vector<ErrorDynamicPageInfo *> ErrorDynamicPages;
/* local prototypes */
*/
#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);
*tagEnd = '\0';
- std::vector<char *>attributes;
+ Vector<char *>attributes;
char *attribute = const_cast<char *>(endofName + 1);
#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 */
void doIt ();
void setupUserAgent();
Trie variables;
- std::vector<Variable*> variablesForCleanup;
+ Vector<Variable*> variablesForCleanup;
Variable *defaultVariable;
};
#define SQUID_EVENT_H
#include "AsyncEngine.h"
+#include "base/Vector.h"
#include "MemPool.h"
class StoreEntry;
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
#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"
#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
{
size_t count() const;
private:
- std::vector<Kid> storage;
+ Vector<Kid> storage;
};
extern Kids TheKids; ///< All kids being maintained
#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"
#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*>)
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"
#include "squid.h"
#include "acl/FilledChecklist.h"
+#include "base/Vector.h"
#include "CachePeer.h"
#include "client_side.h"
#include "client_side_request.h"
/* 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 */