SHOGUN  6.1.3
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_GPL_ONLY   { io->gpl_only(__PRETTY_FUNCTION__, __FILE__, __LINE__); }
 
#define SG_DEPRECATED   { io->deprecated(__PRETTY_FUNCTION__, __FILE__, __LINE__); }
 
#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_SDONE()
 
#define SG_SNOTIMPLEMENTED   { sg_io->not_implemented(__PRETTY_FUNCTION__, __FILE__, __LINE__); }
 
#define SG_SGPL_ONLY   { sg_io->gpl_only(__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:164

Definition at line 176 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:164

Definition at line 181 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 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:91

Definition at line 142 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_GPL_ONLY   { io->gpl_only(__PRETTY_FUNCTION__, __FILE__, __LINE__); }

Definition at line 139 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_PRINT (   ...)    { io->message(MSG_MESSAGEONLY, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); }

Definition at line 136 of file SGIO.h.

#define SG_RESET_LOCALE   setlocale(LC_ALL, "")

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

Definition at line 153 of file SGIO.h.

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

Definition at line 174 of file SGIO.h.

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

Definition at line 167 of file SGIO.h.

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

Definition at line 164 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:246
SGIO * sg_io
Definition: init.cpp:44
void message(EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
Definition: SGIO.cpp:71
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 148 of file SGIO.h.

#define SG_SGPL_ONLY   { sg_io->gpl_only(__PRETTY_FUNCTION__, __FILE__, __LINE__); }

Definition at line 173 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:246
SGIO * sg_io
Definition: init.cpp:44
void message(EMessageType prio, const char *function, const char *file, int32_t line, const char *fmt,...) const
Definition: SGIO.cpp:71
#define SG_UNLIKELY(expr)
Definition: SGIO.h:91

Definition at line 158 of file SGIO.h.

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

Definition at line 172 of file SGIO.h.

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

Definition at line 165 of file SGIO.h.

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

Definition at line 163 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