公有成员 | 静态公有成员 | 保护成员 | 保护属性 | 静态保护属性

CIO类参考


详细描述

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

所有成员的列表。

公有成员

 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

构造及析构函数文档

CIO (  )

default constructor

在文件io.cpp46行定义。

CIO ( const CIO orig )

copy constructor

在文件io.cpp53行定义。


成员函数文档

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

在文件io.cpp184行定义。

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

print a buffered message

参数:
priomessage priority
fmtformat string

在文件io.cpp119行定义。

static char* concat_filename ( const char *  filename ) [static]

concatenate directory and filename ( non thread safe )

参数:
filenamenew filename
返回:
concatenated directory and filename

在文件io.h321行定义。

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

print warning message 'function deprecated'

在文件io.h202行定义。

void disable_file_and_line (  )

disable displaying of file and line when printing messages

在文件io.h280行定义。

void disable_progress (  )

disable progress bar

在文件io.h261行定义。

void disable_syntax_highlighting (  )

disable syntax highlighting

在文件io.h298行定义。

void done (  )

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

在文件io.cpp235行定义。

void enable_file_and_line (  )

enable displaying of file and line when printing messages

在文件io.h271行定义。

void enable_progress (  )

enable progress bar

在文件io.h251行定义。

void enable_syntax_highlighting (  )

enable syntax highlighting

在文件io.h289行定义。

static int filter ( CONST_DIRENT_T *  d ) [static]

filter

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

在文件io.h334行定义。

EMessageType get_loglevel (  ) const

get loglevel

返回:
level of log messages

在文件io.cpp271行定义。

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

在文件io.cpp286行定义。

const char* get_name (  )
返回:
object name

在文件io.h387行定义。

bool get_show_file_and_line (  ) const

get show file and line

返回:
if file and line should prefix messages

在文件io.h135行定义。

bool get_show_progress (  ) const

get show_progress

返回:
if progress bar is shown

在文件io.h126行定义。

bool get_syntax_highlight (  ) const

get syntax highlight

返回:
if syntax highlighting is enabled

在文件io.h144行定义。

FILE* get_target (  ) const

get target

返回:
file descriptor for target

在文件io.h233行定义。

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)

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

在文件io.cpp63行定义。

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

print error message 'not implemented'

在文件io.h196行定义。

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

在文件io.cpp133行定义。

int32_t ref (  )

increase reference counter

返回:
reference count

在文件io.h355行定义。

int32_t ref_count (  ) const

display reference counter

返回:
reference count

在文件io.h365行定义。

static void set_dirname ( const char *  dirname ) [static]

set directory name

参数:
dirnamenew directory name

在文件io.h310行定义。

void set_loglevel ( EMessageType  level )

set loglevel

参数:
levellevel of log messages

在文件io.cpp276行定义。

void set_target ( FILE *  target )

set target

参数:
targetfile descriptor for target

在文件io.cpp281行定义。

void set_target_to_stderr (  )

set target to stderr

在文件io.h245行定义。

void set_target_to_stdout (  )

set target to stdout

在文件io.h248行定义。

char * skip_blanks ( char *  str ) [static]

skip leading spaces + tabs

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

在文件io.cpp257行定义。

char * skip_spaces ( char *  str ) [static]

skip leading spaces

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

在文件io.cpp243行定义。

int32_t unref (  )

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

返回:
reference count

在文件io.h375行定义。


成员数据文档

char directory_name [static, protected]

directory name buffer

directory name (for filter function)

在文件io.h427行定义。

char file_buffer [static, protected]

file name buffer

file buffer

在文件io.h425行定义。

float64_t last_progress [protected]

last progress

在文件io.h406行定义。

last progress time

在文件io.h402行定义。

const EMessageType levels [static, protected]
初始化序列:

available log levels

在文件io.h418行定义。

EMessageType loglevel [protected]

log level

在文件io.h416行定义。

const char * message_strings [static, protected]
初始化序列:
{"[GCDEBUG] \0", "[DEBUG] \0", "[INFO] \0",
    "[NOTICE] \0", "[WARN] \0", "[ERROR] \0",
    "[CRITICAL] \0", "[ALERT] \0", "[EMERGENCY] \0", "\0"}

message strings

在文件io.h422行定义。

const char * message_strings_highlighted [static, protected]
初始化序列:
{"[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.h420行定义。

progress start time

在文件io.h404行定义。

bool show_file_and_line [protected]

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

在文件io.h411行定义。

bool show_progress [protected]

if progress bar shall be shown

在文件io.h408行定义。

bool syntax_highlight [protected]

whether syntax highlighting is enabled

在文件io.h413行定义。

FILE* target [protected]

target file

在文件io.h400行定义。


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

SHOGUN Machine Learning Toolbox - Documentation