SHOGUN  6.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
Classes | Macros | Enumerations
SGIO.h File Reference

Go to the source code of this file.

Classes

struct  substring
 struct Substring, specified by start position and end position. More...
 
class  SGIO
 Class SGIO, used to do input output operations throughout shogun. More...
 

Macros

#define NUM_LOG_LEVELS   10
 
#define FBUFSIZE   4096
 
#define CONST_DIRENT_T   const struct dirent
 
#define SG_SET_LOCALE_C   setlocale(LC_ALL, "C")
 
#define SG_RESET_LOCALE   setlocale(LC_ALL, "")
 
#define SG_UNLIKELY(expr)   expr
 
#define SG_GCDEBUG(...)
 
#define SG_DEBUG(...)
 
#define SG_OBJ_DEBUG(o,...)
 
#define SG_INFO(...)
 
#define SG_CLASS_INFO(c,...)
 
#define SG_WARNING(...)   { io->message(MSG_WARN, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_ERROR(...)   { io->message(MSG_ERROR, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_OBJ_ERROR(o,...)   { o->io->message(MSG_ERROR, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_CLASS_ERROR(c,...)   { c::io->message(MSG_ERROR, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_UNSTABLE(func,...)
 
#define SG_PRINT(...)   { io->message(MSG_MESSAGEONLY, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_OBJ_PRINT(o,...)   { o->io->message(MSG_MESSAGEONLY, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_NOTIMPLEMENTED   { io->not_implemented(__PRETTY_FUNCTION__, __FILE__, __LINE__); }
 
#define SG_DEPRECATED   { io->deprecated(__PRETTY_FUNCTION__, __FILE__, __LINE__); }
 
#define SG_PROGRESS(...)
 
#define SG_OBJ_PROGRESS(o,...)
 
#define SG_ABS_PROGRESS(...)
 
#define SG_DONE()
 
#define SG_SGCDEBUG(...)
 
#define SG_SDEBUG(...)
 
#define SG_SINFO(...)
 
#define SG_SWARNING(...)   { sg_io->message(MSG_WARN,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_SERROR(...)   { sg_io->message(MSG_ERROR,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_SPRINT(...)   { sg_io->message(MSG_MESSAGEONLY,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }
 
#define SG_SPROGRESS(...)
 
#define SG_SABS_PROGRESS(...)
 
#define SG_SDONE()
 
#define SG_SNOTIMPLEMENTED   { sg_io->not_implemented(__PRETTY_FUNCTION__, __FILE__, __LINE__); }
 
#define SG_SDEPRECATED   { sg_io->deprecated(__PRETTY_FUNCTION__, __FILE__, __LINE__); }
 
#define ASSERT(x)
 
#define REQUIRE(x,...)
 

Enumerations

enum  EMessageType {
  MSG_GCDEBUG =0, MSG_DEBUG =1, MSG_INFO =2, MSG_NOTICE =3,
  MSG_WARN =4, MSG_ERROR =5, MSG_CRITICAL =6, MSG_ALERT =7,
  MSG_EMERGENCY =8, MSG_MESSAGEONLY =9
}
 
enum  EMessageLocation { MSG_NONE =0, MSG_FUNCTION =1, MSG_LINE_AND_FILE =2 }
 

Macro Definition Documentation

#define ASSERT (   x)
Value:
{ \
if (SG_UNLIKELY(!(x))) \
SG_SERROR("assertion %s failed in %s file %s line %d\n",#x, __PRETTY_FUNCTION__, __FILE__, __LINE__) \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91
#define SG_SERROR(...)
Definition: SGIO.h:178

Definition at line 200 of file SGIO.h.

#define CONST_DIRENT_T   const struct dirent

Definition at line 81 of file SGIO.h.

#define FBUFSIZE   4096

Definition at line 68 of file SGIO.h.

#define NUM_LOG_LEVELS   10

Definition at line 67 of file SGIO.h.

#define REQUIRE (   x,
  ... 
)
Value:
{ \
if (SG_UNLIKELY(!(x))) \
SG_SERROR(__VA_ARGS__) \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91
#define SG_SERROR(...)
Definition: SGIO.h:178

Definition at line 205 of file SGIO.h.

#define SG_ABS_PROGRESS (   ...)
Value:
{ \
if (SG_UNLIKELY(io->get_show_progress())) \
io->absolute_progress(__VA_ARGS__); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 151 of file SGIO.h.

#define SG_CLASS_ERROR (   c,
  ... 
)    { c::io->message(MSG_ERROR, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 130 of file SGIO.h.

#define SG_CLASS_INFO (   c,
  ... 
)
Value:
{ \
if (SG_UNLIKELY(c::io->loglevel_above(MSG_INFO))) \
c::io->message(MSG_INFO, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 122 of file SGIO.h.

#define SG_DEBUG (   ...)
Value:
{ \
if (SG_UNLIKELY(io->loglevel_above(MSG_DEBUG))) \
io->message(MSG_DEBUG, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 106 of file SGIO.h.

#define SG_DEPRECATED   { io->deprecated(__PRETTY_FUNCTION__, __FILE__, __LINE__); }

Definition at line 139 of file SGIO.h.

#define SG_DONE ( )
Value:
{ \
if (SG_UNLIKELY(io->get_show_progress())) \
io->done(); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 156 of file SGIO.h.

#define SG_ERROR (   ...)    { io->message(MSG_ERROR, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 128 of file SGIO.h.

#define SG_GCDEBUG (   ...)
Value:
{ \
if (SG_UNLIKELY(io->loglevel_above(MSG_GCDEBUG))) \
io->message(MSG_GCDEBUG, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 101 of file SGIO.h.

#define SG_INFO (   ...)
Value:
{ \
if (SG_UNLIKELY(io->loglevel_above(MSG_INFO))) \
io->message(MSG_INFO, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 117 of file SGIO.h.

#define SG_NOTIMPLEMENTED   { io->not_implemented(__PRETTY_FUNCTION__, __FILE__, __LINE__); }

Definition at line 138 of file SGIO.h.

#define SG_OBJ_DEBUG (   o,
  ... 
)
Value:
{ \
if (SG_UNLIKELY(o->io->loglevel_above(MSG_DEBUG))) \
o->io->message(MSG_DEBUG, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 111 of file SGIO.h.

#define SG_OBJ_ERROR (   o,
  ... 
)    { o->io->message(MSG_ERROR, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 129 of file SGIO.h.

#define SG_OBJ_PRINT (   o,
  ... 
)    { o->io->message(MSG_MESSAGEONLY, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 137 of file SGIO.h.

#define SG_OBJ_PROGRESS (   o,
  ... 
)
Value:
{ \
if (SG_UNLIKELY(o->io->get_show_progress()))\
o->io->progress(__VA_ARGS__); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 146 of file SGIO.h.

#define SG_PRINT (   ...)    { io->message(MSG_MESSAGEONLY, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 136 of file SGIO.h.

#define SG_PROGRESS (   ...)
Value:
{ \
if (SG_UNLIKELY(io->get_show_progress())) \
io->progress(__VA_ARGS__); \
}
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 141 of file SGIO.h.

#define SG_RESET_LOCALE   setlocale(LC_ALL, "")

Definition at line 85 of file SGIO.h.

#define SG_SABS_PROGRESS (   ...)
Value:
{ \
sg_io->absolute_progress(__VA_ARGS__); \
}
SGIO * sg_io
Definition: init.cpp:38
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91
bool get_show_progress() const
Definition: SGIO.h:279
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")
Definition: SGIO.cpp:228

Definition at line 187 of file SGIO.h.

#define SG_SDEBUG (   ...)
Value:
{ \
sg_io->message(MSG_DEBUG,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); \
}
bool loglevel_above(EMessageType type) const
Definition: SGIO.h:270
SGIO * sg_io
Definition: init.cpp:38
void message(EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
Definition: SGIO.cpp:74
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 167 of file SGIO.h.

#define SG_SDEPRECATED   { sg_io->deprecated(__PRETTY_FUNCTION__, __FILE__, __LINE__); }

Definition at line 198 of file SGIO.h.

#define SG_SDONE ( )
Value:
{ \
sg_io->done(); \
}
SGIO * sg_io
Definition: init.cpp:38
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91
bool get_show_progress() const
Definition: SGIO.h:279
void done()
Definition: SGIO.cpp:279

Definition at line 192 of file SGIO.h.

#define SG_SERROR (   ...)    { sg_io->message(MSG_ERROR,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 178 of file SGIO.h.

#define SG_SET_LOCALE_C   setlocale(LC_ALL, "C")

Definition at line 84 of file SGIO.h.

#define SG_SGCDEBUG (   ...)
Value:
{ \
sg_io->message(MSG_GCDEBUG,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__);\
}
bool loglevel_above(EMessageType type) const
Definition: SGIO.h:270
SGIO * sg_io
Definition: init.cpp:38
void message(EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
Definition: SGIO.cpp:74
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 162 of file SGIO.h.

#define SG_SINFO (   ...)
Value:
{ \
sg_io->message(MSG_INFO,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); \
}
bool loglevel_above(EMessageType type) const
Definition: SGIO.h:270
SGIO * sg_io
Definition: init.cpp:38
void message(EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
Definition: SGIO.cpp:74
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 172 of file SGIO.h.

#define SG_SNOTIMPLEMENTED   { sg_io->not_implemented(__PRETTY_FUNCTION__, __FILE__, __LINE__); }

Definition at line 197 of file SGIO.h.

#define SG_SPRINT (   ...)    { sg_io->message(MSG_MESSAGEONLY,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 179 of file SGIO.h.

#define SG_SPROGRESS (   ...)
Value:
{ \
sg_io->progress(__VA_ARGS__); \
}
SGIO * sg_io
Definition: init.cpp:38
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91
bool get_show_progress() const
Definition: SGIO.h:279
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")
Definition: SGIO.cpp:155

Definition at line 182 of file SGIO.h.

#define SG_SWARNING (   ...)    { sg_io->message(MSG_WARN,__PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 177 of file SGIO.h.

#define SG_UNLIKELY (   expr)    expr

Definition at line 91 of file SGIO.h.

#define SG_UNSTABLE (   func,
  ... 
)
Value:
{ io->message(MSG_WARN, __PRETTY_FUNCTION__, __FILE__, __LINE__, \
__FILE__ ":" func ": Unstable method! Please report if it seems to " \
"work or not to the Shogun mailing list. Thanking you in " \
"anticipation. " __VA_ARGS__); }

Definition at line 131 of file SGIO.h.

#define SG_WARNING (   ...)    { io->message(MSG_WARN, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 127 of file SGIO.h.


SHOGUN Machine Learning Toolbox - Documentation