SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
所有成员列表 | 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.h244 行定义.

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.cpp48 行定义.

SGIO ( const SGIO orig)

copy constructor

在文件 SGIO.cpp56 行定义.

~SGIO ( )
virtual

destructor

在文件 SGIO.cpp402 行定义.

成员函数说明

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.cpp199 行定义.

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

print a buffered message

参数
priomessage priority
fmtformat string

在文件 SGIO.cpp134 行定义.

char * c_string_of_substring ( substring  s)
static

Return a C string from the substring

参数
ssubstring
返回
new C string representation

在文件 SGIO.cpp322 行定义.

char * concat_filename ( const char *  filename)
static

concatenate directory and filename ( non thread safe )

参数
filenamenew filename
返回
concatenated directory and filename

在文件 SGIO.cpp376 行定义.

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

print warning message 'function deprecated'

在文件 SGIO.h356 行定义.

void disable_progress ( )

disable progress bar

在文件 SGIO.h415 行定义.

void disable_syntax_highlighting ( )

disable syntax highlighting

在文件 SGIO.h447 行定义.

void done ( )

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

在文件 SGIO.cpp250 行定义.

float64_t double_of_substring ( substring  s)
static

Return value of substring as double

参数
ssubstring
返回
substring as double

在文件 SGIO.cpp347 行定义.

void enable_progress ( )

enable progress bar

在文件 SGIO.h405 行定义.

void enable_syntax_highlighting ( )

enable syntax highlighting

在文件 SGIO.h438 行定义.

int filter ( CONST_DIRENT_T d)
static

filter

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

在文件 SGIO.cpp385 行定义.

float32_t float_of_substring ( substring  s)
static

Get value of substring as float (if possible)

参数
ssubstring
返回
float32_t value of substring

在文件 SGIO.cpp337 行定义.

EMessageLocation get_location_info ( ) const

show location where printing occurs

在文件 SGIO.h288 行定义.

EMessageType get_loglevel ( ) const

get loglevel

返回
level of log messages

在文件 SGIO.cpp286 行定义.

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.cpp301 行定义.

const char* get_name ( )
返回
object name

在文件 SGIO.h548 行定义.

bool get_show_progress ( ) const

get show_progress

返回
if progress bar is shown

在文件 SGIO.h281 行定义.

bool get_syntax_highlight ( ) const

get syntax highlight

返回
if syntax highlighting is enabled

在文件 SGIO.h297 行定义.

FILE* get_target ( ) const

get target

返回
file descriptor for target

在文件 SGIO.h387 行定义.

int32_t int_of_substring ( substring  s)
static

Integer value of substring

参数
ssubstring
返回
int value of substring

在文件 SGIO.cpp357 行定义.

bool loglevel_above ( EMessageType  type) const

loglevel above

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

在文件 SGIO.h272 行定义.

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.cpp67 行定义.

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

print error message 'not implemented'

在文件 SGIO.h350 行定义.

void print_substring ( substring  s)
static

Print the substring

参数
ssubstring

在文件 SGIO.cpp330 行定义.

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.cpp148 行定义.

int32_t ref ( )

increase reference counter

返回
reference count

在文件 SGIO.cpp407 行定义.

int32_t ref_count ( ) const

display reference counter

返回
reference count

在文件 SGIO.cpp412 行定义.

static void set_dirname ( const char *  dirname)
static

set directory name

参数
dirnamenew directory name

在文件 SGIO.h459 行定义.

void set_location_info ( EMessageLocation  location)

enable displaying of file and line when printing messages etc

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

在文件 SGIO.h429 行定义.

void set_loglevel ( EMessageType  level)

set loglevel

参数
levellevel of log messages

在文件 SGIO.cpp291 行定义.

void set_target ( FILE *  target)

set target

参数
targetfile descriptor for target

在文件 SGIO.cpp296 行定义.

void set_target_to_stderr ( )

set target to stderr

在文件 SGIO.h399 行定义.

void set_target_to_stdout ( )

set target to stdout

在文件 SGIO.h402 行定义.

char * skip_blanks ( char *  str)
static

skip leading spaces + tabs

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

在文件 SGIO.cpp272 行定义.

char * skip_spaces ( char *  str)
static

skip leading spaces

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

在文件 SGIO.cpp258 行定义.

uint32_t ss_length ( substring  s)
static

Length of substring

参数
ssubstring
返回
length of substring

在文件 SGIO.cpp371 行定义.

uint32_t ulong_of_substring ( substring  s)
static

Unsigned long value of substring

参数
ssubstring
返回
unsigned long value of substring

在文件 SGIO.cpp366 行定义.

int32_t unref ( )

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

返回
reference count

在文件 SGIO.cpp417 行定义.

类成员变量说明

char directory_name
staticprotected

directory name buffer

directory name (for filter function)

在文件 SGIO.h588 行定义.

char file_buffer
staticprotected

file name buffer

file buffer

在文件 SGIO.h586 行定义.

float64_t last_progress
protected

last progress

在文件 SGIO.h567 行定义.

float64_t last_progress_time
protected

last progress time

在文件 SGIO.h563 行定义.

const EMessageType levels
staticprotected
初始值:

available log levels

在文件 SGIO.h579 行定义.

EMessageLocation location_info
protected

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

在文件 SGIO.h572 行定义.

EMessageType loglevel
protected

log level

在文件 SGIO.h577 行定义.

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.h583 行定义.

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.h581 行定义.

float64_t progress_start_time
protected

progress start time

在文件 SGIO.h565 行定义.

bool show_progress
protected

if progress bar shall be shown

在文件 SGIO.h569 行定义.

bool syntax_highlight
protected

whether syntax highlighting is enabled

在文件 SGIO.h574 行定义.

FILE* target
protected

target file

在文件 SGIO.h561 行定义.


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

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