Skip to content
Snippets Groups Projects
Commit 3b6c144b authored by Christoph Kampmeyer's avatar Christoph Kampmeyer
Browse files

wip #107: Use getVirtualQualifiedName() in StatusAggregator

parent 3a7d5dab
No related branches found
No related tags found
No related merge requests found
#include "StatusAggregator.h"
#include <list>
#include <regex>
namespace ChimeraTK{
......@@ -22,39 +23,44 @@ namespace ChimeraTK{
// }
// Works, as long as we do not use HIerarchyModifiers other than "none" in the test app
// Update: This still has problems, because getOwner gives us the "real" C++ Module
// We need to do everything on the virtual plane
// auto allAccessors{getOwner()->findTag(".*").getAccessorListRecursive()};
// Another try, virtualise the entire Application
auto virtualApplicationHierarchy = Application::getInstance().findTag(".*");
auto virtualPathToThis = getVirtualQualifiedName();
std::cout << " ** Fully qualified name in vitual hierarchy: "
//<< virtualApplicationHierarchy.getQualifiedName() << std::endl;
<< getVirtualQualifiedName() << std::endl;
// std::cout << " Size of allAccessors: " << allAccessors.size() << std::endl;
// Split the name into individual modules
std::regex pathsepRegex{"/"};
std::sregex_token_iterator name{virtualPathToThis.begin(), virtualPathToThis.end(),
pathsepRegex, -1}, end;
// for(auto acc : allAccessors){
// if(acc.getDirection().dir == VariableDirection::feeding){
// std::cout << " -- Accessor: " << acc.getName()
// << " of module: " << acc.getOwningModule()->getName()
// << std::endl;
// }
++name; // Leave out first, empty match. FIXME: Should be avoided by regex
while(name != end){
std::cout << "Current path elem: " << *(name++) << std::endl;
}
// }
// I can just call submodule instead of the above procedure
//Module& thisModule = virtualApplicationHierarchy.submodule(virtualPathToThis);
// Another try, virtualise the entire Application
auto virtualApplicationHierarchy = Application::getInstance().findTag(".*");
std::cout << " ** Fully qualified name in vitual hierarchy: "
<< virtualApplicationHierarchy.getQualifiedName() << std::endl;
// Works, as long as we do not use HIerarchyModifiers other than "none" in the test app
// Update: This still has problems, because getOwner gives us the "real" C++ Module
// We need to do everything on the virtual plane
// auto allAccessors{getOwner()->findTag(".*").getAccessorListRecursive()};
virtualApplicationHierarchy.virtualise();
auto virtualizedModuleList = virtualApplicationHierarchy.getSubmoduleListRecursive();
// std::cout << " Size of allAccessors: " << allAccessors.size() << std::endl;
for(auto module : virtualizedModuleList){
std::cout << " ** " << module->getQualifiedName();
if (module == this){
std::cout << " THIS IS THIS STATUS_AGGREGATOR!";
}
std::cout << std::endl;
}
// for(auto acc : allAccessors){
// if(acc.getDirection().dir == VariableDirection::feeding){
// std::cout << " -- Accessor: " << acc.getName()
// << " of module: " << acc.getOwningModule()->getName()
// << std::endl;
// }
// }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment