CSignal类参考


详细描述

Class Signal implements signal handling to e.g. allow ctrl+c to cancel a long running process.

This is done in two ways:

  1. A signal handler is attached to trap the SIGINT and SIGURG signal. Pressing ctrl+c or sending the SIGINT (kill ...) signal to the shogun process will make shogun print a message asking to immediately exit the running method and to fall back to the command line.
  2. When an URG signal is received or ctrl+c P is pressed shogun will prematurely stop a method and continue execution. For example when an SVM solver takes a long time without progressing much, one might still be interested in the result and should thus send SIGURG or interactively prematurely stop the method

在文件Signal.h47行定义。

继承图,类CSignal
Inheritance graph
[图例]

所有成员的列表。

公有成员

 CSignal ()
virtual ~CSignal ()
virtual const char * get_name () const

静态公有成员

static void handler (int signal)
static bool set_handler ()
static bool unset_handler ()
static void clear ()
static void clear_cancel ()
static void set_cancel (bool immediately=false)
static bool cancel_computations ()

静态保护属性

static int signals [NUMTRAPPEDSIGS] = {SIGINT, SIGURG}
static struct sigaction oldsigaction [NUMTRAPPEDSIGS]
static bool active = false
static bool cancel_computation = false
static bool cancel_immediately = false

构造及析构函数文档

CSignal (  ) 

default constructor

在文件Signal.cpp30行定义。

~CSignal (  )  [virtual]

在文件Signal.cpp35行定义。


成员函数文档

static bool cancel_computations (  )  [static]

cancel computations

返回:
if computations should be cancelled

在文件Signal.h85行定义。

void clear (  )  [static]

clear signals

在文件Signal.cpp142行定义。

void clear_cancel (  )  [static]

clear cancel flag signals

在文件Signal.cpp128行定义。

virtual const char* get_name (  )  const [virtual]
返回:
object name

实现了CSGObject

在文件Signal.h98行定义。

void handler ( int  signal  )  [static]

handler

参数:
signal signal number

在文件Signal.cpp41行定义。

void set_cancel ( bool  immediately = false  )  [static]

set cancel flag signals

在文件Signal.cpp134行定义。

bool set_handler (  )  [static]

set handler

返回:
if setting was successful

在文件Signal.cpp66行定义。

bool unset_handler (  )  [static]

unset handler

返回:
if unsetting was successful

在文件Signal.cpp104行定义。


成员数据文档

bool active = false [static, read, protected]

active signal

在文件Signal.h108行定义。

bool cancel_computation = false [static, protected]

if computation should be cancelled

在文件Signal.h111行定义。

bool cancel_immediately = false [static, protected]

if shogun should return ASAP

在文件Signal.h114行定义。

struct sigaction oldsigaction[NUMTRAPPEDSIGS] [static, read, protected]

signal actions

在文件Signal.h105行定义。

int signals = {SIGINT, SIGURG} [static, protected]

signals; handling external lib

在文件Signal.h102行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation