SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
所有成员列表 | Public 成员函数 | 静态 Public 成员函数 | Protected 成员函数 | Protected 属性 | 静态 Protected 属性
SGIO类 参考

详细描述

Class SGIO, used to do input output operations throughout shogun.

Any debug or error or progress message is passed through the functions of this class to be in the end written to the screen. Note that messages don't have to be written to stdout or stderr, but can be redirected to a file.

在文件 SGIO.h243 行定义.

Public 成员函数

 SGIO ()
 
 SGIO (const SGIO &orig)
 
virtual ~SGIO ()
 
void set_loglevel (EMessageType level)
 
EMessageType get_loglevel () const
 
bool loglevel_above (EMessageType type) const
 
bool get_show_progress () const
 
EMessageLocation get_location_info () const
 
bool get_syntax_highlight () const
 
void message (EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
 
void progress (float64_t current_val, float64_t min_val=0.0, float64_t max_val=1.0, int32_t decimals=1, const char *prefix="PROGRESS:\t")
 
void absolute_progress (float64_t current_val, float64_t val, float64_t min_val=0.0, float64_t max_val=1.0, int32_t decimals=1, const char *prefix="PROGRESS:\t")
 
void done ()
 
void not_implemented (const char *function, const char *file, int32_t line) const
 
void deprecated (const char *function, const char *file, int32_t line) const
 
void buffered_message (EMessageType prio, const char *fmt,...) const
 
FILE * get_target () const
 
void set_target (FILE *target)
 
void set_target_to_stderr ()
 
void set_target_to_stdout ()
 
void enable_progress ()
 
void disable_progress ()
 
void set_location_info (EMessageLocation location)
 
void enable_syntax_highlighting ()
 
void disable_syntax_highlighting ()
 
int32_t ref ()
 
int32_t ref_count () const
 
int32_t unref ()
 
const char * get_name ()
 

静态 Public 成员函数

static char * skip_spaces (char *str)
 
static char * skip_blanks (char *str)
 
static void set_dirname (const char *dirname)
 
static char * concat_filename (const char *filename)
 
static int filter (CONST_DIRENT_T *d)
 
static char * c_string_of_substring (substring s)
 
static void print_substring (substring s)
 
static float32_t float_of_substring (substring s)
 
static float64_t double_of_substring (substring s)
 
static int32_t int_of_substring (substring s)
 
static uint32_t ulong_of_substring (substring s)
 
static uint32_t ss_length (substring s)
 

Protected 成员函数

const char * get_msg_intro (EMessageType prio) const
 

Protected 属性

FILE * target
 
float64_t last_progress_time
 
float64_t progress_start_time
 
float64_t last_progress
 
bool show_progress
 
EMessageLocation location_info
 
bool syntax_highlight
 
EMessageType loglevel
 

静态 Protected 属性

static const EMessageType levels [NUM_LOG_LEVELS]
 
static const char * message_strings_highlighted [NUM_LOG_LEVELS]
 
static const char * message_strings [NUM_LOG_LEVELS]
 
static char file_buffer [FBUFSIZE]
 file name buffer 更多...
 
static char directory_name [FBUFSIZE]
 directory name buffer 更多...
 

构造及析构函数说明

SGIO ( )

default constructor

在文件 SGIO.cpp47 行定义.

SGIO ( const SGIO orig)

copy constructor

在文件 SGIO.cpp55 行定义.

~SGIO ( )
virtual

destructor

在文件 SGIO.cpp401 行定义.

成员函数说明

void absolute_progress ( float64_t  current_val,
float64_t  val,
float64_t  min_val = 0.0,
float64_t  max_val = 1.0,
int32_t  decimals = 1,
const char *  prefix = "PROGRESS:\t" 
)

print absolute progress bar

参数
current_valcurrent value
valvalue
min_valminimum value
max_valmaximum value
decimalsdecimals
prefixmessage prefix

在文件 SGIO.cpp198 行定义.

void buffered_message ( EMessageType  prio,
const char *  fmt,
  ... 
) const

print a buffered message

参数
priomessage priority
fmtformat string

在文件 SGIO.cpp133 行定义.

char * c_string_of_substring ( substring  s)
static

Return a C string from the substring

参数
ssubstring
返回
new C string representation

在文件 SGIO.cpp321 行定义.

char * concat_filename ( const char *  filename)
static

concatenate directory and filename ( non thread safe )

参数
filenamenew filename
返回
concatenated directory and filename

在文件 SGIO.cpp375 行定义.

void deprecated ( const char *  function,
const char *  file,
int32_t  line 
) const

print warning message 'function deprecated'

在文件 SGIO.h355 行定义.

void disable_progress ( )

disable progress bar

在文件 SGIO.h414 行定义.

void disable_syntax_highlighting ( )

disable syntax highlighting

在文件 SGIO.h446 行定义.

void done ( )

print 'done' with priority INFO, but only if progress bar is enabled

在文件 SGIO.cpp249 行定义.

float64_t double_of_substring ( substring  s)
static

Return value of substring as double

参数
ssubstring
返回
substring as double

在文件 SGIO.cpp346 行定义.

void enable_progress ( )

enable progress bar

在文件 SGIO.h404 行定义.

void enable_syntax_highlighting ( )

enable syntax highlighting

在文件 SGIO.h437 行定义.

int filter ( CONST_DIRENT_T d)
static

filter

参数
ddirectory entry
返回
1 if d is a readable file

在文件 SGIO.cpp384 行定义.

float32_t float_of_substring ( substring  s)
static

Get value of substring as float (if possible)

参数
ssubstring
返回
float32_t value of substring

在文件 SGIO.cpp336 行定义.

EMessageLocation get_location_info ( ) const

show location where printing occurs

在文件 SGIO.h287 行定义.

EMessageType get_loglevel ( ) const

get loglevel

返回
level of log messages

在文件 SGIO.cpp285 行定义.

const char * get_msg_intro ( EMessageType  prio) const
protected

get message intro

参数
priomessage priority
返回
message intro or NULL if message is not to be printed

在文件 SGIO.cpp300 行定义.

const char* get_name ( )
返回
object name

在文件 SGIO.h547 行定义.

bool get_show_progress ( ) const

get show_progress

返回
if progress bar is shown

在文件 SGIO.h280 行定义.

bool get_syntax_highlight ( ) const

get syntax highlight

返回
if syntax highlighting is enabled

在文件 SGIO.h296 行定义.

FILE* get_target ( ) const

get target

返回
file descriptor for target

在文件 SGIO.h386 行定义.

int32_t int_of_substring ( substring  s)
static

Integer value of substring

参数
ssubstring
返回
int value of substring

在文件 SGIO.cpp356 行定义.

bool loglevel_above ( EMessageType  type) const

loglevel above

返回
whether loglevel is above specified level and thus the message should be printed

在文件 SGIO.h271 行定义.

void message ( EMessageType  prio,
const char *  function,
const char *  file,
int32_t  line,
const char *  fmt,
  ... 
) const

print a message

optionally prefixed with file name and line number from (use -1 in line to disable this)

参数
priomessage priority
functionthe function name from where the message is called
filefile name from where the message is called
lineline number from where the message is called
fmtformat string

在文件 SGIO.cpp66 行定义.

void not_implemented ( const char *  function,
const char *  file,
int32_t  line 
) const

print error message 'not implemented'

在文件 SGIO.h349 行定义.

void print_substring ( substring  s)
static

Print the substring

参数
ssubstring

在文件 SGIO.cpp329 行定义.

void progress ( float64_t  current_val,
float64_t  min_val = 0.0,
float64_t  max_val = 1.0,
int32_t  decimals = 1,
const char *  prefix = "PROGRESS:\t" 
)

print progress bar

参数
current_valcurrent value
min_valminimum value
max_valmaximum value
decimalsdecimals
prefixmessage prefix

在文件 SGIO.cpp147 行定义.

int32_t ref ( )

increase reference counter

返回
reference count

在文件 SGIO.cpp406 行定义.

int32_t ref_count ( ) const

display reference counter

返回
reference count

在文件 SGIO.cpp411 行定义.

static void set_dirname ( const char *  dirname)
static

set directory name

参数
dirnamenew directory name

在文件 SGIO.h458 行定义.

void set_location_info ( EMessageLocation  location)

enable displaying of file and line when printing messages etc

参数
locationlocation info (none, function, ...)

在文件 SGIO.h428 行定义.

void set_loglevel ( EMessageType  level)

set loglevel

参数
levellevel of log messages

在文件 SGIO.cpp290 行定义.

void set_target ( FILE *  target)

set target

参数
targetfile descriptor for target

在文件 SGIO.cpp295 行定义.

void set_target_to_stderr ( )

set target to stderr

在文件 SGIO.h398 行定义.

void set_target_to_stdout ( )

set target to stdout

在文件 SGIO.h401 行定义.

char * skip_blanks ( char *  str)
static

skip leading spaces + tabs

参数
strstring in which to look for blanks
返回
string after after skipping leading blanks

在文件 SGIO.cpp271 行定义.

char * skip_spaces ( char *  str)
static

skip leading spaces

参数
strstring in which to look for spaces
返回
string after after skipping leading spaces

在文件 SGIO.cpp257 行定义.

uint32_t ss_length ( substring  s)
static

Length of substring

参数
ssubstring
返回
length of substring

在文件 SGIO.cpp370 行定义.

uint32_t ulong_of_substring ( substring  s)
static

Unsigned long value of substring

参数
ssubstring
返回
unsigned long value of substring

在文件 SGIO.cpp365 行定义.

int32_t unref ( )

decrement reference counter and deallocate object if refcount is zero before or after decrementing it

返回
reference count

在文件 SGIO.cpp416 行定义.

类成员变量说明

char directory_name
staticprotected

directory name buffer

directory name (for filter function)

在文件 SGIO.h587 行定义.

char file_buffer
staticprotected

file name buffer

file buffer

在文件 SGIO.h585 行定义.

float64_t last_progress
protected

last progress

在文件 SGIO.h566 行定义.

float64_t last_progress_time
protected

last progress time

在文件 SGIO.h562 行定义.

const EMessageType levels
staticprotected
初始值:

available log levels

在文件 SGIO.h578 行定义.

EMessageLocation location_info
protected

if each print function should append filename and linenumber of where the print occurs etc

在文件 SGIO.h571 行定义.

EMessageType loglevel
protected

log level

在文件 SGIO.h576 行定义.

const char * message_strings
staticprotected
初始值:
={"[GCDEBUG] \0", "[DEBUG] \0", "[INFO] \0",
"[NOTICE] \0", "[WARN] \0", "[ERROR] \0",
"[CRITICAL] \0", "[ALERT] \0", "[EMERGENCY] \0", "\0"}

message strings

在文件 SGIO.h582 行定义.

const char * message_strings_highlighted
staticprotected
初始值:
={"[GCDEBUG] \0", "[DEBUG] \0", "[INFO] \0",
"[NOTICE] \0", "\033[1;34m[WARN]\033[0m \0", "\033[1;31m[ERROR]\033[0m \0",
"[CRITICAL] \0", "[ALERT] \0", "[EMERGENCY] \0", "\0"}

message strings syntax highlighted

在文件 SGIO.h580 行定义.

float64_t progress_start_time
protected

progress start time

在文件 SGIO.h564 行定义.

bool show_progress
protected

if progress bar shall be shown

在文件 SGIO.h568 行定义.

bool syntax_highlight
protected

whether syntax highlighting is enabled

在文件 SGIO.h573 行定义.

FILE* target
protected

target file

在文件 SGIO.h560 行定义.


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

SHOGUN 机器学习工具包 - 项目文档