Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
Arc::JobStateARC0 Class Reference

#include <JobStateARC0.h>

Inheritance diagram for Arc::JobStateARC0:
Inheritance graph
[legend]
Collaboration diagram for Arc::JobStateARC0:
Collaboration graph
[legend]

List of all members.

Public Types

enum  StateType { JOBSTATE_TABLE }

Public Member Functions

 JobStateARC0 (const std::string &state)
 operator bool () const
bool operator! () const
bool operator== (const StateType &st) const
bool operator!= (const StateType &st) const
bool IsFinished () const
std::string operator() () const
std::string GetGeneralState () const

Static Public Member Functions

static JobState::StateType StateMap (const std::string &state)

Static Public Attributes

static const std::string StateTypeString [] = { JOBSTATE_TABLE }

Detailed Description

Definition at line 8 of file JobStateARC0.h.


Member Enumeration Documentation

enum Arc::JobState::StateType [inherited]
Enumerator:
JOBSTATE_TABLE 

Definition at line 48 of file JobState.h.


Constructor & Destructor Documentation

Arc::JobStateARC0::JobStateARC0 ( const std::string &  state) [inline]

Definition at line 11 of file JobStateARC0.h.


Member Function Documentation

std::string Arc::JobState::GetGeneralState ( ) const [inline, inherited]

Definition at line 65 of file JobState.h.

{ return StateTypeString[type]; }

Here is the caller graph for this function:

bool Arc::JobState::IsFinished ( ) const [inline, inherited]

Definition at line 61 of file JobState.h.

{ return type == FINISHED || type == KILLED || type == FAILED || type == DELETED; }
Arc::JobState::operator bool ( void  ) const [inline, inherited]

Definition at line 56 of file JobState.h.

{ return type != UNDEFINED; }
bool Arc::JobState::operator! ( void  ) const [inline, inherited]

Definition at line 57 of file JobState.h.

{ return type == UNDEFINED; }
bool Arc::JobState::operator!= ( const StateType st) const [inline, inherited]

Definition at line 59 of file JobState.h.

{ return type != st; }
std::string Arc::JobState::operator() ( ) const [inline, inherited]

Definition at line 63 of file JobState.h.

{ return state; }
bool Arc::JobState::operator== ( const StateType st) const [inline, inherited]

Definition at line 58 of file JobState.h.

{ return type == st; }
JobState::StateType Arc::JobStateARC0::StateMap ( const std::string &  state) [static]

Definition at line 9 of file JobStateARC0.cpp.

                                                                 {
    std::string state_ = state;
/*
   Infosys states (mapped from GM states):
 ACCEPTING
 ACCEPTED
 PREPARED
 SUBMITTING
 INLRMS: *
 KILLING
 EXECUTED
 KILLED
 FAILED

   GM states (either not mapped or somehow obtained directly):
 ACCEPTED 
 PREPARING
 SUBMIT
 INLRMS
 CANCELING
 FINISHING
 FINISHED
 DELETED
 PENDING:*
*/
    if (state_.substr(0,8) == "PENDING:") state_.erase(0,8);
    // remove spaces because sometimes we may have 'INLRMS: *'
    std::string::size_type p = 0;
    while((p = state_.find(' ',p)) != std::string::npos)
      state_.erase(p,1);
    if ((state_ == "ACCEPTED") ||
        (state_ == "ACCEPTING"))
      return JobState::ACCEPTED;
    else if ((state_ == "PREPARING") ||
             (state_ == "PREPARED"))
      return JobState::PREPARING;
    else if ((state_ == "SUBMIT") ||
             (state_ == "SUBMITTING"))
      return JobState::SUBMITTING;
    else if (state_ == "INLRMS:Q")
      return JobState::QUEUING;
    else if (state_ == "INLRMS:R")
      return JobState::RUNNING;
    else if (state_ == "INLRMS:H")
      return JobState::HOLD;
    else if (state_.substr(0,6) == "INLRMS")
      return JobState::QUEUING; // expect worst ?
    else if ((state_ == "FINISHING") ||
             (state_ == "KILLING") ||
             (state_ == "CANCELING") ||
             (state_ == "EXECUTED"))
      return JobState::FINISHING;
    else if (state_ == "FINISHED")
      return JobState::FINISHED;
    else if (state_ == "KILLED")
      return JobState::KILLED;
    else if (state_ == "FAILED")
      return JobState::FAILED;
    else if (state_ == "DELETED")
      return JobState::DELETED;
    else if (state_ == "")
      return JobState::UNDEFINED;
    else
      return JobState::OTHER;
  }

Member Data Documentation

const std::string Arc::JobState::StateTypeString = { JOBSTATE_TABLE } [static, inherited]

Definition at line 50 of file JobState.h.


The documentation for this class was generated from the following files: