Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
29fa100b
Commit
29fa100b
authored
Apr 21, 2010
by
Sebastian Eichelbaum
Browse files
[CHANGE] - now also module containers get deleted after removal
parent
a81bc072
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
18 deletions
+21
-18
src/gui/qt4/WQtToolBar.cpp
src/gui/qt4/WQtToolBar.cpp
+2
-1
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
+2
-0
src/kernel/WModuleConnector.cpp
src/kernel/WModuleConnector.cpp
+2
-2
src/kernel/WModuleConnector.h
src/kernel/WModuleConnector.h
+1
-1
src/kernel/WModuleContainer.cpp
src/kernel/WModuleContainer.cpp
+1
-1
src/kernel/WModuleFactory.cpp
src/kernel/WModuleFactory.cpp
+12
-12
src/kernel/combiner/WModuleProjectFileCombiner.cpp
src/kernel/combiner/WModuleProjectFileCombiner.cpp
+1
-1
No files found.
src/gui/qt4/WQtToolBar.cpp
View file @
29fa100b
...
...
@@ -60,6 +60,8 @@ QAction* WQtToolBar::addWidget( QWidget* widget )
void
WQtToolBar
::
clearButtons
()
{
clear
();
// iterate all items and delete them
for
(
std
::
list
<
QWidget
*
>::
iterator
it
=
m_widgets
.
begin
();
it
!=
m_widgets
.
end
();
++
it
)
{
...
...
@@ -68,7 +70,6 @@ void WQtToolBar::clearButtons()
// clear the lists
m_widgets
.
clear
();
clear
();
// The following prevents the bar from changing size when it has no real buttons.
QPushButton
*
dummyButton
=
new
QPushButton
;
...
...
src/gui/qt4/datasetbrowser/WQtDatasetBrowser.cpp
View file @
29fa100b
...
...
@@ -280,6 +280,8 @@ bool WQtDatasetBrowser::event( QEvent* event )
++
it
;
}
return
true
;
}
return
QDockWidget
::
event
(
event
);
...
...
src/kernel/WModuleConnector.cpp
View file @
29fa100b
...
...
@@ -104,7 +104,7 @@ unsigned int WModuleConnector::isConnected()
void
WModuleConnector
::
connect
(
boost
::
shared_ptr
<
WModuleConnector
>
con
)
{
boost
::
shared_ptr
<
WModule
>
module
=
m_module
;
//
.lock(); // it is "unlocked" at the end of this function as "module" looses its scope
boost
::
shared_ptr
<
WModule
>
module
=
m_module
.
lock
();
// it is "unlocked" at the end of this function as "module" looses its scope
boost
::
shared_ptr
<
WModuleContainer
>
container
=
module
->
getAssociatedContainer
();
std
::
string
containerName
=
container
.
get
()
?
container
->
getName
()
:
"Unknown"
;
WLogger
::
getLogger
()
->
addLogMessage
(
"Connecting "
+
con
->
getCanonicalName
()
+
" with "
+
getCanonicalName
(),
...
...
@@ -205,7 +205,7 @@ boost::signals2::connection WModuleConnector::subscribeSignal( MODULE_CONNECTOR_
const
t_GenericSignalHandlerType
WModuleConnector
::
getSignalHandler
(
MODULE_CONNECTOR_SIGNAL
signal
)
{
// the module instance knows that
boost
::
shared_ptr
<
WModule
>
module
=
m_module
;
//
.lock(); // it is "unlocked" at the end of this function as "module" looses its scope
boost
::
shared_ptr
<
WModule
>
module
=
m_module
.
lock
();
// it is "unlocked" at the end of this function as "module" looses its scope
return
module
->
getSignalHandler
(
signal
);
}
...
...
src/kernel/WModuleConnector.h
View file @
29fa100b
...
...
@@ -205,7 +205,7 @@ protected:
/**
* The Module this connector belongs to
*/
boost
::
shared
_ptr
<
WModule
>
m_module
;
boost
::
weak
_ptr
<
WModule
>
m_module
;
/**
* The name of the module owning this connector.
...
...
src/kernel/WModuleContainer.cpp
View file @
29fa100b
...
...
@@ -243,7 +243,7 @@ void WModuleContainer::stop()
WLogger
::
getLogger
()
->
addLogMessage
(
"Waiting for module
\"
"
+
(
*
listIter
)
->
getName
()
+
"
\"
to finish."
,
"ModuleContainer ("
+
getName
()
+
")"
,
LL_INFO
);
(
*
listIter
)
->
wait
(
true
);
(
*
listIter
)
->
cleanup
();
(
*
listIter
)
->
setAssociatedContainer
(
boost
::
shared_ptr
<
WModuleContainer
>
()
);
// remove last refs to this container inside the module
}
m_moduleAccess
->
endRead
();
...
...
src/kernel/WModuleFactory.cpp
View file @
29fa100b
...
...
@@ -263,12 +263,12 @@ std::vector< boost::shared_ptr< WApplyPrototypeCombiner > > WModuleFactory::getC
return
compatibles
;
}
if
(
cons
.
size
()
>
1
)
{
wlog
::
warn
(
"ModuleFactory"
)
<<
"Can not find compatibles for "
<<
module
->
getName
()
<<
" module (more than 1 output connector). Using "
<<
(
*
cons
.
begin
()
)
->
getCanonicalName
()
<<
" for compatibility check."
;
}
//
if ( cons.size() > 1 )
//
{
//
wlog::warn( "ModuleFactory" ) << "Can not find compatibles for " << module->getName() << " module (more than 1 output connector). Using "
//
<< ( *cons.begin() )->getCanonicalName()
//
<< " for compatibility check.";
//
}
// go through every prototype
for
(
std
::
set
<
boost
::
shared_ptr
<
WModule
>
>::
iterator
listIter
=
m_prototypes
.
begin
();
listIter
!=
m_prototypes
.
end
();
++
listIter
)
...
...
@@ -281,12 +281,12 @@ std::vector< boost::shared_ptr< WApplyPrototypeCombiner > > WModuleFactory::getC
{
continue
;
}
if
(
pcons
.
size
()
>
1
)
{
wlog
::
warn
(
"ModuleFactory"
)
<<
"Can not find compatibles for "
<<
(
*
listIter
)
->
getName
()
<<
" module (more than 1 input connector). Using "
<<
(
*
pcons
.
begin
()
)
->
getCanonicalName
()
<<
" for compatibility check."
;
}
//
if ( pcons.size() > 1 )
//
{
//
wlog::warn( "ModuleFactory" ) << "Can not find compatibles for " << ( *listIter )->getName()
//
<< " module (more than 1 input connector). Using "
//
<< ( *pcons.begin() )->getCanonicalName() << " for compatibility check.";
//
}
// check whether the outputs are compatible with the inputs of the prototypes
if
(
(
*
cons
.
begin
()
)
->
connectable
(
*
pcons
.
begin
()
)
&&
(
*
pcons
.
begin
()
)
->
connectable
(
*
cons
.
begin
()
)
)
...
...
src/kernel/combiner/WModuleProjectFileCombiner.cpp
View file @
29fa100b
...
...
@@ -400,7 +400,7 @@ void WModuleProjectFileCombiner::save( std::ostream& output ) // NOLINT
iciter
!=
(
*
citer
)
->
m_connected
.
end
();
++
iciter
)
{
// as the module is a weak_ptr -> lock and get access to it
boost
::
shared_ptr
<
WModule
>
theOtherModule
=
(
*
iciter
)
->
m_module
;
//
.lock();
boost
::
shared_ptr
<
WModule
>
theOtherModule
=
(
*
iciter
)
->
m_module
.
lock
();
output
<<
"CONNECTION:("
<<
moduleToIDMap
[
(
*
iter
)
]
<<
","
<<
(
*
citer
)
->
getName
()
<<
")->("
<<
moduleToIDMap
[
theOtherModule
]
<<
","
<<
(
*
iciter
)
->
getName
()
<<
")"
<<
std
::
endl
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment