详细描述
Class IO, 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.
在文件io.h第102行定义。
所有成员的列表。
公有成员 |
| CIO () |
| CIO (const CIO &orig) |
void | set_loglevel (EMessageType level) |
EMessageType | get_loglevel () const |
bool | get_show_progress () const |
bool | get_show_file_and_line () const |
bool | get_syntax_highlight () const |
void | message (EMessageType prio, 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 *file, int32_t line) const |
void | deprecated (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 | enable_file_and_line () |
void | disable_file_and_line () |
void | enable_syntax_highlighting () |
void | disable_syntax_highlighting () |
int32_t | ref () |
int32_t | ref_count () const |
int32_t | unref () |
const char * | get_name () |
静态公有成员 |
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) |
保护成员 |
const char * | get_msg_intro (EMessageType prio) const |
保护属性 |
FILE * | target |
float64_t | last_progress_time |
float64_t | progress_start_time |
float64_t | last_progress |
bool | show_progress |
bool | show_file_and_line |
bool | syntax_highlight |
EMessageType | loglevel |
静态保护属性 |
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
|
构造及析构函数文档
成员函数文档
print absolute progress bar
- 参数:
-
| current_val | current value |
| val | value |
| min_val | minimum value |
| max_val | maximum value |
| decimals | decimals |
| prefix | message prefix |
在文件io.cpp第184行定义。
void buffered_message |
( |
EMessageType |
prio, |
|
|
const char * |
fmt, |
|
|
|
... | |
|
) |
| | const |
print a buffered message
- 参数:
-
| prio | message priority |
| fmt | format string |
在文件io.cpp第119行定义。
static char* concat_filename |
( |
const char * |
filename |
) |
[static] |
concatenate directory and filename ( non thread safe )
- 参数:
-
- 返回:
- concatenated directory and filename
在文件io.h第321行定义。
void deprecated |
( |
const char * |
file, |
|
|
int32_t |
line | |
|
) |
| | const |
print warning message 'function deprecated'
在文件io.h第202行定义。
void disable_file_and_line |
( |
|
) |
|
disable displaying of file and line when printing messages
在文件io.h第280行定义。
void disable_progress |
( |
|
) |
|
disable progress bar
在文件io.h第261行定义。
void disable_syntax_highlighting |
( |
|
) |
|
disable syntax highlighting
在文件io.h第298行定义。
print 'done' with priority INFO, but only if progress bar is enabled
在文件io.cpp第235行定义。
void enable_file_and_line |
( |
|
) |
|
enable displaying of file and line when printing messages
在文件io.h第271行定义。
enable progress bar
在文件io.h第251行定义。
void enable_syntax_highlighting |
( |
|
) |
|
enable syntax highlighting
在文件io.h第289行定义。
static int filter |
( |
CONST_DIRENT_T * |
d |
) |
[static] |
filter
- 参数:
-
- 返回:
- 1 if d is a readable file
在文件io.h第334行定义。
get loglevel
- 返回:
- level of log messages
在文件io.cpp第271行定义。
const char * get_msg_intro |
( |
EMessageType |
prio |
) |
const [protected] |
get message intro
- 参数:
-
- 返回:
- message intro or NULL if message is not to be printed
在文件io.cpp第286行定义。
bool get_show_file_and_line |
( |
|
) |
const |
get show file and line
- 返回:
- if file and line should prefix messages
在文件io.h第135行定义。
bool get_show_progress |
( |
|
) |
const |
get show_progress
- 返回:
- if progress bar is shown
在文件io.h第126行定义。
bool get_syntax_highlight |
( |
|
) |
const |
get syntax highlight
- 返回:
- if syntax highlighting is enabled
在文件io.h第144行定义。
FILE* get_target |
( |
|
) |
const |
get target
- 返回:
- file descriptor for target
在文件io.h第233行定义。
void message |
( |
EMessageType |
prio, |
|
|
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)
- 参数:
-
| prio | message priority |
| file | file name from where the message is called |
| line | line number from where the message is called |
| fmt | format string |
在文件io.cpp第63行定义。
void not_implemented |
( |
const char * |
file, |
|
|
int32_t |
line | |
|
) |
| | const |
print error message 'not implemented'
在文件io.h第196行定义。
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_val | current value |
| min_val | minimum value |
| max_val | maximum value |
| decimals | decimals |
| prefix | message prefix |
在文件io.cpp第133行定义。
increase reference counter
- 返回:
- reference count
在文件io.h第355行定义。
int32_t ref_count |
( |
|
) |
const |
display reference counter
- 返回:
- reference count
在文件io.h第365行定义。
static void set_dirname |
( |
const char * |
dirname |
) |
[static] |
set directory name
- 参数:
-
| dirname | new directory name |
在文件io.h第310行定义。
set loglevel
- 参数:
-
| level | level of log messages |
在文件io.cpp第276行定义。
void set_target |
( |
FILE * |
target |
) |
|
set target
- 参数:
-
| target | file descriptor for target |
在文件io.cpp第281行定义。
void set_target_to_stderr |
( |
|
) |
|
set target to stderr
在文件io.h第245行定义。
void set_target_to_stdout |
( |
|
) |
|
set target to stdout
在文件io.h第248行定义。
char * skip_blanks |
( |
char * |
str |
) |
[static] |
skip leading spaces + tabs
- 参数:
-
| str | string in which to look for blanks |
- 返回:
- string after after skipping leading blanks
在文件io.cpp第257行定义。
char * skip_spaces |
( |
char * |
str |
) |
[static] |
skip leading spaces
- 参数:
-
| str | string in which to look for spaces |
- 返回:
- string after after skipping leading spaces
在文件io.cpp第243行定义。
decrement reference counter and deallocate object if refcount is zero before or after decrementing it
- 返回:
- reference count
在文件io.h第375行定义。
成员数据文档
directory name buffer
directory name (for filter function)
在文件io.h第427行定义。
file name buffer
file buffer
在文件io.h第425行定义。
初始化序列:{MSG_GCDEBUG, MSG_DEBUG, MSG_INFO, MSG_NOTICE,
MSG_WARN, MSG_ERROR, MSG_CRITICAL, MSG_ALERT, MSG_EMERGENCY, MSG_MESSAGEONLY}
available log levels
在文件io.h第418行定义。
初始化序列:{"[GCDEBUG] \0", "[DEBUG] \0", "[INFO] \0",
"[NOTICE] \0", "[WARN] \0", "[ERROR] \0",
"[CRITICAL] \0", "[ALERT] \0", "[EMERGENCY] \0", "\0"}
message strings
在文件io.h第422行定义。
初始化序列:{"[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
在文件io.h第420行定义。
progress start time
在文件io.h第404行定义。
if each print function should append filename and linenumber of where the print occurs
在文件io.h第411行定义。
if progress bar shall be shown
在文件io.h第408行定义。
whether syntax highlighting is enabled
在文件io.h第413行定义。
该类的文档由以下文件生成: