Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChimeraTK Mirror
ApplicationCore
Commits
7287c4b4
Commit
7287c4b4
authored
7 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
prevent readAll() etc. functions to recurse into submodules with their own thread
parent
5a45fa82
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/EntityOwner.h
+5
-2
5 additions, 2 deletions
include/EntityOwner.h
src/EntityOwner.cc
+8
-3
8 additions, 3 deletions
src/EntityOwner.cc
with
13 additions
and
5 deletions
include/EntityOwner.h
+
5
−
2
View file @
7287c4b4
...
@@ -54,8 +54,11 @@ namespace ChimeraTK {
...
@@ -54,8 +54,11 @@ namespace ChimeraTK {
/** Obtain the list of submodules associated with this instance */
/** Obtain the list of submodules associated with this instance */
const
std
::
list
<
Module
*>&
getSubmoduleList
()
const
{
return
moduleList
;
}
const
std
::
list
<
Module
*>&
getSubmoduleList
()
const
{
return
moduleList
;
}
/** Obtain the list of accessors/variables associated with this instance and any submodules */
/** Obtain the list of accessors/variables associated with this instance and any variable groups. If the optional
std
::
list
<
VariableNetworkNode
>
getAccessorListRecursive
();
* argument is set to true, also submodules (which have their own thread) are included. In that case, the
* accessors in the returned list may not be used (i.e. write or read data or initiate transfers) from the same
* thread and only connections may be registered between the accessors. */
std
::
list
<
VariableNetworkNode
>
getAccessorListRecursive
(
bool
includeSubmodules
=
false
);
/** Obtain the list of submodules associated with this instance and any submodules */
/** Obtain the list of submodules associated with this instance and any submodules */
std
::
list
<
Module
*>
getSubmoduleListRecursive
();
std
::
list
<
Module
*>
getSubmoduleListRecursive
();
...
...
This diff is collapsed.
Click to expand it.
src/EntityOwner.cc
+
8
−
3
View file @
7287c4b4
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#include
"EntityOwner.h"
#include
"EntityOwner.h"
#include
"Module.h"
#include
"Module.h"
#include
"VirtualModule.h"
#include
"VirtualModule.h"
#include
"VariableGroup.h"
namespace
ChimeraTK
{
namespace
ChimeraTK
{
...
@@ -49,13 +50,17 @@ namespace ChimeraTK {
...
@@ -49,13 +50,17 @@ namespace ChimeraTK {
/*********************************************************************************************************************/
/*********************************************************************************************************************/
std
::
list
<
VariableNetworkNode
>
EntityOwner
::
getAccessorListRecursive
()
{
std
::
list
<
VariableNetworkNode
>
EntityOwner
::
getAccessorListRecursive
(
bool
includeSubmodules
)
{
// add accessors of this instance itself
// add accessors of this instance itself
std
::
list
<
VariableNetworkNode
>
list
=
getAccessorList
();
std
::
list
<
VariableNetworkNode
>
list
=
getAccessorList
();
// iterate through submodules
// iterate through submodules
for
(
auto
submodule
:
getSubmoduleList
())
{
for
(
auto
submodule
:
getSubmoduleList
())
{
auto
sublist
=
submodule
->
getAccessorListRecursive
();
// ignore anything that is not a VariableGroup if submodules should not be included
/// @todo Add test for this!
if
(
!
includeSubmodules
&&
dynamic_cast
<
VariableGroup
*>
(
submodule
)
==
nullptr
)
continue
;
// obtail list of accessors from the submodule/group and insert it into the list
auto
sublist
=
submodule
->
getAccessorListRecursive
(
includeSubmodules
);
list
.
insert
(
list
.
end
(),
sublist
.
begin
(),
sublist
.
end
());
list
.
insert
(
list
.
end
(),
sublist
.
begin
(),
sublist
.
end
());
}
}
return
list
;
return
list
;
...
@@ -156,7 +161,7 @@ namespace ChimeraTK {
...
@@ -156,7 +161,7 @@ namespace ChimeraTK {
VirtualModule
EntityOwner
::
flatten
()
{
VirtualModule
EntityOwner
::
flatten
()
{
VirtualModule
nextmodule
{
_name
,
_description
};
VirtualModule
nextmodule
{
_name
,
_description
};
for
(
auto
&
node
:
getAccessorListRecursive
())
{
for
(
auto
&
node
:
getAccessorListRecursive
(
true
))
{
nextmodule
.
registerAccessor
(
node
);
nextmodule
.
registerAccessor
(
node
);
}
}
return
nextmodule
;
return
nextmodule
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment