8#ifndef OM_H_MODEL_RUN_STATE_H
9#define OM_H_MODEL_RUN_STATE_H
openM++ namespace
Definition: log.h:32
@ undefined
undefined function
ExitStatus
model exit status
Definition: omModelRunState.h:18
@ HELPER_ERROR
helper exception: low level error from openM++ runtime
@ MSG_ERROR
messaging exception: message passing (MPI) error
@ DB_ERROR
database exception: database error from openM++ runtime or database vendor
@ MODEL_ERROR
model exception: top level error from openM++ runtime
@ OK
completed successfully
@ SIMULATION_ERROR
simulation exception raised in model code
ModelStatus
modeling job status
Definition: omModelRunState.h:43
@ progress
run in progress
@ shutdown
shutdown model process
@ done
completed successfully
@ waitProgress
run in progress, under external supervision
@ exit
exit and not completed (reserved)
OpenM++ common helper utilities.
final model run state public interface: thread safe
Definition: omHelper.h:246
model run state public interface: thread safe
Definition: omModelRunState.h:139
virtual void updateProgress(int i_count, double i_value=0.0)=0
set modeling progress count and value
virtual ModelStatus updateStatus(ModelStatus i_status)=0
set model status if not already set as one of final status values
virtual bool isShutdownOrFinal(void)=0
return true if model in shutdown state: modeling completed or one of exiting
virtual RunState get(void)=0
return model run state data
virtual ModelStatus status(void)=0
get model status
db-row abstract base
Definition: omHelper.h:231
model run state data: status, progress, update times
Definition: omModelRunState.h:93
RunState(void)
initialize model run state data with default values
Definition: modelRunState.cpp:40
static bool isError(ModelStatus i_status)
return true if status is an error
Definition: omModelRunState.h:119
static ModelStatus fromRunStatus(const std::string &i_runStatus)
convert run status to model status code
Definition: modelRunState.cpp:54
static std::string toRunStatus(ModelStatus i_modelStatus)
convert model status to run status code
Definition: modelRunState.cpp:67
std::chrono::system_clock::time_point startTime
process start time
Definition: omModelRunState.h:104
void setProgress(int i_count, double i_value)
set modeling progress count and value
Definition: modelRunState.cpp:81
ModelStatus setStatus(ModelStatus i_status)
set model status if not already set as one of final status values
Definition: modelRunState.cpp:96
double progressValue
progress value: number of cases or time completed
Definition: omModelRunState.h:101
ModelStatus theStatus
current status
Definition: omModelRunState.h:95
int progressCount
progress count, usually percent completed
Definition: omModelRunState.h:98
std::chrono::system_clock::time_point updateTime
last update time
Definition: omModelRunState.h:107
static bool isFinal(ModelStatus i_status)
return true if status is one of exiting: ie done, exit, error
Definition: omModelRunState.h:116
bool operator==(const RunState &i_other) const
check if two run states are equal: state, progress and update times are equal
Definition: modelRunState.cpp:46
static bool isShutdownOrFinal(ModelStatus i_status)
return true if model in shutdown state: modeling completed or one of exiting
Definition: omModelRunState.h:122
run state data for sub-value identified by run id and sub-value id
Definition: omModelRunState.h:160
RunStateItem(int i_runId, int i_subId, const RunState i_state)
initialize run state data for sub-value
Definition: omModelRunState.h:171
RunState state
run state data for the sub-value
Definition: omModelRunState.h:168
int subId
sub-value id
Definition: omModelRunState.h:165
int runId
if >0 then model run id
Definition: omModelRunState.h:162
model run status codes
Definition: omModelRunState.h:71
static const char * waitProgress
w = wait: run in progress, under external supervision
Definition: omModelRunState.h:79
static const char * init
i = initial status
Definition: omModelRunState.h:73
static const char * done
s = completed successfully
Definition: omModelRunState.h:82
static const char * error
e = error failure
Definition: omModelRunState.h:88
static const char * progress
p = run in progress
Definition: omModelRunState.h:76
static const char * exit
x = exit and not completed (reserved)
Definition: omModelRunState.h:85