Back to index

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

ARC general state model. More...

#include <JobState.h>

Inheritance diagram for Arc::JobState:
Inheritance graph
Collaboration diagram for Arc::JobState:
Collaboration graph

List of all members.

Public Types

enum  StateType { JOBSTATE_TABLE }

Public Member Functions

 JobState ()
JobStateoperator= (const JobState &newState)
 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 Attributes

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

Protected Member Functions

 JobState (const std::string &state, JobState::StateType(*map)(const std::string &))

Private Attributes

std::string state
StateType type

Detailed Description

ARC general state model.

The class comprise the general state model of the ARC-lib, and are herein used to compare job states from the different middlewares supported by the plugin structure of the ARC-lib. Which is why every ACC plugin should contain a class derived from this class. The derived class should consist of a constructor and a mapping function (a JobStateMap) which maps a std::string to a JobState:StateType. An example of a constructor in a plugin could be: JobStatePlugin::JobStatePluging(const std::string& state) : JobState(state, &pluginStateMap) {} where &pluginStateMap is a reference to the JobStateMap defined by the derived class.

Definition at line 30 of file JobState.h.

Member Enumeration Documentation


Definition at line 48 of file JobState.h.

Constructor & Destructor Documentation

Definition at line 52 of file JobState.h.

: type(UNDEFINED) {}
Arc::JobState::JobState ( const std::string &  state,
JobState::StateType(*)(const std::string &)  map 
) [inline, protected]

Definition at line 68 of file JobState.h.

      : state(state), type((*map)(state)) {};

Member Function Documentation

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

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]

Definition at line 61 of file JobState.h.

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

Definition at line 56 of file JobState.h.

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

Definition at line 57 of file JobState.h.

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

Definition at line 59 of file JobState.h.

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

Definition at line 63 of file JobState.h.

{ return state; }
JobState& Arc::JobState::operator= ( const JobState newState) [inline]

Definition at line 54 of file JobState.h.

{ type = newState.type; state = newState.state; return *this; }
bool Arc::JobState::operator== ( const StateType st) const [inline]

Definition at line 58 of file JobState.h.

{ return type == st; }

Member Data Documentation

std::string Arc::JobState::state [private]

Definition at line 69 of file JobState.h.

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

Definition at line 50 of file JobState.h.

Definition at line 73 of file JobState.h.

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