Back to index

nordugrid-arc-nox  1.1.0~rc6
Classes | Functions | Variables
run_parallel.cpp File Reference
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <arc/Logger.h>
#include <arc/Utils.h>
#include "../conf/environment.h"
#include "run_parallel.h"

Go to the source code of this file.

Classes

struct  job_subst_t

Functions

static void job_subst (std::string &str, void *arg)

Variables

static Arc::Loggerlogger = Arc::Logger::getRootLogger()

Class Documentation

struct job_subst_t

Definition at line 16 of file run_parallel.cpp.

Collaboration diagram for job_subst_t:
Class Members
const JobDescription * job
const char * reason
const JobUser * user

Function Documentation

static void job_subst ( std::string &  str,
void *  arg 
) [static]

Definition at line 27 of file run_parallel.cpp.

                                                {
  job_subst_t* subs = (job_subst_t*)arg;
  for(std::string::size_type p = 0;;) {
    p=str.find('%',p);
    if(p==std::string::npos) break;
    if(str[p+1]=='I') {
      str.replace(p,2,subs->job->get_id().c_str());
      p+=subs->job->get_id().length();
    } else if(str[p+1]=='S') {
      str.replace(p,2,subs->job->get_state_name());
      p+=strlen(subs->job->get_state_name());
    } else if(str[p+1]=='O') {
      str.replace(p,2,subs->reason);
      p+=strlen(subs->reason);
    } else {
      p+=2;
    };
  };
  subs->user->substitute(str);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 22 of file run_parallel.cpp.