| 239 | } |
| 240 | |
| 241 | void pushTree( std::string_view name ) |
| 242 | { |
| 243 | #if MR_ENABLE_UI_TEST_ENGINE |
| 244 | checkForNewFrame(); |
| 245 | |
| 246 | auto& map = state.stack.back()->elems; |
| 247 | auto iter = map.find( name ); // I wish I could use `std::try_emplace` here directly... |
| 248 | if ( iter == map.end() ) |
| 249 | iter = map.try_emplace( std::string( name ) ).first; |
| 250 | else |
| 251 | assert( !iter->second.visitedOnThisFrame && "Registering the same entry more than once in a single frame!" ); |
| 252 | |
| 253 | GroupEntry* subgroup = std::get_if<GroupEntry>( &iter->second.value ); |
| 254 | if ( !subgroup ) |
| 255 | subgroup = &iter->second.value.emplace<GroupEntry>(); |
| 256 | |
| 257 | iter->second.visitedOnThisFrame = true; |
| 258 | |
| 259 | state.stack.push_back( subgroup ); |
| 260 | #endif |
| 261 | } |
| 262 | |
| 263 | void popTree() |
| 264 | { |
no test coverage detected