10 #ifndef __SERIALIZABLE_JSON_FILE_H__ 11 #define __SERIALIZABLE_JSON_FILE_H__ 13 #include <shogun/lib/config.h> 23 #define STR_KEY_TYPE "type" 24 #define STR_KEY_DATA "data" 25 #define STR_KEY_INSTANCE_NAME "instance_name" 26 #define STR_KEY_INSTANCE "instance" 27 #define STR_KEY_GENERIC_NAME "generic_name" 28 #define STR_KEY_SPARSE_FEATURES "features" 29 #define STR_KEY_SPARSE_FEATINDEX "feat_index" 30 #define STR_KEY_SPARSE_ENTRY "entry" 34 #define IGNORE_IN_CLASSLIST 36 :
public CSerializableFile
38 friend class SerializableJsonReader00;
40 DynArray<json_object*> m_stack_stream;
42 void init(
const char* fname);
43 void push_object(json_object* o);
46 static bool get_object_any(json_object** dest, json_object* src,
48 static bool get_object(json_object** dest, json_object* src,
49 const char* key, json_type t);
52 virtual TSerializableReader* new_reader(
53 char* dest_version,
size_t n);
55 virtual bool write_scalar_wrapped(
56 const TSGDataType* type,
const void* param);
58 virtual bool write_cont_begin_wrapped(
59 const TSGDataType* type,
index_t len_real_y,
61 virtual bool write_cont_end_wrapped(
62 const TSGDataType* type,
index_t len_real_y,
65 virtual bool write_string_begin_wrapped(
66 const TSGDataType* type,
index_t length);
67 virtual bool write_string_end_wrapped(
68 const TSGDataType* type,
index_t length);
70 virtual bool write_stringentry_begin_wrapped(
71 const TSGDataType* type,
index_t y);
72 virtual bool write_stringentry_end_wrapped(
73 const TSGDataType* type,
index_t y);
75 virtual bool write_sparse_begin_wrapped(
76 const TSGDataType* type,
index_t length);
77 virtual bool write_sparse_end_wrapped(
78 const TSGDataType* type,
index_t length);
80 virtual bool write_sparseentry_begin_wrapped(
81 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
83 virtual bool write_sparseentry_end_wrapped(
84 const TSGDataType* type,
const SGSparseVectorEntry<char>* first_entry,
87 virtual bool write_item_begin_wrapped(
89 virtual bool write_item_end_wrapped(
92 virtual bool write_sgserializable_begin_wrapped(
93 const TSGDataType* type,
const char* sgserializable_name,
94 EPrimitiveType
generic);
95 virtual bool write_sgserializable_end_wrapped(
96 const TSGDataType* type,
const char* sgserializable_name,
97 EPrimitiveType
generic);
99 virtual bool write_type_begin_wrapped(
100 const TSGDataType* type,
const char* name,
102 virtual bool write_type_end_wrapped(
103 const TSGDataType* type,
const char* name,
108 explicit CSerializableJsonFile();
115 explicit CSerializableJsonFile(
const char* fname,
char rw=
'r');
118 virtual ~CSerializableJsonFile();
121 virtual const char* get_name()
const {
122 return "SerializableJsonFile";
125 virtual void close();
126 virtual bool is_opened();
all of classes and functions are contained in the shogun namespace
#define IGNORE_IN_CLASSLIST