*** empty log message ***

svn path=/trunk/boinc/; revision=3725
This commit is contained in:
Eric J. Korpela 2004-06-30 18:17:21 +00:00
parent 515f96e745
commit 7cd5c7911a
52 changed files with 165 additions and 105 deletions

View File

@ -24,7 +24,6 @@
// _WIN32" -- if something is not working on a particular version of MSVC
// let's find a working solution
#include <string>
using namespace std;
#include "app_ipc.h"
@ -40,7 +39,7 @@ extern "C" {
extern int boinc_resolve_filename(const char*, char*, int len);
extern int boinc_resolve_filename_s(const char*, string&);
extern int boinc_resolve_filename_s(const char*, std::string&);
extern int boinc_parse_init_data_file();
extern int boinc_write_init_data_file();

View File

@ -63,6 +63,8 @@
#include "boinc_api.h"
#include "mfile.h"
using std::string;
#define CHECKPOINT_FILE "upper_case_state"
#ifdef BOINC_APP_GRAPHICS

View File

@ -14330,3 +14330,19 @@ Karl 2004-06-30
boinc_setup.vdproj
boinc_setup_auto.vdproj
Eric K 30 June 2004
- Removed "using" directives from header files. "using"
directives should not be used in header files for the following reasons.
- A "using namespace" directive cannot be revoked for any source file
including the header. It forces the use of the namespace regardless of
the consequences.
- Dropping the namespace qualifier on STL templates ambiguates the
resolution of template functions. (How many C libraries or headers
have you seen that define the function min()?)
- Reducing typing is not a good reason to drop namespace qualifiers any
more than it would be a good idea to "#define p printf"
- Namespaces exist for a reason.
- It's acceptable to have "using" directive in a source file, since it
won't affect other files. It's better to have "using std::string;"
directives than "using namespace std;" for hopefully obvious reasons.

View File

@ -80,6 +80,10 @@
#include "client_msgs.h"
#include "app.h"
using std::vector;
using std::max;
// value for setpriority(2)
static const int PROCESS_IDLE_PRIORITY = 19;

View File

@ -157,7 +157,7 @@ public:
class ACTIVE_TASK_SET {
public:
typedef vector<ACTIVE_TASK*> active_tasks_v;
typedef std::vector<ACTIVE_TASK*> active_tasks_v;
active_tasks_v active_tasks;
int remove(ACTIVE_TASK*);
ACTIVE_TASK* lookup_pid(int);

View File

@ -32,7 +32,6 @@
#include <list>
#include <string>
using std::string;
#include "msg_log.h"
@ -57,10 +56,10 @@ struct MESSAGE_DESC {
int priority;
int timestamp;
int seqno;
string message;
std::string message;
};
extern list<MESSAGE_DESC*> message_descs;
extern std::list<MESSAGE_DESC*> message_descs;
extern void record_message(class PROJECT *p, int priority, int now, char* msg);
extern void show_message(class PROJECT *p, char* message, int priority);

View File

@ -58,6 +58,10 @@
#include "client_msgs.h"
#include "client_state.h"
using std::max;
using std::string;
using std::vector;
CLIENT_STATE gstate;
CLIENT_STATE::CLIENT_STATE() {

View File

@ -66,12 +66,12 @@ enum SUSPEND_REASON_t {
//
class CLIENT_STATE {
public:
vector<PROJECT*> projects;
vector<APP*> apps;
vector<FILE_INFO*> file_infos;
vector<APP_VERSION*> app_versions;
vector<WORKUNIT*> workunits;
vector<RESULT*> results;
std::vector<PROJECT*> projects;
std::vector<APP*> apps;
std::vector<FILE_INFO*> file_infos;
std::vector<APP_VERSION*> app_versions;
std::vector<WORKUNIT*> workunits;
std::vector<RESULT*> results;
NET_XFER_SET* net_xfers;
PERS_FILE_XFER_SET* pers_file_xfers;

View File

@ -40,6 +40,8 @@
#include "client_types.h"
using std::string;
PROJECT::PROJECT() {
init();
}

View File

@ -74,13 +74,13 @@ public:
RESULT* result; // for upload files (to authenticate)
PROJECT* project;
int ref_cnt;
vector<STRING256> urls;
std::vector<STRING256> urls;
int start_url;
int current_url;
char signed_xml[MAX_BLOB_LEN];
char xml_signature[MAX_BLOB_LEN];
char file_signature[MAX_BLOB_LEN];
string error_msg; // if permanent error occurs during file xfer,
std::string error_msg; // if permanent error occurs during file xfer,
// it's recorded here
FILE_INFO();
@ -120,12 +120,12 @@ public:
char master_url[256]; // url of site that contains scheduler tags
// for this project
char authenticator[256]; // user's authenticator on this project
string project_prefs;
std::string project_prefs;
// without the enclosing <project_preferences> tags.
// May include <venue> elements
// This field is used only briefly: between handling a
// scheduler RPC reply and writing the account file
string project_specific_prefs;
std::string project_specific_prefs;
// without enclosing <project_specific> tags
// Does not include <venue> elements
double resource_share;
@ -135,7 +135,7 @@ public:
// They may depend on the host as well as user and project
// NOTE: if you add anything, add it to copy_state_fields() also!!!
//
vector<STRING256> scheduler_urls; // where to find scheduling servers
std::vector<STRING256> scheduler_urls; // where to find scheduling servers
char project_name[256]; // descriptive. not unique
char user_name[256];
char team_name[256];
@ -165,7 +165,7 @@ public:
bool anonymous_platform; // app_versions.xml file found in project dir;
// use those apps rather then getting from server
char code_sign_key[MAX_BLOB_LEN];
vector<FILE_REF> user_files;
std::vector<FILE_REF> user_files;
int parse_preferences_for_user_files();
// the following fields used by CPU scheduler
@ -213,7 +213,7 @@ struct APP_VERSION {
int version_num;
APP* app;
PROJECT* project;
vector<FILE_REF> app_files;
std::vector<FILE_REF> app_files;
int ref_cnt;
int parse(MIOFILE&);
@ -228,7 +228,7 @@ struct WORKUNIT {
// Instead, the client picks the latest app version
char command_line[256];
char env_vars[256]; // environment vars in URL format
vector<FILE_REF> input_files;
std::vector<FILE_REF> input_files;
PROJECT* project;
APP* app;
APP_VERSION* avp;
@ -241,14 +241,14 @@ struct WORKUNIT {
int parse(MIOFILE&);
int write(MIOFILE&);
bool had_failure(int& failnum);
void get_file_errors(string&);
void get_file_errors(std::string&);
};
struct RESULT {
char name[256];
char wu_name[256];
int report_deadline;
vector<FILE_REF> output_files;
std::vector<FILE_REF> output_files;
bool is_active;
// an app is currently running for this.
// this is false for preempted tasks!
@ -264,7 +264,7 @@ struct RESULT {
int signal; // the signal caught by the active_task,
// defined only if active_task_state is PROCESS_SIGNALED
int active_task_state; // the state of the active task corresponding to this result
string stderr_out;
std::string stderr_out;
// the concatenation of:
//
// - if report_result_error() is called for this result:
@ -295,7 +295,7 @@ struct RESULT {
int parse_ack(FILE*);
int write(MIOFILE&, bool to_server);
bool is_upload_done(); // files uploaded?
void get_app_version_string(string&);
void get_app_version_string(std::string&);
};
int verify_downloaded_file(char* pathname, FILE_INFO& file_info);

View File

@ -26,5 +26,4 @@
#include <iostream>
#include <vector>
#include <string>
using namespace std;
#endif

View File

@ -33,6 +33,8 @@
#include "error_numbers.h"
#include "file_names.h"
using std::string;
static inline string filename_to_project_dirname(const string& filename) {
assert(starts_with(filename, "account_"));
assert(ends_with(filename, ".xml"));

View File

@ -44,6 +44,8 @@
#include "client_msgs.h"
#include "client_state.h"
using std::vector;
// Quit running applications, quit benchmarks,
// write the client_state.xml file

View File

@ -46,6 +46,8 @@
#define MAX_TRANSFERS_PER_PROJECT 2
using std::vector;
// Decide whether to consider starting a new file transfer
//
bool CLIENT_STATE::start_new_file_xfer(PERS_FILE_XFER& pfx) {

View File

@ -41,6 +41,9 @@
#include "client_msgs.h"
#include "client_state.h"
using std::min;
using std::string;
void CLIENT_STATE::install_global_prefs() {
net_xfers->max_bytes_sec_up = global_prefs.max_bytes_sec_up;
net_xfers->max_bytes_sec_down = global_prefs.max_bytes_sec_down;

View File

@ -47,6 +47,9 @@
#include "client_state.h"
using std::vector;
using std::string;
// quantities like avg CPU time decay by a factor of e every week
//
#define EXP_DECAY_RATE (1./(SECONDS_PER_DAY*7))

View File

@ -28,6 +28,8 @@
#include "parse.h"
#include "client_state.h"
using std::string;
// Scan project dir for file names of the form trickle_up_X_Y
// where X is a result name and Y is a timestamp.
// Convert them to XML (for sched request message)

View File

@ -32,6 +32,8 @@
#include "parse.h"
#include "error_numbers.h"
using std::vector;
FILE_XFER::FILE_XFER() {
file_xfer_done = false;
file_xfer_retval = 0;

View File

@ -53,7 +53,7 @@ public:
class FILE_XFER_SET {
HTTP_OP_SET* http_ops;
public:
vector<FILE_XFER*> file_xfers;
std::vector<FILE_XFER*> file_xfers;
FILE_XFER_SET(HTTP_OP_SET*);
int insert(FILE_XFER*);
int remove(FILE_XFER*);

View File

@ -22,8 +22,6 @@
#include <string>
#include <vector>
using std::string;
using std::vector;
#endif
#include "miofile.h"
@ -33,7 +31,7 @@ using std::vector;
struct PROJECT;
struct FILE_INFO {
string name;
std::string name;
bool generated_locally;
bool uploaded;
bool upload_when_present;
@ -165,13 +163,13 @@ class RPC_CLIENT {
int send_request(char*);
int get_reply(char*&);
public:
vector<PROJECT*> projects;
vector<FILE_INFO*> file_infos;
vector<APP*> apps;
vector<APP_VERSION*> app_versions;
vector<WORKUNIT*> wus;
vector<RESULT*> results;
vector<ACTIVE_TASK*> active_tasks;
std::vector<PROJECT*> projects;
std::vector<FILE_INFO*> file_infos;
std::vector<APP*> apps;
std::vector<APP_VERSION*> app_versions;
std::vector<WORKUNIT*> wus;
std::vector<RESULT*> results;
std::vector<ACTIVE_TASK*> active_tasks;
APP* lookup_app(string&);
WORKUNIT* lookup_wu(string&);
@ -191,7 +189,7 @@ public:
int set_run_mode(int mode);
int run_benchmarks();
int set_proxy_settings(PROXY_INFO&);
int get_messages(int nmessages, int seqno, vector<MESSAGE_DESC>&);
int get_messages(int nmessages, int seqno, std::vector<MESSAGE_DESC>&);
void print();
};

View File

@ -39,6 +39,10 @@
#include "client_msgs.h"
#include "client_state.h"
using std::string;
using std::list;
using std::vector;
GUI_RPC_CONN::GUI_RPC_CONN(int s) {
sock = s;
}

View File

@ -27,7 +27,7 @@ public:
};
class GUI_RPC_CONN_SET {
vector<GUI_RPC_CONN*> gui_rpcs;
std::vector<GUI_RPC_CONN*> gui_rpcs;
int insert(GUI_RPC_CONN*);
int lsock;
public:

View File

@ -22,7 +22,6 @@
#ifdef _WIN32
#include "boinc_win.h"
#define SHUT_WR SD_SEND
using std::string;
#endif
#ifndef _WIN32
@ -54,6 +53,9 @@ using std::string;
#define HTTP_BLOCKSIZE 16384
using std::string;
using std::istringstream;
using std::vector;
// Breaks a HTTP url down into its server and file path components
//

View File

@ -37,8 +37,8 @@
struct HTTP_REPLY_HEADER {
int http_status;
int content_length;
string redirect_location;
string recv_buf;
std::string redirect_location;
std::string recv_buf;
void init();
int read_reply(int socket);
@ -90,7 +90,7 @@ public:
// represents a set of HTTP requests in progress
//
class HTTP_OP_SET {
vector<HTTP_OP*> http_ops;
std::vector<HTTP_OP*> http_ops;
NET_XFER_SET* net_xfers;
public:
HTTP_OP_SET(NET_XFER_SET*);

View File

@ -86,6 +86,8 @@ typedef size_t socklen_t;
#endif
#endif
using std::vector;
// if an active transfer doesn't get any activity
// in this many seconds, error out
#define NET_XFER_TIMEOUT 600

View File

@ -81,7 +81,7 @@ public:
// Each second we reset these to zero.
class NET_XFER_SET {
vector<NET_XFER*> net_xfers;
std::vector<NET_XFER*> net_xfers;
public:
NET_XFER_SET();
double max_bytes_sec_up, max_bytes_sec_down;

View File

@ -40,6 +40,8 @@
#include "client_types.h"
#include "client_msgs.h"
using std::vector;
// PERS_FILE_XFER represents a persistent file transfer.
// A set of URLs is given.
//

View File

@ -79,7 +79,7 @@ public:
class PERS_FILE_XFER_SET {
FILE_XFER_SET* file_xfers;
public:
vector<PERS_FILE_XFER*>pers_file_xfers;
std::vector<PERS_FILE_XFER*>pers_file_xfers;
PERS_FILE_XFER_SET(FILE_XFER_SET*);
int insert(PERS_FILE_XFER*);

View File

@ -55,8 +55,8 @@ struct GLOBAL_PREFS {
int max_memory_mbytes;
int proc_priority;
int cpu_affinity;
string source_project;
string source_scheduler;
std::string source_project;
std::string source_scheduler;
GLOBAL_PREFS();
void init();

View File

@ -39,6 +39,8 @@
#include "log_flags.h"
#include "scheduler_op.h"
using std::vector;
extern void project_add_failed(PROJECT*);
SCHEDULER_OP::SCHEDULER_OP(HTTP_OP_SET* h) {

View File

@ -75,12 +75,12 @@ struct SCHEDULER_OP {
int init_op_project(double ns);
int init_master_fetch(PROJECT*);
int set_min_rpc_time(PROJECT*);
bool update_urls(PROJECT& project, vector<STRING256> &urls);
bool update_urls(PROJECT& project, std::vector<STRING256> &urls);
int start_op(PROJECT*);
bool check_master_fetch_start();
void backoff(PROJECT* p, char *error_msg);
int start_rpc();
int parse_master_file(vector<STRING256>&);
int parse_master_file(std::vector<STRING256>&);
};
struct SCHEDULER_REPLY {
@ -103,12 +103,12 @@ struct SCHEDULER_REPLY {
double user_expavg_credit;
char host_venue[256];
unsigned int user_create_time;
vector<APP> apps;
vector<FILE_INFO> file_infos;
vector<APP_VERSION> app_versions;
vector<WORKUNIT> workunits;
vector<RESULT> results;
vector<RESULT> result_acks;
std::vector<APP> apps;
std::vector<FILE_INFO> file_infos;
std::vector<APP_VERSION> app_versions;
std::vector<WORKUNIT> workunits;
std::vector<RESULT> results;
std::vector<RESULT> result_acks;
char* code_sign_key;
char* code_sign_key_signature;
bool trickle_up_ack;

View File

@ -108,7 +108,7 @@ int DB_BASE::lookup(char* clause) {
MYSQL_ROW row;
MYSQL_RES* rp;
if (mysql && is_high_priority) {
if (db->mysql && db->is_high_priority) {
sprintf(query, "select HIGH_PRIORITY * from %s %s", table_name, clause);
} else {
sprintf(query, "select * from %s %s", table_name, clause);
@ -136,7 +136,7 @@ int DB_BASE::lookup_id(int id) {
MYSQL_ROW row;
MYSQL_RES* rp;
if (mysql && is_high_priority) {
if (db->mysql && db->is_high_priority) {
sprintf(query, "select HIGH_PRIORITY * from %s where id=%d", table_name, id);
} else {
sprintf(query, "select * from %s where id=%d", table_name, id);
@ -163,7 +163,7 @@ int DB_BASE::enumerate(char* clause) {
if (!cursor.active) {
cursor.active = true;
if (mysql && is_high_priority) {
if (db->mysql && db->is_high_priority) {
sprintf(query, "select HIGH_PRIORITY * from %s %s", table_name, clause);
} else {
sprintf(query, "select * from %s %s", table_name, clause);
@ -232,7 +232,7 @@ int DB_BASE::get_double(char* query, double& x) {
int DB_BASE::count(int& n, char* clause) {
char query[MAX_QUERY_LEN];
if (mysql && is_high_priority) {
if (db->mysql && db->is_high_priority) {
sprintf(query, "select HIGH_PRIORITY count(*) from %s %s", table_name, clause);
} else {
sprintf(query, "select count(*) from %s %s", table_name, clause);
@ -244,7 +244,7 @@ int DB_BASE::count(int& n, char* clause) {
int DB_BASE::sum(double& x, char* field, char* clause) {
char query[MAX_QUERY_LEN];
if (mysql && is_high_priority) {
if (db->mysql && db->is_high_priority) {
sprintf(query, "select HIGH_PRIORITY sum(%s) from %s %s", field, table_name, clause);
} else {
sprintf(query, "select sum(%s) from %s %s", field, table_name, clause);

View File

@ -38,6 +38,7 @@ public:
int insert_id();
void print_error(char*);
const char* error_string();
bool is_high_priority;
MYSQL* mysql;
};
@ -59,7 +60,6 @@ public:
int sum(double&, char* field, char* clause="");
int get_double(char* query, double&);
int get_integer(char* query, int&);
bool is_high_priority;
DB_CONN* db;
const char *table_name;

View File

@ -34,6 +34,8 @@
#include "app_ipc.h"
using std::string;
char* xml_graphics_modes[NGRAPHICS_MODES] = {
"<mode_unsupported/>",
"<mode_hide_graphics/>",

View File

@ -23,6 +23,8 @@
#include "base64.h"
using std::string;
// Table of characters coding the 64 values.
static char base64_value_to_char[64] =
{

View File

@ -24,16 +24,15 @@
#include <cstdio>
#include <cstdlib>
#include <string>
using namespace std;
#endif
class InvalidBase64Exception
{
};
string r_base64_encode (const char* from, size_t length);
string r_base64_decode (const char* from, size_t length);
inline string r_base64_decode (string const& from)
std::string r_base64_encode (const char* from, size_t length);
std::string r_base64_decode (const char* from, size_t length);
inline std::string r_base64_decode (std::string const& from)
{
return r_base64_decode(from.c_str(), from.length());
}

View File

@ -111,8 +111,6 @@
#include <setjmp.h>
using namespace std;
#define vsnprintf _vsnprintf
#define snprintf _snprintf
#define fdopen _fdopen
@ -161,4 +159,4 @@ using namespace std;
#endif
#endif //_BOINC_WIN_
#endif //_BOINC_WIN_

View File

@ -22,8 +22,6 @@
#ifndef _WIN32
#include <string>
using namespace std;
using std::exception;
#endif
#include <exception>
@ -31,7 +29,7 @@ using std::exception;
// BOINC Base Exception Class
//
class boinc_base_exception : public exception
class boinc_base_exception : public std::exception
{
private:
@ -39,15 +37,15 @@ private:
// datatype is 64bits plus the
// possible sign character and the
// NULL terminator
string m_strErrorBuffer; // the formatted error message when
std::string m_strErrorBuffer; // the formatted error message when
// asked
string m_strErrorType; // the error type
std::string m_strErrorType; // the error type
long m_lErrorValue; // the error value
string m_strErrorMessage; // the error message
string m_strErrorData; // any relevant data associated with
std::string m_strErrorMessage; // the error message
std::string m_strErrorData; // any relevant data associated with
// the error
string m_strFilename; // the file in which the error occurred
std::string m_strFilename; // the file in which the error occurred
long m_lLineNumber; // the line number in which the error
// occurred

View File

@ -73,6 +73,8 @@ typedef BOOL (CALLBACK* FreeFn)(LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULAR
#include "fcgi_stdio.h"
#endif
using std::string;
char boinc_failed_file[256];
// routines for enumerating the entries in a directory

View File

@ -40,7 +40,6 @@ typedef DIR_DESC *DIRREF;
#include <stdio.h>
#include <string>
using std::string;
#ifdef HAVE_DIRENT_H
#include <dirent.h>
@ -57,7 +56,7 @@ typedef DIR *DIRREF;
//
extern DIRREF dir_open(const char*);
extern int dir_scan(char*, DIRREF, int);
int dir_scan(string&, DIRREF);
int dir_scan(std::string&, DIRREF);
extern void dir_close(DIRREF);
extern int boinc_delete_file(const char*);
@ -78,7 +77,7 @@ extern char boinc_failed_file[256];
class DirScanner {
#ifdef _WIN32
string dir;
std::string dir;
bool first;
void* handle;
#endif
@ -86,9 +85,9 @@ class DirScanner {
DIR* dirp;
#endif
public:
DirScanner(string const& path);
DirScanner(std::string const& path);
~DirScanner();
bool scan(string& name); // return true if file returned
bool scan(std::string& name); // return true if file returned
};
#endif

View File

@ -22,7 +22,6 @@
#ifndef _WIN32
#include <string>
using namespace std;
#endif
#include "mfile.h"
@ -58,6 +57,6 @@ private:
};
extern int copy_element_contents(MIOFILE& in, const char* end_tag, char* p, int len);
extern int copy_element_contents(MIOFILE& in, const char* end_tag, string&);
extern int copy_element_contents(MIOFILE& in, const char* end_tag, std::string&);
#endif

View File

@ -24,14 +24,13 @@
#include <cstdio>
#include <cstdlib>
#include <string>
using namespace std;
#endif
extern bool parse(char* , char* );
extern bool parse_int(const char* buf, const char*tag, int&);
extern bool parse_double(const char*, const char*, double&);
extern bool parse_str(const char*, const char*, char*, int);
extern bool parse_str(const char* buf, const char* tag, string& dest);
extern bool parse_str(const char* buf, const char* tag, std::string& dest);
extern void parse_attr(const char* buf, const char* attrname, char* out, int len);
extern bool match_tag(const char*, const char*);
extern bool match_tag(const std::string &, const char*);
@ -39,12 +38,12 @@ extern void copy_stream(FILE* in, FILE* out);
extern void strcatdup(char*& p, char* buf);
extern int dup_element_contents(FILE* in, const char* end_tag, char** pp);
extern int copy_element_contents(FILE* in, const char* end_tag, char* p, int len);
extern int copy_element_contents(FILE* in, const char* end_tag, string&);
extern int copy_element_contents(FILE* in, const char* end_tag, std::string&);
extern int read_file_malloc(const char* pathname, char*& str);
extern void replace_element(char* buf, char* start, char* end, char* replacement);
extern char* sgets(char* buf, int len, char* &in);
extern void xml_escape(string&, string&);
extern void xml_unescape(string&, string&);
extern void xml_escape(std::string&, std::string&);
extern void xml_unescape(std::string&, std::string&);
extern void extract_venue(char*, char*, char*);
#endif

View File

@ -28,7 +28,6 @@
#include <cstring>
#include <algorithm>
#include <string>
using namespace std;
#endif
#if !defined(HAVE_STRLCPY)
@ -47,7 +46,7 @@ extern int parse_command_line( char *, char ** );
extern int lock_file(char*);
extern void c2x(char *what);
extern void strip_whitespace(char *str);
extern void strip_whitespace(string&);
extern void strip_whitespace(std::string&);
extern void unescape_url(char *url);
extern void escape_url(char *in, char*out);
extern void escape_url_readable(char* in, char* out);
@ -56,27 +55,27 @@ extern void safe_strncpy(char*, const char*, int);
#define safe_strcpy(x, y) safe_strncpy(x, y, sizeof(x))
#define safe_strcat(x, y) if (strlen(x)+strlen(y)<sizeof(x)) strcat(x, y)
extern char* time_to_string(time_t);
string timediff_format(long tdiff);
int read_file_string(const char* pathname, string& result);
std::string timediff_format(long tdiff);
int read_file_string(const char* pathname, std::string& result);
inline bool ends_with(string const& s, string const& suffix) {
inline bool ends_with(std::string const& s, std::string const& suffix) {
return
s.size()>=suffix.size() &&
s.substr(s.size()-suffix.size()) == suffix;
}
inline bool starts_with(string const& s, string const& prefix) {
inline bool starts_with(std::string const& s, std::string const& prefix) {
return s.substr(0, prefix.size()) == prefix;
}
// http://lists.debian.org/debian-gcc/2002/debian-gcc-200204/msg00092.html
inline void downcase_string(
string::iterator begin, string::iterator end, string::iterator src
std::string::iterator begin, std::string::iterator end, std::string::iterator src
) {
std::transform(begin, end, src, (int(*)(int))tolower);
}
inline void downcase_string(string& w) {
inline void downcase_string(std::string& w) {
downcase_string(w.begin(), w.end(), w.begin());
}

View File

@ -5,6 +5,8 @@
#include "sched_util.h"
#include "assimilate_handler.h"
using std::vector;
void assimilate_handler(
WORKUNIT& wu, vector<RESULT>& results, RESULT& canonical_result
) {

View File

@ -1,5 +1,4 @@
#include <vector>
#include "boinc_db.h"
using namespace std;
extern void assimilate_handler(WORKUNIT&, vector<RESULT>&, RESULT&);
extern void assimilate_handler(WORKUNIT&, std::vector<RESULT>&, RESULT&);

View File

@ -34,6 +34,8 @@
#include "sched_msgs.h"
#include "assimilate_handler.h"
using std::vector;
#define LOCKFILE "assimilator.out"
#define PIDFILE "assimilator.pid"

View File

@ -59,6 +59,9 @@
#include "sched_util.h"
#include "sched_msgs.h"
using std::string;
using std::vector;
#define LOCKFILE "db_dump.out"
#define COMPRESSION_NONE 0

View File

@ -71,7 +71,7 @@ void handle_wu(DB_WORKUNIT& wu) {
// set the query priority to high so the transitioner can move through
// even high loads
//
result.is_high_priority = true;
result.db->is_high_priority = true;
sprintf(buf, "where workunitid=%d", wu.id);
while (!result.enumerate(buf)) {
@ -368,7 +368,7 @@ bool do_pass() {
// set the query priority to high so the transitioner can move through
// even high loads
//
wu.is_high_priority = true;
wu.db->is_high_priority = true;
// loop over WUs that are due to be checked
//

View File

@ -22,11 +22,14 @@
#include "sched_msgs.h"
#include "validate_util.h"
using std::string;
using std::vector;
// TODO: use md5 hash
// read file into memory
//
int init_result_read_file(RESULT const& result, void*& data) {
int init_result_read_file(RESULT const & result, void*& data) {
int retval;
string path;

View File

@ -22,6 +22,8 @@
#include "validate_util.h"
using std::vector;
static const double MIN_CPU_TIME = 10000;
// TODO: use md5 hash

View File

@ -32,6 +32,9 @@
#include "sched_msgs.h"
#include "validate_util.h"
using std::vector;
using std::string;
extern SCHED_CONFIG config;
// get the name of a result's (first) output file

View File

@ -23,17 +23,15 @@
#include "boinc_db.h"
#include <vector>
#include <string>
using std::vector;
using std::string;
typedef int (*init_result_f)(RESULT const&, void*&);
typedef int (*check_pair_with_data_f)(RESULT const&, void*, RESULT const&, void*, bool&);
typedef int (*cleanup_result_f)(RESULT const&, void*);
extern int get_output_file_path(RESULT const& result, string& path);
extern double median_mean_credit(vector<RESULT> const& results);
extern int get_output_file_path(RESULT const& result, std::string& path);
extern double median_mean_credit(std::vector<RESULT> const& results);
int generic_check_set_majority(
vector<RESULT>& results, int& canonicalid, double& credit,
std::vector<RESULT>& results, int& canonicalid, double& credit,
init_result_f init_result_f,
check_pair_with_data_f check_pair_with_data_f,
cleanup_result_f cleanup_result_f