17 #ifndef YAMICORE_PARAMETERS_DETAILS_H_INCLUDED 18 #define YAMICORE_PARAMETERS_DETAILS_H_INCLUDED 21 #include "details-fwd.h" 22 #include "parameter_type.h" 36 const std::size_t short_name_optimization_threshold = 16;
37 const std::size_t initial_number_of_entries = 4;
38 const std::size_t max_nesting_level = 5;
42 std::size_t name_length;
45 const char * long_value;
46 char short_value[short_name_optimization_threshold];
52 const char * value()
const;
54 void clear(allocator & alloc);
56 bool equals(
const char * value, std::size_t length)
const;
59 void dump(details::dump_sink & sink)
const;
62 struct string_array_element
67 void clear(allocator & alloc);
70 struct binary_array_element
75 void clear(allocator & alloc);
102 struct boolean_array_data
108 struct integer_array_data
114 struct long_long_array_data
120 struct double_float_array_data
126 struct string_array_data
128 string_array_element * values;
132 struct binary_array_data
134 binary_array_element * values;
138 core::parameters * nested;
139 struct nested_array_data
141 core::parameters * values;
147 core::result set_name(
const char * value, std::size_t length,
150 return name.set(value, length, alloc);
153 void clear_name(allocator & alloc)
158 bool name_equals(
const char * value, std::size_t length)
const 160 return name.equals(value, length);
163 void clear_item(allocator & alloc);
166 void get_serialize_buffer_size(
167 const core::parameters & params,
171 const details::entry & e,
173 const std::size_t * buffer_sizes,
174 std::size_t num_of_buffers,
175 std::size_t & current_buffer,
char * & buffer_position);
178 const core::parameters & params,
180 const std::size_t * buffer_sizes,
181 std::size_t num_of_buffers,
182 std::size_t & current_buffer,
char * & buffer_position);
185 core::parameters & params,
186 const char * * buffers,
187 const std::size_t * buffer_sizes,
188 std::size_t num_of_buffers,
189 std::size_t & current_buffer,
const char * & buffer_position);
192 core::parameters & params,
193 const char * * buffers,
194 const std::size_t * buffer_sizes,
195 std::size_t num_of_buffers,
196 std::size_t & current_buffer,
const char * & buffer_position);
204 std::size_t find_entry(
const entry * data, std::size_t num_of_entries,
205 const char * name, std::size_t name_length);
210 core::result find_empty_entry(entry * & data, std::size_t & num_of_entries,
211 std::size_t & index, allocator & alloc);
215 core::result prepare_for_set(entry * & data, std::size_t & num_of_entries,
216 const char * name, std::size_t name_length,
217 std::size_t & index, allocator & alloc);
220 std::size_t find_next_used(
const entry * data, std::size_t num_of_entries,
221 std::size_t current_index);
223 core::result do_set_string(
const char * name, std::size_t name_length,
224 const char * value, std::size_t value_length,
225 entry * & data, std::size_t & num_of_entries,
226 allocator & alloc,
bool own);
228 core::result do_set_binary(
const char * name, std::size_t name_length,
229 const void * value, std::size_t value_length,
230 entry * & data, std::size_t & num_of_entries,
231 allocator & alloc,
bool own);
233 core::result do_set_boolean_array(
const char * name, std::size_t name_length,
234 const bool * values, std::size_t array_length,
235 entry * & data, std::size_t & num_of_entries,
236 allocator & alloc,
bool own);
238 core::result do_set_integer_array(
const char * name, std::size_t name_length,
239 const int * values, std::size_t array_length,
240 entry * & data, std::size_t & num_of_entries,
241 allocator & alloc,
bool own);
244 const char * name, std::size_t name_length,
245 const long long * values, std::size_t array_length,
246 entry * & data, std::size_t & num_of_entries,
247 allocator & alloc,
bool own);
250 const char * name, std::size_t name_length,
251 const double * values, std::size_t array_length,
252 entry * & data, std::size_t & num_of_entries,
253 allocator & alloc,
bool own);
256 const char * name, std::size_t name_length,
257 std::size_t array_length, std::size_t & index,
258 entry * & data, std::size_t & num_of_entries,
262 std::size_t item_index, std::size_t array_index,
263 const char * value, std::size_t value_length,
264 entry * data, allocator & alloc);
267 std::size_t item_index, std::size_t array_index,
268 const char * value, std::size_t value_length,
269 entry * data, allocator & alloc);
272 const char * name, std::size_t name_length,
273 std::size_t array_length, std::size_t & index,
274 entry * & data, std::size_t & num_of_entries,
278 std::size_t item_index, std::size_t array_index,
279 const void * value, std::size_t value_length,
280 entry * data, allocator & alloc);
283 std::size_t item_index, std::size_t array_index,
284 const void * value, std::size_t value_length,
285 entry * data, allocator & alloc);
288 const char * name, std::size_t name_length,
289 std::size_t array_length, std::size_t & index,
290 entry * & data, std::size_t & num_of_entries,
294 std::size_t item_index, std::size_t array_index,
295 core::parameters * & nested,
302 #endif // YAMICORE_PARAMETERS_DETAILS_H_INCLUDED parameter_type
Type of parameter entry.
Definition: parameter_type.h:27
Namespace devoted for everything related to YAMI4.
Definition: agent.h:25
result
General type for reporting success and error states.
Definition: core.h:32