MCPcopy Create free account
hub / github.com/davisking/dlib / assign_tables

Function assign_tables

dlib/logger/logger_kernel_1.cpp:180–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178
179 template <typename T, typename U>
180 void assign_tables (
181 T& c,
182 const std::string& name,
183 const U& val
184 )
185 {
186 if (name.size() == 0)
187 {
188 c.val = val;
189 c.table.clear();
190 return;
191 }
192
193 const std::string::size_type pos = name.find_first_of(".");
194 std::string first = name.substr(0,pos);
195 std::string last;
196 if (pos != std::string::npos)
197 last = name.substr(pos+1);
198
199 if (c.table.is_in_domain(first))
200 {
201 assign_tables(*c.table[first], last, val);
202 }
203 else
204 {
205 std::unique_ptr<T> temp (new T);
206 temp->val = c.val;
207 assign_tables(*temp, last, val);
208 c.table.add(first,temp);
209 }
210 }
211
212// ----------------------------------------------------------------------------------------
213

Callers 5

set_levelMethod · 0.85
set_auto_flushMethod · 0.85
set_output_streamMethod · 0.85
set_output_hookMethod · 0.85
set_logger_headerMethod · 0.85

Calls 3

sizeMethod · 0.45
clearMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected