10 ptr->on_changed(p_object);
20 if (ptr->get_guid() == p_guid)
32 if (!g_find(ptr,p_guid))
throw exception_service_not_found();
33 ptr->get_data_string(p_out);
39 if (!g_find(ptr,p_guid))
throw exception_service_not_found();
40 ptr->set_data_string(p_data,p_length);
46 get_data_struct_t<t_int32>(temp);
55 set_data_struct_t<t_int32>(temp);
63 }
catch(...) {
return p_default;}
71 }
catch(...) {
return p_default;}
76 if (!g_find(ptr,p_guid))
throw exception_service_not_found();
77 ptr->get_data_int32(p_out);
82 if (!g_find(ptr,p_guid))
throw exception_service_not_found();
83 ptr->set_data_int32(p_val);
89 if (!g_find(ptr,p_guid))
throw exception_service_not_found();
90 return ptr->get_data_bool_simple(p_default);
96 if (!g_find(ptr,p_guid))
throw exception_service_not_found();
97 return ptr->get_data_int32_simple(p_default);
110 m_out.add_string((
const char*)p_buffer,p_bytes);
112 stream_writer_string(
pfc::string_base & p_out) : m_out(p_out) {m_out.reset();}
121 if (p_bytes > m_bytes - m_bytes_read)
throw pfc::exception_overflow();
122 memcpy((
t_uint8*)m_out,p_buffer,p_bytes);
123 m_bytes_read += p_bytes;
126 stream_writer_fixedbuffer(
void * p_out,
t_size p_bytes,
t_size & p_bytes_read) : m_out(p_out), m_bytes(p_bytes), m_bytes_read(p_bytes_read) {m_bytes_read = 0;}
140 stream_writer_get_length(
t_size & p_length) : m_length(p_length) {m_length = 0;}
148 stream_writer_fixedbuffer stream(p_out,p_bytes,ret);
150 get_data(&stream,aborter);
156 stream_writer_get_length stream(ret);
158 get_data(&stream,aborter);
165 set_data(&stream,aborter,p_notify);
173 stream_writer_string stream(p_out);
175 get_data(&stream,aborter);
184 p_stream->write_object(m_data.get_ptr(),m_data.get_size(),p_abort);
197 t_size delta_done = p_stream->read(buffer,delta,p_abort);
201 m_data.append_fromptr(buffer,delta_done);
204 if (delta_done != delta)
break;
void set_data_string(const char *p_data, t_size p_length)
t_size get_data_raw_length()
void ensure_main_thread()
Triggers a bug check if the calling thread is not the main app thread.
static void g_on_changed(const service_ptr_t< config_object > &p_object)
void set_data_int32(t_int32 p_val)
void get_data_int32(t_int32 &p_out)
void get_data_string(pfc::string_base &p_out)
abort_callback_impl abort_callback_dummy
bool get_data_bool_simple(bool p_default)
void order_native_to_le_t(T ¶m)
t_int32 get_data_int32_simple(t_int32 p_default)
void get_data(stream_writer *p_stream, abort_callback &p_abort) const
static bool g_get_data_bool_simple(const GUID &p_guid, bool p_default)
static void g_set_data_int32(const GUID &p_guid, t_int32 p_val)
t_size get_data_raw(void *p_out, t_size p_bytes)
void order_le_to_native_t(T ¶m)
t_size strlen_max(const char *ptr, t_size max)
static void g_set_data_string(const GUID &p_guid, const char *p_data, t_size p_length=~0)
config_object_impl(const GUID &p_guid, const void *p_data, t_size p_bytes)
void write(const service_ptr_t< file > &p_file, abort_callback &p_abort, const char *p_string, bool is_utf8)
static void g_get_data_bool(const GUID &p_guid, bool &p_out)
pfc::array_t< t_uint8 > m_data
bool assert_main_thread()
Tests whether calling thread is main app thread, and shows diagnostic message in debugger output if i...
void set_data_fromptr(const t_source *p_buffer, t_size p_count)
Warning: buffer pointer must not point to buffer allocated by this array (fixme). ...
void set_data(stream_reader *p_stream, abort_callback &p_abort, bool p_notify)
void set_data_bool(bool p_val)
static void g_get_data_string(const GUID &p_guid, pfc::string_base &p_out)
static void g_get_data_int32(const GUID &p_guid, t_int32 &p_out)
Base class for configuration variable classes; provides self-registration mechaisms and methods to se...
bool next(service_ptr_t< t_query > &p_out)
static void g_set_data_bool(const GUID &p_guid, bool p_val)
static t_int32 g_get_data_int32_simple(const GUID &p_guid, t_int32 p_default)
void set_data_raw(const void *p_data, t_size p_bytes, bool p_sendnotify=true)
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
void get_data_bool(bool &p_out)