11 #ifndef __SGOBJECT_H__
12 #define __SGOBJECT_H__
35 class CSerializableFile;
39 #ifdef USE_REFERENCE_COUNTING
40 #define SG_REF(x) { if (x) (x)->ref(); }
41 #define SG_UNREF(x) { if (x) { if ((x)->unref()==0) (x)=NULL; } }
42 #define SG_UNREF_NO_NULL(x) { if (x) { (x)->unref(); } }
46 #define SG_UNREF_NO_NULL(x)
52 #define SG_ADD(param, name, description, ms_available) {\
53 m_parameters->add(param, name, description);\
55 m_model_selection_parameters->add(param, name, description);\
88 #ifdef USE_REFERENCE_COUNTING
107 #endif //USE_REFERENCE_COUNTING
114 virtual const char*
get_name()
const = 0;
124 virtual bool is_generic(EPrimitiveType*
generic)
const;
151 const char* prefix=
"");
163 const char* prefix=
"");
221 #ifdef TRACE_MEMORY_ALLOCS
222 static void list_memory_allocs()
224 ::list_memory_allocs();
271 void set_global_objects();
272 void unset_global_objects();
284 const char* prefix=
"");
304 EPrimitiveType m_generic;
305 bool m_load_pre_called;
306 bool m_load_post_called;
307 bool m_save_pre_called;
308 bool m_save_post_called;
313 PTHREAD_LOCK_T m_ref_lock;
314 #endif //HAVE_PTHREAD
317 #endif // __SGOBJECT_H__
virtual const char * get_name() const =0
Parallel * get_global_parallel()
Class ShogunException defines an exception which is thrown whenever an error inside of shogun occurs...
Version * get_global_version()
virtual void save_serializable_pre()
virtual bool is_generic(EPrimitiveType *generic) const
EModelSelectionAvailability
virtual bool load_serializable(CSerializableFile *file, const char *prefix="")
char * get_modsel_param_descr(const char *param_name)
Class SGObject is the base class of all shogun objects.
virtual void save_serializable_post()
Class Version provides version information.
Parameter * m_model_selection_parameters
SGVector< char * > get_modelsel_names()
void set_global_parallel(Parallel *parallel)
virtual void load_serializable_pre()
virtual void load_serializable_post()
Class Parallel provides helper functions for multithreading.
virtual bool save_serializable(CSerializableFile *file, const char *prefix="")
index_t get_modsel_param_index(const char *param_name)
void set_global_io(SGIO *io)
Class SGIO, used to do input output operations throughout shogun.
virtual void print_serializable(const char *prefix="")
void set_global_version(Version *version)