SpiecsEngine
 
Loading...
Searching...
No Matches

◆ for_each()

void scl::runtime_memory_block::for_each ( const std::function< bool(const std::string &name, void *pt)> & fn) const

Iter the object_ and call explain_element() to filling data.

Parameters
[in]fnThe function pointer of how to fill in data. @noto Not Unit Test, so do not use it.

Iter without order.

Move begin_ to correct position.

The function pointer of how to explain the memory with parameter.

Parameters
[in]nameThe name of parameter.
[in]ptThe pointer of start of parameter occupied.

Iter without order.

Move begin_ to correct position.

The function pointer of how to explain the memory with parameter.

Parameters
[in]nameThe name of parameter.
[in]ptThe pointer of start of parameter occupied.

Definition at line 59 of file RuntimeMemoryBlock.cpp.

60 {
64 for(auto& pair : object_)
65 {
69 void* it = static_cast<char*>(begin_) + pair.second;
70
76 if(fn(pair.first, it)) break;
77 }
78 }
std::unordered_map< std::string, size_t > object_
The data information of the continue memory block handled. Data: parameter name - parameter position ...
void * begin_
The begin pointer of the continue memory block handled.