Move registerNewStateBlocks() and removeStateBlocks() to HasStateBlocks class
parent
bf0f7487
No related branches found
No related tags found
This commit is part of merge request !337. Comments created here will be created in the context of that merge request.
Showing
- CMakeLists.txt 1 addition, 0 deletionsCMakeLists.txt
- include/core/capture/capture_base.h 0 additions, 2 deletionsinclude/core/capture/capture_base.h
- include/core/frame/frame_base.h 0 additions, 2 deletionsinclude/core/frame/frame_base.h
- include/core/landmark/landmark_base.h 0 additions, 4 deletionsinclude/core/landmark/landmark_base.h
- include/core/state_block/has_state_blocks.h 4 additions, 0 deletionsinclude/core/state_block/has_state_blocks.h
- src/capture/capture_base.cpp 3 additions, 29 deletionssrc/capture/capture_base.cpp
- src/frame/frame_base.cpp 5 additions, 31 deletionssrc/frame/frame_base.cpp
- src/landmark/landmark_base.cpp 3 additions, 29 deletionssrc/landmark/landmark_base.cpp
- src/state_block/has_state_blocks.cpp 34 additions, 0 deletionssrc/state_block/has_state_blocks.cpp
src/state_block/has_state_blocks.cpp
0 → 100644
#include "core/state_block/has_state_blocks.h" | |||
namespace wolf | |||
{ | |||
void HasStateBlocks::registerNewStateBlocks(ProblemPtr _problem) const | |||
{ | |||
if (_problem != nullptr) | |||
{ | |||
for (auto pair_key_sbp : getStateBlockMap()) | |||
if (pair_key_sbp.second != nullptr) | |||
_problem->notifyStateBlock(pair_key_sbp.second, ADD); | |||
} | |||
} | |||
void HasStateBlocks::removeStateBlocks(ProblemPtr _problem) | |||
{ | |||
for (const char key : getStructure()) // note: key is a char | |||
{ | |||
auto sbp = getStateBlock(key); | |||
if (sbp != nullptr) | |||
{ | |||
if (_problem != nullptr) | |||
{ | |||
_problem->notifyStateBlock(sbp,REMOVE); | |||
} | |||
} | |||
removeStateBlock(key); | |||
|
|||
} | |||
} | |||
} |