#define SQUID_CLIENTDELAYCONFIG_H
#include "acl/forward.h"
-#include "base/Vector.h"
+#include <vector>
class StoreEntry;
class ConfigParser;
int64_t highwatermark;
};
-typedef Vector<ClientDelayPool> ClientDelayPools;
+typedef std::vector<ClientDelayPool> ClientDelayPools;
/* represents configuration of client write limiting delay pools */
class ClientDelayConfig
bool
ConfigOptionVector::parse(char const *option, const char *value, int isaReconfig)
{
- Vector<ConfigOption *>::iterator i = options.begin();
+ std::vector<ConfigOption *>::iterator i = options.begin();
while (i != options.end()) {
if ((*i)->parse(option,value, isaReconfig))
void
ConfigOptionVector::dump(StoreEntry * e) const
{
- for (Vector<ConfigOption *>::const_iterator i = options.begin();
+ for (std::vector<ConfigOption *>::const_iterator i = options.begin();
i != options.end(); ++i)
(*i)->dump(e);
}
#ifndef SQUID_CONFIGOPTION_H
#define SQUID_CONFIGOPTION_H
-#include "base/Vector.h"
+#include <vector>
class StoreEntry;
virtual ~ConfigOptionVector();
virtual bool parse(char const *option, const char *value, int reconfiguring);
virtual void dump(StoreEntry * e) const;
- Vector<ConfigOption *>options;
+ std::vector<ConfigOption *>options;
};
template <class C>
#include "Debug.h"
bool
-CpuAffinityMap::add(const Vector<int> &aProcesses, const Vector<int> &aCores)
+CpuAffinityMap::add(const std::vector<int> &aProcesses, const std::vector<int> &aCores)
{
if (aProcesses.size() != aCores.size())
return false;
#ifndef SQUID_CPU_AFFINITY_MAP_H
#define SQUID_CPU_AFFINITY_MAP_H
-#include "base/Vector.h"
+#include <vector>
class CpuAffinitySet;
{
public:
/// append cpu_affinity_map option
- bool add(const Vector<int> &aProcesses, const Vector<int> &aCores);
+ bool add(const std::vector<int> &aProcesses, const std::vector<int> &aCores);
/// calculate CPU set for this process
CpuAffinitySet *calculateSet(const int targetProcess) const;
/// returns list of process numbers
- const Vector<int> &processes() const { return theProcesses; }
+ const std::vector<int> &processes() const { return theProcesses; }
/// returns list of cores
- const Vector<int> &cores() const { return theCores; }
+ const std::vector<int> &cores() const { return theCores; }
private:
- Vector<int> theProcesses; ///< list of process numbers
- Vector<int> theCores; ///< list of cores
+ std::vector<int> theProcesses; ///< list of process numbers
+ std::vector<int> theCores; ///< list of cores
};
#endif // SQUID_CPU_AFFINITY_MAP_H
#ifndef SQUID_DELAYPOOLS_H
#define SQUID_DELAYPOOLS_H
-#include "base/Vector.h"
+#include <vector>
class DelayPool;
class Updateable;
static time_t LastUpdate;
static unsigned short pools_;
static void FreeDelayData ();
- static Vector<Updateable *> toUpdate;
+ static std::vector<Updateable *> toUpdate;
static void RegisterWithCacheManager(void);
};
private:
RefCount<DelayVector> theVector;
- Vector<DelayIdComposite::Pointer> ids;
- typedef Vector<DelayIdComposite::Pointer>::iterator iterator;
- typedef Vector<DelayIdComposite::Pointer>::const_iterator const_iterator;
+ std::vector<DelayIdComposite::Pointer> ids;
+ typedef std::vector<DelayIdComposite::Pointer>::iterator iterator;
+ typedef std::vector<DelayIdComposite::Pointer>::const_iterator const_iterator;
};
friend class Id;
- Vector<CompositePoolNode::Pointer> pools;
- typedef Vector<CompositePoolNode::Pointer>::iterator iterator;
- typedef Vector<CompositePoolNode::Pointer>::const_iterator const_iterator;
+ std::vector<CompositePoolNode::Pointer> pools;
+ typedef std::vector<CompositePoolNode::Pointer>::iterator iterator;
+ typedef std::vector<CompositePoolNode::Pointer>::const_iterator const_iterator;
};
#endif /* USE_DELAY_POOLS */
#include "squid.h"
#include "DiskIOModule.h"
-Vector<DiskIOModule*> *DiskIOModule::_Modules = NULL;
+std::vector<DiskIOModule*> *DiskIOModule::_Modules = NULL;
//DiskIOModule() : initialised (false) {}
GetModules().push_back (&instance);
}
-Vector<DiskIOModule *> const &
+std::vector<DiskIOModule *> const &
DiskIOModule::Modules()
{
return GetModules();
}
-Vector<DiskIOModule*> &
+std::vector<DiskIOModule*> &
DiskIOModule::GetModules()
{
if (!_Modules)
- _Modules = new Vector<DiskIOModule *>;
+ _Modules = new std::vector<DiskIOModule *>;
return *_Modules;
}
#ifndef SQUID_DISKIOMODULE_H
#define SQUID_DISKIOMODULE_H
-#include "base/Vector.h"
+#include <vector>
/* forward decls */
* available module for this system.
*/
static DiskIOModule *FindDefault();
- static Vector<DiskIOModule*> const &Modules();
- typedef Vector<DiskIOModule*>::iterator iterator;
- typedef Vector<DiskIOModule*>::const_iterator const_iterator;
+ static std::vector<DiskIOModule*> const &Modules();
+ typedef std::vector<DiskIOModule*>::iterator iterator;
+ typedef std::vector<DiskIOModule*>::const_iterator const_iterator;
DiskIOModule();
virtual ~DiskIOModule() {}
static void RegisterAllModulesWithCacheManager(void);
private:
- static Vector<DiskIOModule*> &GetModules();
- static Vector<DiskIOModule*> *_Modules;
+ static std::vector<DiskIOModule*> &GetModules();
+ static std::vector<DiskIOModule*> *_Modules;
};
#endif /* SQUID_DISKIOMODULE_H */
#ifndef SQUID_EVENTLOOP_H
#define SQUID_EVENTLOOP_H
-#include "base/Vector.h"
+#include <vector>
#define EVENT_LOOP_TIMEOUT 1000 /* 1s timeout */
bool dispatchCalls();
bool last_loop;
- typedef Vector<AsyncEngine *> engine_vector;
+ typedef std::vector<AsyncEngine *> engine_vector;
engine_vector engines;
TimeEngine * timeService;
AsyncEngine * primaryEngine;
#ifndef SQUID_FADING_COUNTER_H
#define SQUID_FADING_COUNTER_H
-#include "base/Vector.h"
+#include <vector>
/// 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
- Vector<int> counters; ///< events per delta (possibly stale)
+ std::vector<int> counters; ///< events per delta (possibly stale)
int total; ///< number of remembered events (possibly stale)
};
return;
}
- candidates.shift(); // the rule apparently went away (reconfigure)
+ candidates.erase(candidates.begin()); // the rule apparently went away (reconfigure)
}
debugs(93, 4, HERE << "NO candidates left");
}
// no match or the group disappeared during reconfiguration
- candidates.shift();
+ candidates.erase(candidates.begin());
checkCandidates();
}
ACLFilledChecklist *acl_checklist;
typedef int Candidate;
- typedef Vector<Candidate> Candidates;
+ typedef std::vector<Candidate> Candidates;
Candidates candidates;
Candidate topCandidate() const { return *candidates.begin(); }
ServiceGroupPointer topGroup() const; // may return nil
static Id LastId;
};
-typedef Vector<Adaptation::AccessRule*> AccessRules;
+typedef std::vector<Adaptation::AccessRule*> AccessRules;
AccessRules &AllRules();
AccessRule *FindRule(const AccessRule::Id &id);
AccessRule *FindRuleByGroupId(const String &groupId);
#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);
- group->services.prune(service);
- debugs(93, 5, HERE << "adaptation service " << service <<
+ std::remove(group->services.begin(),group->services.end(),service);
+ debugs(93, 5, "adaptation service " << service <<
" removed from group " << group->id);
break;
}
}
if (services.empty()) {
removeRule(group->id);
- AllGroups().prune(group);
+ std::remove(AllGroups().begin(),AllGroups().end(),group);
} else {
++i;
}
for (ARI it = rules.begin(); it != rules.end(); ++it) {
AccessRule* rule = *it;
if (rule->groupId == id) {
- debugs(93, 5, HERE << "removing access rules for:" << id);
- AllRules().prune(rule);
+ debugs(93, 5, "removing access rules for:" << id);
+ std::remove(AllRules().begin(),AllRules().end(),rule);
delete (rule);
break;
}
static bool needHistory; ///< HttpRequest adaptation history should recorded
- typedef Vector<ServiceConfigPointer> ServiceConfigs;
+ typedef std::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 Vector<String> Store;
+ typedef std::vector<String> Store;
typedef String Id;
Id id; ///< group id
/// AccessLogEntry::notes when ALE becomes available
NotePairs::Pointer metaHeaders;
- typedef Vector<SBuf> AdaptationServices;
+ typedef std::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 Vector<Entry> Entries;
+ typedef std::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 Vector<Adaptation::ServicePointer> Services;
+typedef std::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 Vector<String> Store;
+ typedef std::vector<String> Store;
typedef String Id;
- typedef unsigned int Pos; // Vector<>::poistion_type
+ typedef unsigned int Pos; // vector<>::position_type
friend class ServicePlan;
public:
class ServicePlan
{
public:
- typedef unsigned int Pos; // Vector<>::poistion_type
+ typedef unsigned int Pos; // vector<>::position_type
public:
ServicePlan();
return p.print(os);
}
-typedef Vector<ServiceGroupPointer> Groups;
+typedef std::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"
AsyncCall::Pointer callback;
};
- typedef Vector<Client> Clients;
+ typedef std::vector<Client> Clients;
// TODO: rename to theUpWaiters
Clients theClients; // all clients waiting for a call back
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, Vector<int> &list);
+static bool parseNamedIntList(const char *data, const String &name, std::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;
- Vector<bool> if_states;
+ std::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, Vector<int> &list)
+parseNamedIntList(const char *data, const String &name, std::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();
- Vector<int> processes, cores;
+ std::vector<int> processes, cores;
if (!parseNamedIntList(pToken, "process_numbers", processes)) {
debugs(3, DBG_CRITICAL, "FATAL: bad 'process_numbers' parameter " <<
"in 'cpu_affinity_map'");
#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;
- Vector<Updateable *>::iterator pos = toUpdate.begin();
+ std::vector<Updateable *>::iterator pos = toUpdate.begin();
while (pos != toUpdate.end()) {
(*pos)->update(incr);
void
DelayPools::deregisterForUpdates (Updateable *anObject)
{
- Vector<Updateable *>::iterator pos = toUpdate.begin();
+ std::vector<Updateable *>::iterator pos = toUpdate.begin();
while (pos != toUpdate.end() && *pos != anObject) {
++pos;
if (pos != toUpdate.end()) {
/* move all objects down one */
- Vector<Updateable *>::iterator temp = pos;
+ std::vector<Updateable *>::iterator temp = pos;
++pos;
while (pos != toUpdate.end()) {
}
}
-Vector<Updateable *> DelayPools::toUpdate;
+std::vector<Updateable *> DelayPools::toUpdate;
void
DelayPools::Stats(StoreEntry * sentry)
};
/// \ingroup ErrorPageInternal
-static Vector<ErrorDynamicPageInfo *> ErrorDynamicPages;
+static std::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';
- Vector<char *>attributes;
+ std::vector<char *>attributes;
char *attribute = const_cast<char *>(endofName + 1);
virtual void create(const RunnerRegistry &);
private:
- Vector<SwapDir::DirMap::Owner *> mapOwners;
- Vector< Ipc::Mem::Owner<Ipc::Mem::PageStack> *> freeSlotsOwners;
+ std::vector<SwapDir::DirMap::Owner *> mapOwners;
+ std::vector< Ipc::Mem::Owner<Ipc::Mem::PageStack> *> freeSlotsOwners;
};
} // namespace Rock
#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:
- Vector<Kid> storage;
+ std::vector<Kid> storage;
};
extern Kids TheKids; ///< All kids being maintained