Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
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
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
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
cc0fc03a
Commit
cc0fc03a
authored
8 years ago
by
Bertrand Bellenot
Browse files
Options
Downloads
Patches
Plain Diff
From Vassil: Add some comments in the new Signal/Slot interfaces
parent
b867a718
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
core/base/inc/TQObject.h
+3
-0
3 additions, 0 deletions
core/base/inc/TQObject.h
core/base/inc/TVirtualQConnection.h
+12
-1
12 additions, 1 deletion
core/base/inc/TVirtualQConnection.h
with
15 additions
and
1 deletion
core/base/inc/TQObject.h
+
3
−
0
View file @
cc0fc03a
...
@@ -98,6 +98,9 @@ public:
...
@@ -98,6 +98,9 @@ public:
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Emit a signal with a varying number of arguments.
/// Emit a signal with a varying number of arguments.
///
///
/// Note: EmitVA(signal_name, const char*) is very different from
/// Emit(signal_name, const char*). EmitVA does not support argument lists.
///
template
<
typename
...
T
>
void
EmitVA
(
const
char
*
signal_name
,
Int_t
/* nargs */
,
const
T
&
...
params
)
template
<
typename
...
T
>
void
EmitVA
(
const
char
*
signal_name
,
Int_t
/* nargs */
,
const
T
&
...
params
)
{
{
// Activate signal with variable argument list.
// Activate signal with variable argument list.
...
...
This diff is collapsed.
Click to expand it.
core/base/inc/TVirtualQConnection.h
+
12
−
1
View file @
cc0fc03a
...
@@ -14,6 +14,11 @@
...
@@ -14,6 +14,11 @@
#include
"TList.h"
#include
"TList.h"
/// Mediates the link between the signal and the slot. It decouples the setting of
/// arguments and sending a signal.
///
/// There are three different modes in argument setting required by TQObject's Emit/EmitVA:
/// setting integral types, setting array types and setting const char*.
class
TVirtualQConnection
:
public
TList
{
class
TVirtualQConnection
:
public
TList
{
protected:
protected:
virtual
void
SetArg
(
Long_t
)
=
0
;
virtual
void
SetArg
(
Long_t
)
=
0
;
...
@@ -56,11 +61,17 @@ protected:
...
@@ -56,11 +61,17 @@ protected:
}
}
public
:
public
:
virtual
void
SendSignal
()
=
0
;
virtual
void
SendSignal
()
=
0
;
/// Unpacks the template parameter type and sets arguments of integral and array (scalar) type.
///
template
<
typename
...
T
>
void
SetArgs
(
const
T
&
...
args
)
template
<
typename
...
T
>
void
SetArgs
(
const
T
&
...
args
)
{
{
SetArgsImpl
(
args
...);
SetArgsImpl
(
args
...);
}
}
// We need a separate overload to allow users to set the argument size of the array.
/// Sets an array of arguments passed as a pointer type and size. If nargs is not specified
/// the number of arguments expected by the slot is used.
///
void
SetArgs
(
const
Long_t
*
argArray
,
Int_t
nargs
=
-
1
)
void
SetArgs
(
const
Long_t
*
argArray
,
Int_t
nargs
=
-
1
)
{
{
SetArg
(
argArray
,
nargs
);
SetArg
(
argArray
,
nargs
);
...
...
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