SHOGUN
v1.1.0
|
Template class SimpleFile to read and write from files.
Currently only simple reading and writing of blocks is supported.
Definition at line 27 of file SimpleFile.h.
Public Member Functions | |
CSimpleFile () | |
CSimpleFile (char *fname, FILE *f) | |
virtual | ~CSimpleFile () |
T * | load (T *target, int64_t &num) |
bool | save (T *target, int64_t num) |
void | get_buffered_line (char *line, uint64_t len) |
void | free_line_buffer () |
void | set_line_buffer_size (int32_t bufsize) |
bool | is_ok () |
virtual const char * | get_name () const |
![]() | |
CSGObject () | |
CSGObject (const CSGObject &orig) | |
virtual | ~CSGObject () |
virtual bool | is_generic (EPrimitiveType *generic) const |
template<class T > | |
void | set_generic () |
void | unset_generic () |
virtual void | print_serializable (const char *prefix="") |
virtual bool | save_serializable (CSerializableFile *file, const char *prefix="") |
virtual bool | load_serializable (CSerializableFile *file, const char *prefix="") |
void | set_global_io (SGIO *io) |
SGIO * | get_global_io () |
void | set_global_parallel (Parallel *parallel) |
Parallel * | get_global_parallel () |
void | set_global_version (Version *version) |
Version * | get_global_version () |
SGVector< char * > | get_modelsel_names () |
char * | get_modsel_param_descr (const char *param_name) |
index_t | get_modsel_param_index (const char *param_name) |
Protected Attributes | |
FILE * | file |
bool | status |
char | task |
char * | filename |
int32_t | line_buffer_size |
char * | line_buffer |
Additional Inherited Members | |
![]() | |
SGIO * | io |
Parallel * | parallel |
Version * | version |
Parameter * | m_parameters |
Parameter * | m_model_selection_parameters |
![]() | |
virtual void | load_serializable_pre () throw (ShogunException) |
virtual void | load_serializable_post () throw (ShogunException) |
virtual void | save_serializable_pre () throw (ShogunException) |
virtual void | save_serializable_post () throw (ShogunException) |
CSimpleFile | ( | ) |
default constructor
Definition at line 31 of file SimpleFile.h.
CSimpleFile | ( | char * | fname, |
FILE * | f | ||
) |
constructor rw is either r for read and w for write
fname | filename |
f | file descriptor |
Definition at line 46 of file SimpleFile.h.
|
virtual |
Definition at line 54 of file SimpleFile.h.
void free_line_buffer | ( | ) |
free the line buffer
Definition at line 184 of file SimpleFile.h.
void get_buffered_line | ( | char * | line, |
uint64_t | len | ||
) |
read a line (buffered; to be implemented)
line | linebuffer to write to |
len | maximum length |
Definition at line 160 of file SimpleFile.h.
|
virtual |
bool is_ok | ( | ) |
T* load | ( | T * | target, |
int64_t & | num | ||
) |
load
target | load target |
num | number of read elements |
Definition at line 66 of file SimpleFile.h.
bool save | ( | T * | target, |
int64_t | num | ||
) |
save
target | target to save to |
num | number of elements to write |
Definition at line 135 of file SimpleFile.h.
void set_line_buffer_size | ( | int32_t | bufsize | ) |
set the size of the line buffer
bufsize | size of the line buffer |
Definition at line 194 of file SimpleFile.h.
|
protected |
file descriptor
Definition at line 214 of file SimpleFile.h.
|
protected |
filename
Definition at line 220 of file SimpleFile.h.
|
protected |
line buffer
Definition at line 225 of file SimpleFile.h.
|
protected |
size of line buffer
Definition at line 223 of file SimpleFile.h.
|
protected |
status of file operations
Definition at line 216 of file SimpleFile.h.
|
protected |
task
Definition at line 218 of file SimpleFile.h.