CernVM-FS
2.12.0
|
#include <sys/time.h>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "util/atomic.h"
#include "util/export.h"
#include "util/murmur.hxx"
#include "util/platform.h"
#include "util/prng.h"
#include "util/single_copy.h"
Go to the source code of this file.
Classes | |
struct | hash_murmur< hashed_type > |
class | StopWatch |
class | Log2Histogram |
class | UTLog2Histogram |
class | HighPrecisionTimer |
Functions | |
CVMFS_EXPORT double | DiffTimeSeconds (struct timeval start, struct timeval end) |
template<typename T > | |
void | SetBit (unsigned int bit, T *field) |
template<typename T > | |
void | ClearBit (unsigned int bit, T *field) |
template<typename T > | |
bool | TestBit (unsigned int bit, const T field) |
template<typename T > | |
std::vector< T > | Shuffle (const std::vector< T > &input, Prng *prng) |
template<typename T , typename U > | |
void | SortTeam (std::vector< T > *tractor, std::vector< U > *towed) |
|
inline |
Definition at line 36 of file algorithm.h.
Referenced by cvmfs::cvmfs_read(), and cvmfs::cvmfs_release().
CVMFS_EXPORT double DiffTimeSeconds | ( | struct timeval | start, |
struct timeval | end | ||
) |
This file is part of the CernVM File System.
Definition at line 31 of file algorithm.cc.
Referenced by StopWatch::GetTime(), download::DownloadManager::MainDownload(), and download::DownloadManager::ProbeHosts().
|
inline |
Definition at line 31 of file algorithm.h.
Referenced by cvmfs::FillOpenFlags().
std::vector<T> Shuffle | ( | const std::vector< T > & | input, |
Prng * | prng | ||
) |
Knuth's random shuffle algorithm.
Definition at line 50 of file algorithm.h.
Referenced by download::DownloadManager::GeoSortServers().
void SortTeam | ( | std::vector< T > * | tractor, |
std::vector< U > * | towed | ||
) |
Sorts the vector tractor and applies the same permutation to towed. Both vectors have to be of the same size. Type T must be sortable (< operator). Uses insertion sort (n^2), only efficient for small vectors.
Definition at line 68 of file algorithm.h.
Referenced by ListDirectory(), download::DownloadManager::ProbeGeo(), and download::DownloadManager::ProbeHosts().
|
inline |
Definition at line 41 of file algorithm.h.
Referenced by cvmfs::cvmfs_release(), and cvmfs::FillOpenFlags().