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
59b337a6
Commit
59b337a6
authored
Dec 01, 2009
by
Sebastian Eichelbaum
Browse files
[DOC] - fixed some missing parameter-doc
parent
535d59e9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
113 additions
and
45 deletions
+113
-45
.hgignore
.hgignore
+1
-0
src/common/WTerminalColor.h
src/common/WTerminalColor.h
+14
-12
src/kernel/WKernel.h
src/kernel/WKernel.h
+7
-4
src/kernel/WModule.h
src/kernel/WModule.h
+21
-10
src/kernel/WModuleContainer.h
src/kernel/WModuleContainer.h
+12
-5
src/kernel/WModuleFactory.h
src/kernel/WModuleFactory.h
+12
-10
src/kernel/test/WModuleConnector_test.h
src/kernel/test/WModuleConnector_test.h
+46
-4
No files found.
.hgignore
View file @
59b337a6
...
...
@@ -9,6 +9,7 @@ syntax: regexp
^doc/developer/html
^doc/developer/man
^doc/developer/doxyerror.log
^build
# files generated by "make tags"
...
...
src/common/WTerminalColor.h
View file @
59b337a6
...
...
@@ -34,7 +34,7 @@ class WTerminalColor
{
public:
/**
/**
* Define possible attributes.
*/
enum
TerminalColorAttribute
...
...
@@ -48,7 +48,7 @@ public:
Default
=
9
// this actually disables coloring
};
/**
/**
* Foreground colors.
*/
enum
TerminalColorForeground
...
...
@@ -63,7 +63,7 @@ public:
FGWhite
=
37
};
/**
/**
* Background colors.
*/
enum
TerminalColorBackground
...
...
@@ -86,7 +86,7 @@ public:
/**
* Creates a new terminal color.
*
*
* \param attrib attribute, like bold or blink
* \param foreground foreground color
* \param background background color
...
...
@@ -100,46 +100,48 @@ public:
/**
* Gives the control string which actually enables the color.
*
*
* \param ostr the stream to extend by the color code.
*
* \return the color control string
*/
std
::
ostream
&
operator
<<
(
std
::
ostream
&
ostr
)
const
;
/**
* Gives the control string which actually enables the color.
*
*
* \return the color control string
*/
std
::
string
operator
()()
const
;
/**
* Colorizes the given string and resets color after it.
*
*
* \param s the string to colorize
*
*
* \return the string including control sequences.
*/
std
::
string
operator
()(
const
std
::
string
s
)
const
;
/**
* Combines strings.
*
*
* \param in the string to combine
*
*
* \return the concatenated string.
*/
std
::
string
operator
+
(
const
std
::
string
&
in
)
const
;
/**
* Resets the color and returns control string.
*
*
* \return the control string which resets color settings.
*/
std
::
string
operator
!
()
const
;
/**
* With this you can easily trigger whether the color control string is used or if "" is returned.
*
*
* \param enabled true to have colors.
*/
void
setEnabled
(
bool
enabled
);
...
...
src/kernel/WKernel.h
View file @
59b337a6
...
...
@@ -60,7 +60,7 @@ public:
/**
* Constructor. Awaits an INITIALIZED graphics engine an gui.
*
*
* \param ge initialized graphics engine.
* \param gui initialized gui.
*/
...
...
@@ -106,20 +106,23 @@ public:
const
WBoolFlag
&
isFinishRequested
()
const
;
/**
* function to call the datahandler load method
* Load specified datasets.
*
* \param fileNames list of filenames to load. The registered notification handler for the root container will get notified on
* error and success.
*/
void
doLoadDataSets
(
std
::
vector
<
std
::
string
>
fileNames
);
/**
* Returns the root module container. This is the actual module graph container.
*
*
* \return the root container.
*/
boost
::
shared_ptr
<
WModuleContainer
>
getRootContainer
()
const
;
/**
* Getter for the associated GUI.
*
*
* \return the GUI.
*/
boost
::
shared_ptr
<
WGUI
>
getGui
()
const
;
...
...
src/kernel/WModule.h
View file @
59b337a6
...
...
@@ -115,21 +115,21 @@ public:
/**
* Checks whether the module instance is ready to be used. This is the case if isInitialized && isAssociated.
*
*
* \return isInitialized && isAssociated
*/
const
WBoolFlag
&
isUseable
()
const
;
/**
* Checks whether this module is associated with an container.
*
*
* \return true if associated.
*/
const
WBoolFlag
&
isAssociated
()
const
;
/**
* The container this module is associated with.
*
*
* \return the container.
*/
boost
::
shared_ptr
<
WModuleContainer
>
getAssociatedContainer
()
const
;
...
...
@@ -137,7 +137,7 @@ public:
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
*
*
* \return the prototype used to create every module in OpenWalnut.
*/
virtual
boost
::
shared_ptr
<
WModule
>
factory
()
const
=
0
;
...
...
@@ -148,9 +148,9 @@ public:
*/
virtual
void
connectToGui
();
/**
/**
* Connects a specified notify function with a signal this module instance is offering.
*
*
* \exception WModuleSignalSubscriptionFailed thrown if the signal can't be connected.
*
* \param signal the signal to connect to.
...
...
@@ -159,11 +159,22 @@ public:
* \return connection descriptor.
*/
virtual
boost
::
signals2
::
connection
subscribeSignal
(
MODULE_SIGNAL
signal
,
t_ModuleGenericSignalHandlerType
notifier
);
/**
* Connects a specified notify function with a signal this module instance is offering.
*
* \exception WModuleSignalSubscriptionFailed thrown if the signal can't be connected.
*
* \param signal the signal to connect to.
* \param notifier the notifier function to bind.
*
* \return connection descriptor.
*/
virtual
boost
::
signals2
::
connection
subscribeSignal
(
MODULE_SIGNAL
signal
,
t_ModuleErrorSignalHandlerType
notifier
);
/**
* Returns a set of prototypes compatible with this module's connectors.
*
*
* \return set of prototypes.
*/
virtual
std
::
set
<
boost
::
shared_ptr
<
WModule
>
>
getCompatibles
();
...
...
@@ -182,7 +193,7 @@ protected:
/**
* Sets the container this module is associated with.
*
*
* \param container the container to associate with.
*/
void
setAssociatedContainer
(
boost
::
shared_ptr
<
WModuleContainer
>
container
);
...
...
@@ -306,12 +317,12 @@ protected:
*/
WBoolFlag
m_initialized
;
/**
/**
* True if container got associated with this flag.
*/
WBoolFlag
m_isAssociated
;
/**
/**
* True if associated && initialized.
*/
WBoolFlag
m_isUsable
;
...
...
src/kernel/WModuleContainer.h
View file @
59b337a6
...
...
@@ -46,7 +46,7 @@ public:
/**
* Constructor. Initializes container.
*
*
* \param name name of the container
* \param description short description.
*/
...
...
@@ -58,9 +58,9 @@ public:
virtual
~
WModuleContainer
();
/**
* Add a module to this container and start it. Please note, that a module can be added only once. If it already is
* Add a module to this container and start it. Please note, that a module can be added only once. If it already is
* associated with this container nothing happens.
*
*
* \param module the module to add.
* \param run true when the module should be run automatically after adding it.
* \throw WModuleUninitialized thrown whenever someone wants to add a module not yet initialized.
...
...
@@ -69,7 +69,7 @@ public:
/**
* Remove the given module from this container if it is associated with it. TODO(ebaum): deep removal? flat removal?
*
*
* \param module the module to remove.
*/
virtual
void
remove
(
boost
::
shared_ptr
<
WModule
>
module
);
...
...
@@ -94,11 +94,18 @@ public:
/**
* Add a specified notifier to the list of default notifiers which get connected to each added module.
*
*
* \param signal the signal the notifier should get connected to
* \param notifier the notifier function
*/
virtual
void
addDefaultNotifier
(
MODULE_SIGNAL
signal
,
t_ModuleErrorSignalHandlerType
notifier
);
/**
* Add a specified notifier to the list of default notifiers which get connected to each added module.
*
* \param signal the signal the notifier should get connected to
* \param notifier the notifier function
*/
virtual
void
addDefaultNotifier
(
MODULE_SIGNAL
signal
,
t_ModuleGenericSignalHandlerType
notifier
);
protected:
...
...
src/kernel/WModuleFactory.h
View file @
59b337a6
...
...
@@ -58,34 +58,34 @@ public:
/**
* Create a new and initialized module using the specified prototype.
*
*
* \param prototype the prototype to clone.
*
*
* \return the module created using the prototype.
*/
boost
::
shared_ptr
<
WModule
>
create
(
boost
::
shared_ptr
<
WModule
>
prototype
);
/**
* Returns instance of the module factory to use to create modules.
*
*
* \return the running module factory.
*/
static
boost
::
shared_ptr
<
WModuleFactory
>
getModuleFactory
();
/**
* Finds a prototype using the specified name.
*
*
* \param name the name.
*
*
* \return the prototype whose name is equal to the specified one.
*/
const
boost
::
shared_ptr
<
WModule
>
getPrototypeByName
(
std
::
string
name
);
/**
* Finds a prototype using an instance of a module. This uses the type_info to find a proper prototype.
*
*
* \param instance the instance to use.
*
*
* \return the prototype.
* \throw WPrototypeUnknown if prototype can not be found.
*/
...
...
@@ -93,9 +93,9 @@ public:
/**
* Checks whether the first instance can be casted to the second one.
*
*
* \param module the module to check.
*
*
* \return true if the dynamic_cast is successful
*/
template
<
typename
T
>
...
...
@@ -103,7 +103,9 @@ public:
/**
* Returns a set of modules compatible with the specified one.
*
*
* \param module the module to find prototype for.
*
* \return set of compatible prototypes.
*/
std
::
set
<
boost
::
shared_ptr
<
WModule
>
>
getCompatiblePrototypes
(
boost
::
shared_ptr
<
WModule
>
module
);
...
...
src/kernel/test/WModuleConnector_test.h
View file @
59b337a6
...
...
@@ -45,7 +45,7 @@
#include "../exceptions/WModuleException.h"
#include "../exceptions/WModuleConnectorUnconnected.h"
/**
/**
* Class implementing a simple module since WModuleConnector itself is not usable for proper
* testing itself because it is has pure virtual methods, i.e. is abstract.
*/
...
...
@@ -54,37 +54,65 @@ class WModuleImpl: public WModule
friend
class
WModuleConnectorTest
;
public:
/**
* Constructor.
*
* \param n a string to test with (sets initial value).
*/
explicit
WModuleImpl
(
std
::
string
n
=
"?"
)
:
WModule
()
{
this
->
n
=
n
;
}
/**
* Destructor.
*/
virtual
~
WModuleImpl
()
{
}
/**
* Create instance of this module class.
*
* \return new instance of this module.
*/
virtual
boost
::
shared_ptr
<
WModule
>
factory
()
const
{
return
boost
::
shared_ptr
<
WModule
>
(
new
WModuleImpl
()
);
}
// required since pure virtual
/**
* Returns name of this module.
*
* \return the name of this module.
*/
virtual
const
std
::
string
getName
()
const
{
return
"testmodule"
;
}
// required since pure virtual
virtual
const
std
::
string
getDescription
()
const
/**
* Returns description of module.
*
* \return the description.
*/
const
std
::
string
getDescription
()
const
{
return
"testdesc"
;
}
/**
* Connect anything to GUI.
*/
virtual
void
connectToGui
()
{
// do nothing here
}
/**
* Set up connectors.
*/
virtual
void
connectors
()
{
m_input
=
boost
::
shared_ptr
<
WModuleInputData
<
int
>
>
(
...
...
@@ -118,6 +146,9 @@ protected:
}
}
/**
* Notifier called whenever a connection got established.
*/
virtual
void
notifyConnectionEstablished
(
boost
::
shared_ptr
<
WModuleConnector
>
/*here*/
,
boost
::
shared_ptr
<
WModuleConnector
>
/*there*/
)
{
...
...
@@ -125,6 +156,9 @@ protected:
// << there->getCanonicalName() << std::endl;
}
/**
* Notifier called whenever a connection got closed.
*/
virtual
void
notifyConnectionClosed
(
boost
::
shared_ptr
<
WModuleConnector
>
/*here*/
,
boost
::
shared_ptr
<
WModuleConnector
>
/*there*/
)
{
...
...
@@ -132,6 +166,11 @@ protected:
// << there->getCanonicalName() << std::endl;
}
/**
* Notifier called whenever a changed data was propagated to one of this modules connectors.
*
* \param output the remote connector propagating the event.
*/
virtual
void
notifyDataChange
(
boost
::
shared_ptr
<
WModuleConnector
>
/*input*/
,
boost
::
shared_ptr
<
WModuleConnector
>
output
)
{
...
...
@@ -206,6 +245,9 @@ public:
m3
->
initialize
();
}
/**
* Initialize some connections.
*/
void
initConnections
(
void
)
{
// connect output with input (cyclic)
...
...
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