SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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:92
#define SG_SERROR(...)
Definition: SGIO.h:179

Definition at line 201 of file SGIO.h.

#define CONST_DIRENT_T   const struct dirent

Definition at line 82 of file SGIO.h.

#define FBUFSIZE   4096

Definition at line 69 of file SGIO.h.

#define NUM_LOG_LEVELS   10

Definition at line 68 of file SGIO.h.

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

Definition at line 206 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:92

Definition at line 152 of file SGIO.h.

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

Definition at line 131 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:92

Definition at line 123 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:92

Definition at line 107 of file SGIO.h.

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

Definition at line 140 of file SGIO.h.

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

Definition at line 157 of file SGIO.h.

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

Definition at line 129 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:92

Definition at line 102 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:92

Definition at line 118 of file SGIO.h.

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

Definition at line 139 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:92

Definition at line 112 of file SGIO.h.

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

Definition at line 130 of file SGIO.h.

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

Definition at line 138 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:92

Definition at line 147 of file SGIO.h.

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

Definition at line 137 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:92

Definition at line 142 of file SGIO.h.

#define SG_RESET_LOCALE   setlocale(LC_ALL, "")

Definition at line 86 of file SGIO.h.

#define SG_SABS_PROGRESS (   ...)
Value:
{ \
sg_io->absolute_progress(__VA_ARGS__); \
}
SGIO * sg_io
Definition: init.cpp:36
#define SG_UNLIKELY(expr)
Definition: SGIO.h:92
bool get_show_progress() const
Definition: SGIO.h:280
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:198

Definition at line 188 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:271
SGIO * sg_io
Definition: init.cpp:36
void message(EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
Definition: SGIO.cpp:66
#define SG_UNLIKELY(expr)
Definition: SGIO.h:92

Definition at line 168 of file SGIO.h.

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

Definition at line 199 of file SGIO.h.

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

Definition at line 193 of file SGIO.h.

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

Definition at line 179 of file SGIO.h.

#define SG_SET_LOCALE_C   setlocale(LC_ALL, "C")

Definition at line 85 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:271
SGIO * sg_io
Definition: init.cpp:36
void message(EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
Definition: SGIO.cpp:66
#define SG_UNLIKELY(expr)
Definition: SGIO.h:92

Definition at line 163 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:271
SGIO * sg_io
Definition: init.cpp:36
void message(EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
Definition: SGIO.cpp:66
#define SG_UNLIKELY(expr)
Definition: SGIO.h:92

Definition at line 173 of file SGIO.h.

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

Definition at line 198 of file SGIO.h.

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

Definition at line 180 of file SGIO.h.

#define SG_SPROGRESS (   ...)
Value:
{ \
sg_io->progress(__VA_ARGS__); \
}
SGIO * sg_io
Definition: init.cpp:36
#define SG_UNLIKELY(expr)
Definition: SGIO.h:92
bool get_show_progress() const
Definition: SGIO.h:280
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:147

Definition at line 183 of file SGIO.h.

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

Definition at line 178 of file SGIO.h.

#define SG_UNLIKELY (   expr)    expr

Definition at line 92 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 132 of file SGIO.h.

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

Definition at line 128 of file SGIO.h.


SHOGUN Machine Learning Toolbox - Documentation