Add sigc 2.2.2
git-svn-id: svn://localhost/ardour2/branches/3.0@3437 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
8
libs/sigc++2/AUTHORS
Normal file
8
libs/sigc++2/AUTHORS
Normal file
@@ -0,0 +1,8 @@
|
||||
Martin Schulze <mschulze@cvs.gnome.org>
|
||||
Murray Cumming <murrayc@murrayc.com>
|
||||
Cedric Gustin <cedric.gustin@swing.be> (win32 support)
|
||||
Timothy M. Shead <tshead@k-3d.com> and James Lin <jameslin@vmware.com> (MSVC support)
|
||||
Damien Carbery <Damien.Carbery@Sun.COM> (Sun FORTE C++ support)
|
||||
Takashi Takekawa <takekawa@users.sourceforge.jp> (Intel C++ support)
|
||||
Andreas Rottmann <rottmann@users.sourceforge.net> (make system)
|
||||
Karl Einar Nelson <kenelson@ece.ucdavis.edu> (initial version 1.9.4)
|
||||
515
libs/sigc++2/COPYING
Normal file
515
libs/sigc++2/COPYING
Normal file
@@ -0,0 +1,515 @@
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations
|
||||
below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
^L
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it
|
||||
becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
^L
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control
|
||||
compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
^L
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
^L
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
^L
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
^L
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply, and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License
|
||||
may add an explicit geographical distribution limitation excluding those
|
||||
countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
^L
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
^L
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms
|
||||
of the ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library.
|
||||
It is safest to attach them to the start of each source file to most
|
||||
effectively convey the exclusion of warranty; and each file should
|
||||
have at least the "copyright" line and a pointer to where the full
|
||||
notice is found.
|
||||
|
||||
|
||||
<one line to give the library's name and a brief idea of what it
|
||||
does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper
|
||||
mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or
|
||||
your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James
|
||||
Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
1968
libs/sigc++2/ChangeLog
Normal file
1968
libs/sigc++2/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
229
libs/sigc++2/INSTALL
Normal file
229
libs/sigc++2/INSTALL
Normal file
@@ -0,0 +1,229 @@
|
||||
Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. (Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.)
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You only need
|
||||
`configure.ac' if you want to change it or regenerate `configure' using
|
||||
a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. Run `./configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not support the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a
|
||||
time in the source code directory. After you have installed the
|
||||
package for one architecture, use `make distclean' before reconfiguring
|
||||
for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, `configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
will cause the specified gcc to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
18
libs/sigc++2/Makefile.am
Normal file
18
libs/sigc++2/Makefile.am
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
# it includes all the autostuff automatically, you just name the
|
||||
# other stuff here
|
||||
EXTRA_DIST = autogen.sh sigc++config.h.in libsigc++-2.0.spec.in
|
||||
# ACLOCAL_FLAGS = -I scripts
|
||||
|
||||
SUBDIRS = sigc++ scripts
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
|
||||
sigc_configdir = $(libdir)/sigc++-2.0/include
|
||||
sigc_config_DATA = sigc++config.h
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = sigc++-2.0.pc
|
||||
|
||||
all-local:
|
||||
@echo "*** Everything completed ***"
|
||||
|
||||
354
libs/sigc++2/NEWS
Normal file
354
libs/sigc++2/NEWS
Normal file
@@ -0,0 +1,354 @@
|
||||
2.2.2 (stable)
|
||||
|
||||
* Added an include of functors/slot.h that was mistakenly removed
|
||||
during the 2.1 series.
|
||||
(Deng Xiyue) Bug #521418.
|
||||
|
||||
2.2.1 (stable):
|
||||
|
||||
* Really fix the build with Sun CC.
|
||||
(Elaine Xiong. Bug #302098)
|
||||
|
||||
2.2.0 (stable):
|
||||
|
||||
* Build fixes when using gcc 4.3 pre-releases.
|
||||
(Ryan Hill, Vladimir Marek)
|
||||
|
||||
2.1.1 (unstable):
|
||||
|
||||
WARNING: This is an unstable release and should not yet be
|
||||
packaged by distributions unless libsigc++ 2.0.x does not
|
||||
build for some reason (Please report such bugs).
|
||||
|
||||
* Removed the SigC:: namespace and other compatibility API,
|
||||
to fix the build with some versions of some compilers,
|
||||
such as the SUN Forte C++ CC compiler.
|
||||
See bug #302098, for instance
|
||||
(Murray Cumming)
|
||||
* sigc::signal<>:
|
||||
- Added Added typedefs for
|
||||
value_type, reference, and pointer, so that these
|
||||
iterators are more like standard C++ iterators, so they can
|
||||
be used with standard C++ algorithms.
|
||||
(Michael Elkstrand) (Bug #417926).
|
||||
- Added emit_reverse().
|
||||
(John Profic)
|
||||
|
||||
2.0.17:
|
||||
|
||||
* slot::disconnect(): Make this work.
|
||||
sigc::connection::disconnect() already worked.
|
||||
(James Lin, Murray Cumming)
|
||||
* visit_each compilation problem fixed.
|
||||
(Philipp Berndt)
|
||||
|
||||
2.0.16:
|
||||
|
||||
* Fixed build for SUN Forte C++ 5.5
|
||||
* Fixed build for MSVC++ 7.1
|
||||
* Fixed crash when using --no-inline with g++.
|
||||
|
||||
2.0.15:
|
||||
|
||||
* g++ 3.2 (and Mac OS X g++ 3.3) build fix.
|
||||
(Paul Pogonyshev)
|
||||
* Compose: Fix slot lifetime regression introduced in
|
||||
2.0.9. (Philip Langdale)
|
||||
* tests: Small ISO C++ correctness fix (Marek Rouchal)
|
||||
* Don't specify unused function parameter names.
|
||||
(Andris Pavenis)
|
||||
|
||||
2.0.14:
|
||||
|
||||
* SUN Forte 5.7 build fix for ambiguity when using
|
||||
inner template class. However, you still need the
|
||||
patch in bug #302098 to finish the build.
|
||||
|
||||
2.0.13:
|
||||
|
||||
* signal_emit::emit(): Ensure the correct order of
|
||||
destruction of the member variables, to avoid a leak.
|
||||
(Andreas Ames, bug #306249)
|
||||
* Allow recursive signal emission again.
|
||||
(Neal E. Coombes, bug #303896)
|
||||
* SUN Forte CC 5.5 build fixes:
|
||||
- test_compatibility minor fix.
|
||||
- visit_each() template specializations:
|
||||
Mention the bool I_derives_trackable template type,
|
||||
(Friedemann Kleint, bug #305647)
|
||||
- Check for the non-standard SUN reverse_iterator,
|
||||
and use alternative code if necessary.
|
||||
(Murray Cumming)
|
||||
|
||||
2.0.12:
|
||||
|
||||
* Fixes crashes when using virtual inheritance, particularly
|
||||
with bound by-reference parameters, caused by casting
|
||||
from derived to base when the derived destructor has run.
|
||||
(Régis Duchesne)
|
||||
This might affect non-g++ compilers, so do tell us about
|
||||
any problems.
|
||||
|
||||
2.0.11:
|
||||
|
||||
* Build fixes for SUN Forte, Tru64
|
||||
(Murray Cumming), and MSVC++ (Cedric Gustin).
|
||||
|
||||
2.0.10:
|
||||
|
||||
* tests: Include <new> to avoid unresolved symbols on Tru64.
|
||||
(Tim Mooney)
|
||||
* When signal handlers are connected made during an emit
|
||||
of the same signal, prevent them from being called in the
|
||||
same emit, to prevent infinite loops.
|
||||
(Neal E. Coombes)
|
||||
* Performance improvement in a corner case.
|
||||
(Neal E. Coombes).
|
||||
|
||||
2.0.9:
|
||||
|
||||
* sigc::bind() now works with the AIX and Tru64 compilers.
|
||||
See the comments in sigc++/visit_each.h: visit_each_type()
|
||||
if you have compilation problems.
|
||||
(Murray Cumming)
|
||||
* sigc::var() is now documented. (Roger Ferrer Ibáñez)
|
||||
|
||||
2.0.8:
|
||||
|
||||
* Maybe avoid (incorrect) warning with g++ 3.3.5.
|
||||
(Murray Cumming)
|
||||
* Fix namespace ambiguity when using multiple
|
||||
major versions of libsigc++. (Liza Klerck)
|
||||
|
||||
2.0.7:
|
||||
|
||||
* Now builds with the following compilers, in addition to
|
||||
the existing GNU g++, SUN Forte CC 5.5, MSVC++ .Net 2003,
|
||||
and Intel compilers:
|
||||
- IBM AIX xlC v7
|
||||
- Tru64 C++ V6.5-042
|
||||
- IRIX MIPSpro 7.4.2m
|
||||
(Older versions of all these compilers might also work.)
|
||||
(Murray Cumming, www.thewrittenword.com)
|
||||
* MSVC++ .Net 2003 build improvements.
|
||||
(Cedric Gustin, Timothy M. Shead)
|
||||
* Replace C-style casts with reinterpret_cast<> and
|
||||
static_cast<>. (e97_far at e.kth.se).
|
||||
* Documentation: Added manual, based on the manual in
|
||||
libsigc++ 1.2, but updated for the new API.
|
||||
(Murray Cumming)
|
||||
|
||||
|
||||
2.0.6:
|
||||
|
||||
* Fixed a memory leak in sigc::slot.
|
||||
* Fixed compilation for gcc-3.4.
|
||||
* Fixed compilation for Intel C++ compiler (upgraded libtool).
|
||||
* Fixed project files for MSVC .Net (Timothy M. Shead).
|
||||
* Fixed segfaults when compiled with MSVC .Net 2003 (moved
|
||||
all calls to new and delete into non-inline library code).
|
||||
* In the compatibility module use correct bound_mem_functor
|
||||
variants for const (volatile) methods when creating a slot.
|
||||
* Minor documentation fix.
|
||||
* Resolved bugs: #152327 #148744 #152323 #151404 #153143
|
||||
|
||||
2.0.5:
|
||||
|
||||
* Distribute pregenerated configuration header for MSVC .Net.
|
||||
|
||||
2.0.4:
|
||||
|
||||
* Fixed warnings and compiler errors in the test cases.
|
||||
* Added a new test case (Murray Cumming).
|
||||
* Fixed 'hello_world' example.
|
||||
* Don't test optional features that fail with the Sun FORTE.
|
||||
* Fixes for the Sun FORTE to compile out-of-the-box
|
||||
(Damien Carbery, Murray Cumming, Martin Schulze).
|
||||
* Fixes for MSVC to build a DLL out-of-the-box (James Lin).
|
||||
* Improved compiler specific configuration during 'configure'.
|
||||
* Added rmp description file libsigc++-2.0.spec (Eric Bourque).
|
||||
* Minor documentation improvements (Murray Cumming).
|
||||
* Resolved bugs: #147311 #147313 #147391 #144846 #145541
|
||||
|
||||
2.0.3:
|
||||
|
||||
* Fix segfault on emission of unconnected signal.
|
||||
* Test emission of unconnected signals in the test case.
|
||||
* Suppress compiler warning at dynamic_cast<>-test for good.
|
||||
(Help from Christof Petig and Timothy M. Shead.)
|
||||
|
||||
2.0.2:
|
||||
|
||||
* Suppress compiler warning in compatibility module at
|
||||
dynamic_cast<>-test (fix suggested by Timothy M. Shead).
|
||||
* If a custom accumulator is specified invoke it on signal
|
||||
emission even if the signal's slot list is empty. (This used
|
||||
to be the case in libsigc++-1.2 as pointed out by Timothy.)
|
||||
|
||||
2.0.1:
|
||||
|
||||
* Fixed serious bug in reference counting in sigc::signal_base::impl().
|
||||
* Fixed SigC::Object-derivation check in SigC::slot() compatibility module.
|
||||
* Fixed compilation on Apple gcc 3.3 (assisted by Spundun Bhatt).
|
||||
* Fixed configure check for gcc 3.4 (Murray Cumming).
|
||||
|
||||
2.0.0:
|
||||
|
||||
* Implemented sigc::connection::blocked() (Murray Cumming).
|
||||
* Added the scripts directory to the make dist target (Murray Cumming).
|
||||
* Added more documentation (Martin Schulze).
|
||||
|
||||
1.9.16:
|
||||
|
||||
* Fixed compiler warning in sigc::connection (Alexander Nedotsukov, Murray Cumming).
|
||||
* Fixed examples and made them part of the regular build (Murray Cumming).
|
||||
* Added header sigc++config.h for configure time checks (Murray Cumming).
|
||||
* Added configure time checks to determine the correct syntax
|
||||
for explicit template method specializations (Murray Cumming).
|
||||
* Removed code using partial specializations of overloaded template methods
|
||||
from test cases. SUN Forte doesn't support this feature (Martin Schulze).
|
||||
* Fixed compilation for gcc 3.4 (Murray Cumming).
|
||||
|
||||
1.9.15:
|
||||
|
||||
API additions:
|
||||
* Add numbered slot# templates.
|
||||
* Allow for methods of the object's base types to be passed into sigc::mem_fun().
|
||||
|
||||
Other fixes and cleanups:
|
||||
* Make is_base_and_derived template compatible with the SUN Forte.
|
||||
* Non-template code moved from .m4 macro source to .h/.cc files (Murray Cumming).
|
||||
* Implementation moved to .cc files (Murray Cumming).
|
||||
* More fixes for the SUN Forte. Make some more ctors explicit.
|
||||
|
||||
1.9.14:
|
||||
|
||||
* Added sigc::slot_base::operator bool() (Murray Cumming).
|
||||
* Build docs directory by default (Murray Cumming).
|
||||
* Fixed minor doxygen issues (Murray Cumming).
|
||||
* Fixed compiler warning in signal.h (Murray Cumming).
|
||||
|
||||
1.9.13:
|
||||
|
||||
* Fixed passing references through sigc::slot (Reported by Jeff Franks).
|
||||
* Enabled binding of objects to method slots through sigc::bind().
|
||||
* Reworked sigc::bind() API: Made the template argument for the
|
||||
parameter position zero-based and optional. Added overloads for
|
||||
binding of up to 7 arguments at a time when no position is specified.
|
||||
* Reworked sigc::hide() API: Made the template argument for the
|
||||
parameter position zero-based and optional.
|
||||
* Fixed compilation problems with MSVC .Net 2003 (Roel Vanhout).
|
||||
* Distribute MSVC .Net 2003 project files in the tarballs.
|
||||
* Improved and extended documentation.
|
||||
* Minor cleanups.
|
||||
|
||||
1.9.12:
|
||||
|
||||
* Added adaptor retype(). With this final API addition all adaptors
|
||||
are in place that are available in libsigc++-1.2.
|
||||
* Added negation lambda operator. Use STL names for lambda actions.
|
||||
* Remove formerly disabled support for gcc extension typeof().
|
||||
* Added project files for MS Visual Studio .Net 2003. (Roel Vanhout)
|
||||
* Make libsigc++2 compile with .Net 2003. (Roel Vanhout, Martin Schulze)
|
||||
* Build shared version of libsigc++2 by default. (Cedric Gustin)
|
||||
* Add support for win32 platform. (Cedric Gustin)
|
||||
* Install .m4 files. (requested by Ron Steinke)
|
||||
* Cleaned up functors.
|
||||
* Restructured and completed documentation of the core library parts.
|
||||
|
||||
1.9.11:
|
||||
|
||||
API Additions and important bug fixes:
|
||||
* Compatibility module completed. libsigc++-1.2 filenames are preserved.
|
||||
* Fixed critical bug in auto-disconnection: don't defer detaching
|
||||
of a slot from all referred trackables during signal emission.
|
||||
* Reduced size of slots significantly.
|
||||
* Fixed support for sigc::ref() in adaptors.
|
||||
* Fixed sigc::visit_each(): only hit targets that are passed by
|
||||
reference; pass bound members in bound_member_functor by reference.
|
||||
* Add lambda actions sigc::{reinterpret,static,dynamic}_cast_
|
||||
to support explicit parameter conversion.
|
||||
* Add adaptors sigc::retype_return<>() and sigc::hide_return().
|
||||
|
||||
Minor fixes:
|
||||
* Fixed return type deduction for bind<0>.
|
||||
libsigc++-1.9.11 should compile with gcc-3.3.
|
||||
* Fixed copy constructor and operator=() of slot template.
|
||||
* Fixed a compiler warning in signal_emit#<>::emit().
|
||||
* Improved test case.
|
||||
|
||||
1.9.10:
|
||||
|
||||
* Fix compiler issues with gcc-3.3.2 (patch from Jeff Franks).
|
||||
* Remove compiler check for the gcc extension typeof().
|
||||
* Simplify bind_functor templates.
|
||||
* Move definition of struct nil into functor_trait.h.
|
||||
|
||||
1.9.9:
|
||||
|
||||
* Add a constructor to sigc::connection that takes a slot_base&
|
||||
to support user defined slot lists like they are used in gtkmm.
|
||||
* Fix compiler issues with gcc-3.3.2 (reported by Jeff Franks).
|
||||
|
||||
1.9.8:
|
||||
|
||||
* Add compatibility module that defines namespace SigC.
|
||||
namespace SigC should be API compatible to libsigc++-1.2.
|
||||
Currently only the core parts of the library are supported.
|
||||
Adaptors are still to follow.
|
||||
* Fix connection::operator=(). Include connection.h in sigc++.h.
|
||||
* Get rid of namespace functor.
|
||||
* Rename dependency to destroy_notify_callback.
|
||||
* Rename trackable::clear() to trackable::notify_callbacks().
|
||||
* Move slot_base, signal_base, slot_iterator[_buf], slot_list
|
||||
out of namespace internal. They are public API.
|
||||
* Add reference counter to signal_impl enabling signals
|
||||
to share the underlying information.
|
||||
* Add convenience function signal#::make_slot().
|
||||
* Get rid of one-letter-parameter-names.
|
||||
* Get rid of "using namespace ..." in the test cases.
|
||||
* Add lambda operators subscript ([]) and assign (=).
|
||||
* Fix is_base_and_derived<> for const types.
|
||||
* New and updated documentation.
|
||||
* Add previous announces to file NEWS.
|
||||
|
||||
1.9.7:
|
||||
|
||||
* Added sigc++/sigc++.h. (Murray Cumming)
|
||||
* Added member_method example. (Murray Cumming)
|
||||
* Renamed closure to slot.
|
||||
* Fixed issues with gcc-3.3. (Adreas Rottmann)
|
||||
* Removed unnecessary void specializations.
|
||||
* Made adaptors' operator()() (overload with no arguments) return a value.
|
||||
* Made visit_each() support adaptors.
|
||||
* Overhauled return type deduction to make it work without typeof().
|
||||
* Added convinience macros SIGC_FUNCTORS_HAVE_RESULT_TYPE and
|
||||
SIGC_FUNCTOR_TRAIT(T_functor, T_result) to make return type deduction system
|
||||
support 3rd-party funtors.
|
||||
* Changed syntax of group adaptor from "[functor] % grp([lambdas])" to "group
|
||||
([functor], [lambdas])".
|
||||
* Made many fixes to lambda functionality.
|
||||
* Added var() and constant() lambda creators.
|
||||
* Added many lambda operators.
|
||||
* Added ref() which creates a reference wrapper to enable storage of
|
||||
references in bind and group adaptors.
|
||||
* Expanded test suite.
|
||||
* Added documentation. (Corrections by Murray Cumming)
|
||||
|
||||
1.9.6:
|
||||
|
||||
* First public release of the unstable 2.0 generation.
|
||||
libsigc++ 2.0 uses modern C++ mechanisms to achieve a highly
|
||||
flexible, yet typesafe callback system. It supports all features of
|
||||
libsigc++ 1.2 and improves upon it by:
|
||||
- No need to specify the number of arguments in signal definitions.
|
||||
- Connection of any compatible (=implicitly convertable) functor
|
||||
to a signal.
|
||||
- Implicit type conversions of parameters during signal emission.
|
||||
- Lambda adaptor for complete restructuring of functor parameter
|
||||
lists in one line (subject to changes).
|
||||
- Signal has a fully featured stl style list interface.
|
||||
- A convinient accumulator API (replacing the old marshaller API).
|
||||
- Removal of unnecessary memory management functionality.
|
||||
- Lightweight class "trackable" for use as base class of your
|
||||
class hierarchy replaces class "Object".
|
||||
72
libs/sigc++2/README
Normal file
72
libs/sigc++2/README
Normal file
@@ -0,0 +1,72 @@
|
||||
libsigc++ -- The Typesafe Callback Framework for C++
|
||||
|
||||
|
||||
General information:
|
||||
|
||||
libsigc++ implements a typesafe callback system for standard C++. It
|
||||
allows you to define signals and to connect those signals to any
|
||||
callback function, either global or a member function, regardless of
|
||||
whether it is static or virtual.
|
||||
|
||||
libsigc++ is used by gtkmm to wrap the GTK+ signal system. It does not
|
||||
depend on GTK or gtkmm.
|
||||
|
||||
Further information about the major release 2.0 is available on the
|
||||
libsigc++ project home page: http://libsigc.sourceforge.net/
|
||||
|
||||
|
||||
License information:
|
||||
|
||||
Distribution of library and components is under the LGPL as listed in the
|
||||
file COPYING. Examples and tests are Public Domain.
|
||||
|
||||
|
||||
Contact information:
|
||||
Maintainer: mailto: mschulze@cvs.gnome.org
|
||||
Maillist: mailto: libsigc-list@gnome.org
|
||||
Homepage: http://libsigc.sourceforge.net
|
||||
Online reference documentation: http://libsigc.sourceforge.net/libsigc2/docs/
|
||||
Ftp: http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.0/
|
||||
CVS:
|
||||
|
||||
|
||||
Overview of the distribution:
|
||||
|
||||
docs/ documentation on the signal system
|
||||
docs/reference/ reference documentation
|
||||
|
||||
examples/ examples of various signal functions
|
||||
|
||||
sigc++/ source for library
|
||||
sigc++/macros/ .m4 files used to auto-generate source files
|
||||
sigc++/functors/ source for library (various functors)
|
||||
sigc++/functors/macros/ .m4 files used to auto-generate source files
|
||||
sigc++/adaptors/ source for library (various adaptors)
|
||||
sigc++/adaptors/macros/ .m4 files used to auto-generate source files
|
||||
sigc++/adpators/lambda/ source for library (lambda library)
|
||||
sigc++/adpators/lambda/macros/ .m4 files used to auto-generate source files
|
||||
|
||||
scripts/ automake junk
|
||||
|
||||
tests/ programs testing and verifying proper behaviour
|
||||
|
||||
MSVC_Net2003/ project files for building the library with MSVC .NET 2003
|
||||
|
||||
|
||||
Compatibility:
|
||||
|
||||
Compatible compilers must supports the following recent c++ techniques:
|
||||
* Partial template (function) specialization.
|
||||
* Explicit template (member) function instantiation.
|
||||
* Treat void return as normal return.
|
||||
|
||||
This release has only been tested with gcc-3.3. It should at least also compile with:
|
||||
* gcc >= 3.2
|
||||
* cygwin (gcc >= 3.2)
|
||||
* mingw32
|
||||
* Microsoft Visual Studio .Net 2003
|
||||
* Sun Forte C++ compiler >= 5.5
|
||||
* Compaq C++ compiler
|
||||
* Intel compiler
|
||||
Please report any troubles you encounter with these compilers!
|
||||
You are also invited to try a compiler that is not listed above.
|
||||
41
libs/sigc++2/SConscript
Normal file
41
libs/sigc++2/SConscript
Normal file
@@ -0,0 +1,41 @@
|
||||
# -*- python -*-
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import glob
|
||||
|
||||
sigc2_files = glob.glob('sigc++/*.cc') + glob.glob('sigc++/functors/*.cc') + glob.glob('sigc++/adaptors/lambda/*.cc')
|
||||
|
||||
Import('env install_prefix')
|
||||
sigc2 = env.Clone()
|
||||
|
||||
libsigc2 = sigc2.SharedLibrary('sigc++2', sigc2_files)
|
||||
|
||||
if os.access ('autogen.sh', os.F_OK) :
|
||||
sigc2_configure_script = sigc2.Command ('configure', 'configure.ac', 'cd libs/sigc++2 && ./autogen.sh && cd -', ENV=os.environ)
|
||||
sigc2_config_h = sigc2.Command('sigc++config.h', [sigc2_configure_script, 'sigc++config.h.in'], 'cd libs/sigc++2 && ./configure && cd -', ENV=os.environ)
|
||||
else :
|
||||
sigc2_config_h = sigc2.Command('sigc++config.h', ['configure', 'sigc++config.h.in'], 'cd libs/sigc++2 && ./configure && cd -', ENV=os.environ)
|
||||
|
||||
|
||||
Default([sigc2_config_h,libsigc2])
|
||||
|
||||
env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), libsigc2))
|
||||
|
||||
env.Alias('tarball', env.Distribute (env['DISTTREE'],
|
||||
[ 'NEWS', 'README', 'AUTHORS', 'ChangeLog',
|
||||
'configure', 'configure.ac', 'Makefile.am', 'SConscript',
|
||||
'sigc++/Makefile.in',
|
||||
'sigc++config.h',
|
||||
'sigc++config.h.in',
|
||||
'sigc++-2.0.pc.in',
|
||||
'libsigc++-2.0.spec.in',
|
||||
'install-sh',
|
||||
'Makefile.in',
|
||||
'scripts',
|
||||
'missing',
|
||||
] + sigc2_files +
|
||||
glob.glob('sigc++/*.h') +
|
||||
glob.glob('sigc++/functors/*.h') + glob.glob('sigc++/adaptors/lambda/*.h') +
|
||||
glob.glob('sigc++/adaptors/*.h')
|
||||
))
|
||||
66
libs/sigc++2/TODO
Normal file
66
libs/sigc++2/TODO
Normal file
@@ -0,0 +1,66 @@
|
||||
Compatibility:
|
||||
|
||||
- Fix compilation for SUN FORTE C++ 5.5.
|
||||
|
||||
|
||||
Configure checks and Makefile issues:
|
||||
|
||||
- When you use a single Makefile.am for
|
||||
several directories (in sigc++2, all under sigc++/ is ruled by a
|
||||
single Makefile.am with the new build system), you have a problem when
|
||||
you do a build where $(srcdir) != $(builddir), since in the build-tree
|
||||
the necessary subdirectories are not created. So I have to find a
|
||||
place where to create this directories, in case they do not exist.
|
||||
This is only an issue for clean CVS checkouts, however (Andy)
|
||||
|
||||
|
||||
sigc++-1.2 compatibility:
|
||||
|
||||
- Verify completeness.
|
||||
|
||||
|
||||
documentation:
|
||||
|
||||
- Improve documentation: Make groups (see index.html). Exclude stuff to make
|
||||
the html output readable.
|
||||
|
||||
- Add documentation for adaptors and accumulators.
|
||||
|
||||
|
||||
basic functionality:
|
||||
|
||||
- I don't understand what is meant by "stl-pointer-like functions" (Martin):
|
||||
|
||||
slot should have the full set of stl pointer like functions. (Karl Nelson)
|
||||
|
||||
|
||||
lambda functionality (I don't understand this (Martin)):
|
||||
|
||||
- Add support for _R to force references down into
|
||||
the stack frame of lambda. Ie.
|
||||
|
||||
A a;
|
||||
(_1+_2)(1,a); // fail if no "operator int() const"
|
||||
|
||||
- Call groups in lambda. (Huh, that appears to be in group?)
|
||||
|
||||
|
||||
Old TODO's that should be almost finished (Martin):
|
||||
|
||||
- Fine-tooth comb the code looking for missing operator =() function
|
||||
and missing copy constructors.
|
||||
|
||||
- Improve and expand the test suite. There are a lot of combinations which
|
||||
should be valid but haven't been tested which are likely to result in
|
||||
wierd compiler errors if something wasn't done consistantly.
|
||||
|
||||
|
||||
Old TODO's that should be finished (Martin):
|
||||
|
||||
- Improve signal#, it currently is just barely functional.
|
||||
- Add iterator support and stl like functionality to signal.
|
||||
|
||||
- Add blocking capablity to slot.
|
||||
|
||||
- Deinline/move to .cc where possible to move functions into the
|
||||
library to reduce resulting binary size.
|
||||
114
libs/sigc++2/autogen.sh
Executable file
114
libs/sigc++2/autogen.sh
Executable file
@@ -0,0 +1,114 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (c) 2006, The libsigc++ Development Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
# Be Bourne compatible. (stolen from autoconf)
|
||||
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||
emulate sh
|
||||
NULLCMD=:
|
||||
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
|
||||
# is contrary to our usage. Disable this feature.
|
||||
alias -g '${1+"$@"}'='"$@"'
|
||||
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
|
||||
set -o posix
|
||||
fi
|
||||
|
||||
PROJECT=libsigc++2
|
||||
MIN_AUTOMAKE_VERSION=1.9
|
||||
|
||||
srcdir=`dirname "$0"`
|
||||
test -n "$srcdir" || srcdir=.
|
||||
|
||||
origdir=`pwd`
|
||||
cd "$srcdir"
|
||||
|
||||
LIBTOOLIZE_FLAGS="--automake --copy --force $LIBTOOLIZE_FLAGS"
|
||||
ACLOCAL_FLAGS="-I scripts $ACLOCAL_FLAGS"
|
||||
AUTOMAKE_FLAGS="--add-missing --copy $AUTOMAKE_FLAGS"
|
||||
|
||||
if test "x$*$AUTOGEN_SUBDIR_MODE" = x
|
||||
then
|
||||
echo "I am going to run ./configure with no arguments -- if you wish"
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
fi
|
||||
|
||||
libtoolize=libtoolize
|
||||
autoconf=autoconf
|
||||
autoheader=autoheader
|
||||
aclocal=
|
||||
automake=
|
||||
auto_version=0
|
||||
|
||||
# awk program to transform the output of automake --version
|
||||
# into an integer value suitable for numeric comparison.
|
||||
extract_version='{ printf "%.0f", 1000000 * v[split($1, v, " ")] + 1000 * $2 + $3; exit }'
|
||||
|
||||
for suffix in -1.7 -1.8 -1.9 ""
|
||||
do
|
||||
aclocal_version=`aclocal$suffix --version </dev/null 2>/dev/null | awk -F. "$extract_version"`
|
||||
automake_version=`automake$suffix --version </dev/null 2>/dev/null | awk -F. "$extract_version"`
|
||||
|
||||
if test "$aclocal_version" -eq "$automake_version" 2>/dev/null \
|
||||
&& test "$automake_version" -ge "$auto_version" 2>/dev/null
|
||||
then
|
||||
auto_version=$automake_version
|
||||
aclocal=aclocal$suffix
|
||||
automake=automake$suffix
|
||||
fi
|
||||
done
|
||||
|
||||
min_version=`echo "$MIN_AUTOMAKE_VERSION" | awk -F. "$extract_version"`
|
||||
|
||||
if test "$auto_version" -ge "$min_version" 2>/dev/null
|
||||
then :; else
|
||||
echo "Sorry, at least automake $MIN_AUTOMAKE_VERSION is required to configure $PROJECT."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f config.guess config.sub depcomp install-sh missing mkinstalldirs
|
||||
rm -f config.cache acconfig.h
|
||||
rm -rf autom4te.cache
|
||||
|
||||
#WARNINGS=all
|
||||
#export WARNINGS
|
||||
|
||||
if (set -x && set +x) >/dev/null 2>&1
|
||||
then
|
||||
set_xtrace=set
|
||||
else
|
||||
set_xtrace=:
|
||||
fi
|
||||
|
||||
$set_xtrace -x
|
||||
|
||||
"$libtoolize" $LIBTOOLIZE_FLAGS || exit 1
|
||||
"$aclocal" $ACLOCAL_FLAGS || exit 1
|
||||
#"$autoheader" || exit 1
|
||||
"$automake" $AUTOMAKE_FLAGS || exit 1
|
||||
"$autoconf" || exit 1
|
||||
cd "$origdir" || exit 1
|
||||
|
||||
if test -z "$AUTOGEN_SUBDIR_MODE"
|
||||
then
|
||||
"$srcdir/configure" --enable-maintainer-mode ${1+"$@"} || exit 1
|
||||
$set_xtrace +x
|
||||
echo
|
||||
echo "Now type 'make' to compile $PROJECT."
|
||||
fi
|
||||
|
||||
exit 0
|
||||
126
libs/sigc++2/configure.ac
Normal file
126
libs/sigc++2/configure.ac
Normal file
@@ -0,0 +1,126 @@
|
||||
dnl Configure.in
|
||||
dnl
|
||||
dnl Source for generating compiler independent libraries.
|
||||
dnl
|
||||
|
||||
#We use pushdef here because we can't use shell variables before AC_INIT, but we want to use a variable with AC_INIT:
|
||||
dnl thus make format_package-0.0.1.tar.gz
|
||||
pushdef([FP_MAJOR_VERSION], [2])
|
||||
pushdef([FP_MINOR_VERSION], [2])
|
||||
pushdef([FP_MICRO_VERSION], [2])
|
||||
pushdef([FP_EXTRA_VERSION], [])
|
||||
pushdef([FP_VERSION], FP_MAJOR_VERSION.FP_MINOR_VERSION.FP_MICRO_VERSION[]FP_EXTRA_VERSION)
|
||||
# package name, version, support contact, tarball name.
|
||||
AC_INIT([libsigc++], FP_VERSION, [libsigc-list@gnome.org], [libsigc++])
|
||||
|
||||
dnl AC_CONFIG_SRCDIR is required name a file which is unique to the package
|
||||
dnl just to prevent someone from copying the configure to the wrong package.
|
||||
AC_CONFIG_SRCDIR([sigc++])
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
#########################################################################
|
||||
# Version and initialization
|
||||
#########################################################################
|
||||
[FP_MAJOR_VERSION]=FP_MAJOR_VERSION
|
||||
[FP_MINOR_VERSION]=FP_MINOR_VERSION
|
||||
[FP_MICRO_VERSION]=FP_MICRO_VERSION
|
||||
[FP_EXTRA_VERSION]=FP_EXTRA_VERSION
|
||||
[FP_VERSION]=FP_VERSION
|
||||
popdef([FP_MAJOR_VERSION])
|
||||
popdef([FP_MINOR_VERSION])
|
||||
popdef([FP_MICRO_VERSION])
|
||||
popdef([FP_EXTRA_VERSION])
|
||||
popdef([FP_VERSION])
|
||||
FP_RELEASE=$FP_MAJOR_VERSION.$FP_MINOR_VERSION
|
||||
AC_DEFINE_UNQUOTED(FP_MAJOR_VERSION, $FP_MAJOR_VERSION, [Major version of libsigc++])
|
||||
AC_DEFINE_UNQUOTED(FP_MINOR_VERSION, $FP_MINOR_VERSION, [Minor version of libsigc++])
|
||||
AC_DEFINE_UNQUOTED(FP_MICRO_VERSION, $FP_MICRO_VERSION, [Micro version of libsigc++])
|
||||
AC_SUBST(FP_VERSION)
|
||||
AC_SUBST(FP_RELEASE)
|
||||
AC_SUBST(FP_MAJOR_VERSION)
|
||||
AC_SUBST(FP_MINOR_VERSION)
|
||||
AC_SUBST(FP_MICRO_VERSION)
|
||||
|
||||
dnl For automake.
|
||||
VERSION=$FP_VERSION
|
||||
PACKAGE=libsigc++
|
||||
|
||||
# Initialize automake stuff
|
||||
# tar-ustar asks it to use a sensible tar format that can handle long filenames.
|
||||
AM_INIT_AUTOMAKE([1.9 tar-ustar])
|
||||
|
||||
dnl Specify a configuration file:
|
||||
AC_CONFIG_HEADER(sigc++config.h)
|
||||
|
||||
dnl Macros to support windows platforms
|
||||
AC_CYGWIN
|
||||
#AC_MINGW32
|
||||
AC_EXEEXT
|
||||
|
||||
dnl this package needs m4
|
||||
AC_CHECK_PROGS(M4, gm4 m4, m4)
|
||||
|
||||
dnl perl is needed for building the reference documentation
|
||||
AC_PATH_PROGS([PERL_PATH], [perl perl5], [perl])
|
||||
AC_SUBST([PERL_PATH])
|
||||
|
||||
dnl disable autoheader
|
||||
AUTOHEADER=':'
|
||||
|
||||
dnl Maintainer support (autodependencies and packaging)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl Using C compiler
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
|
||||
dnl Used for enabling the "-no-undefined" flag while generating DLLs
|
||||
dnl Borrowed from the official gtk+-2 configure.in
|
||||
AC_MSG_CHECKING([for some Win32 platform])
|
||||
case "$host" in
|
||||
*-*-mingw*|*-*-cygwin*)
|
||||
platform_win32=yes
|
||||
;;
|
||||
*)
|
||||
platform_win32=no
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$platform_win32])
|
||||
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
|
||||
|
||||
dnl Using libtool
|
||||
AC_CONFIG_MACRO_DIR(scripts)
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
dnl: Use with libtool 1.5a instead of AM_PROG_LIBTOOL: LT_INIT
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
dnl Using C++ compiler
|
||||
AC_PROG_CXX
|
||||
AC_LANG_CPLUSPLUS
|
||||
|
||||
SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD()
|
||||
SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD()
|
||||
SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION()
|
||||
SIGC_CXX_HAS_NAMESPACE_STD()
|
||||
SIGC_CXX_HAS_SUN_REVERSE_ITERATOR()
|
||||
|
||||
if test "X$config_error" = "Xyes" ; then
|
||||
AC_ERROR(
|
||||
[One or more of the required compiler features is missing.
|
||||
If you believe this is in error, please consult the config.log file
|
||||
for further details.
|
||||
])
|
||||
fi
|
||||
|
||||
|
||||
# Generate output
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
sigc++-2.0.pc
|
||||
|
||||
sigc++/Makefile
|
||||
scripts/Makefile
|
||||
libsigc++-2.0.spec
|
||||
|
||||
])
|
||||
91
libs/sigc++2/libsigc++-2.0.spec.in
Normal file
91
libs/sigc++2/libsigc++-2.0.spec.in
Normal file
@@ -0,0 +1,91 @@
|
||||
Summary: The Typesafe Signal Framework for C++
|
||||
Name: @PACKAGE@
|
||||
Version: @VERSION@
|
||||
Release: 1
|
||||
License: LGPL
|
||||
Group: System Environment/Libraries
|
||||
Packager: Eric Bourque <ericb@computer.org>
|
||||
URL: http://libsigc.sourceforge.net/
|
||||
Source0: http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.0/%{name}-%{version}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
|
||||
%description
|
||||
|
||||
This library implements a full callback system for use in widget
|
||||
libraries, abstract interfaces, and general programming. Originally
|
||||
part of the Gtk-- widget set, %name is now a seperate library to
|
||||
provide for more general use. It is the most complete library of its
|
||||
kind with the ablity to connect an abstract callback to a class
|
||||
method, function, or function object. It contains adaptor classes for
|
||||
connection of dissimilar callbacks and has an ease of use unmatched by
|
||||
other C++ callback libraries.
|
||||
|
||||
Package GTK-- (gtkmm), which is a C++ binding to the GTK+ library,
|
||||
starting with version 1.1.2, uses %name.
|
||||
|
||||
Due to C++ ABI changes, this will only work with the gcc version which
|
||||
the distribution was supplied with. If you got your rpm from any
|
||||
previous version, please rebuild from spec!
|
||||
|
||||
%package devel
|
||||
Summary: Development tools for the Typesafe Signal Framework for C++
|
||||
Group: Development/Libraries
|
||||
Requires: %name = %version
|
||||
|
||||
%description devel
|
||||
The %name-devel package contains the static libraries and header files
|
||||
needed for development with %name.
|
||||
|
||||
%package examples
|
||||
Summary: Examples and tests for the Typesafe Signal Framework for C++
|
||||
Group: Development/Libraries
|
||||
Requires: %name-devel = %version
|
||||
|
||||
%description examples
|
||||
The %name-devel package contains source code of
|
||||
example and test programs for %name.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
mkdir -p -m 755 $RPM_BUILD_ROOT/%{_libdir}/sigc++-2.0
|
||||
cp -a examples tests $RPM_BUILD_ROOT/%{_libdir}/sigc++-2.0
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/libsigc*.so*
|
||||
%doc /usr/share/doc/libsigc-2.0
|
||||
|
||||
%files devel
|
||||
/usr/include/sigc++-2.0
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_libdir}/libsigc*.a
|
||||
%{_libdir}/libsigc*.la
|
||||
%dir %{_libdir}/sigc++-2.0
|
||||
%dir %{_libdir}/sigc++-2.0/include
|
||||
%{_libdir}/sigc++-2.0/include/sigc++config.h
|
||||
|
||||
%files examples
|
||||
%{_libdir}/sigc++-2.0/examples
|
||||
%{_libdir}/sigc++-2.0/tests
|
||||
|
||||
%changelog
|
||||
* Tue Jun 29 2004 Eric Bourque <ericb@computer.org> - 2.0-1
|
||||
- Initial build.
|
||||
|
||||
367
libs/sigc++2/missing
Executable file
367
libs/sigc++2/missing
Executable file
@@ -0,0 +1,367 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
1
libs/sigc++2/scripts/Makefile.am
Normal file
1
libs/sigc++2/scripts/Makefile.am
Normal file
@@ -0,0 +1 @@
|
||||
EXTRA_DIST = cxx.m4 cxx_std.m4
|
||||
122
libs/sigc++2/scripts/cxx.m4
Normal file
122
libs/sigc++2/scripts/cxx.m4
Normal file
@@ -0,0 +1,122 @@
|
||||
dnl
|
||||
dnl SIGC_CXX_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD()
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN([SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[
|
||||
AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() template methods.])
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
#include <iostream>
|
||||
|
||||
class Thing
|
||||
{
|
||||
public:
|
||||
Thing()
|
||||
{}
|
||||
|
||||
template <class T>
|
||||
void operator()(T a, T b)
|
||||
{
|
||||
T c = a + b;
|
||||
std::cout << c << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
template<class T2>
|
||||
class OtherThing
|
||||
{
|
||||
public:
|
||||
void do_something()
|
||||
{
|
||||
Thing thing_;
|
||||
thing_.template operator()<T2>(1, 2);
|
||||
//This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5:
|
||||
}
|
||||
};
|
||||
],
|
||||
[
|
||||
OtherThing<int> thing;
|
||||
thing.do_something();
|
||||
],
|
||||
[
|
||||
sigcm_cxx_gcc_template_specialization_operator_overload=yes
|
||||
AC_DEFINE([SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use of a particular specialization when calling operator() template methods.])
|
||||
AC_MSG_RESULT([$sigcm_cxx_gcc_template_specialization_operator_overload])
|
||||
],[
|
||||
sigcm_cxx_gcc_template_specialization_operator_overload=no
|
||||
AC_MSG_RESULT([$sigcm_cxx_gcc_template_specialization_operator_overload])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[
|
||||
AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() template methods omitting the template keyword.])
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
#include <iostream>
|
||||
|
||||
class Thing
|
||||
{
|
||||
public:
|
||||
Thing()
|
||||
{}
|
||||
|
||||
template <class T>
|
||||
void operator()(T a, T b)
|
||||
{
|
||||
T c = a + b;
|
||||
std::cout << c << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
template<class T2>
|
||||
class OtherThing
|
||||
{
|
||||
public:
|
||||
void do_something()
|
||||
{
|
||||
Thing thing_;
|
||||
thing_.operator()<T2>(1, 2);
|
||||
//This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5:
|
||||
}
|
||||
};
|
||||
],
|
||||
[
|
||||
OtherThing<int> thing;
|
||||
thing.do_something();
|
||||
],
|
||||
[
|
||||
sigcm_cxx_msvc_template_specialization_operator_overload=yes
|
||||
AC_DEFINE([SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use of a particular specialization when calling operator() template methods omitting the template keyword.])
|
||||
AC_MSG_RESULT([$sigcm_cxx_msvc_template_specialization_operator_overload])
|
||||
],[
|
||||
sigcm_cxx_msvc_template_specialization_operator_overload=no
|
||||
AC_MSG_RESULT([$sigcm_cxx_msvc_template_specialization_operator_overload])
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION], [
|
||||
AC_MSG_CHECKING([if C++ compiler allows usage of member function in initialization of static member field.])
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
struct test
|
||||
{
|
||||
static char test_function();
|
||||
|
||||
// Doesn't work with e.g. GCC 3.2. However, if test_function()
|
||||
// is wrapped in a nested structure, it works just fine.
|
||||
static const bool test_value
|
||||
= (sizeof(test_function()) == sizeof(char));
|
||||
};
|
||||
],
|
||||
[],
|
||||
[
|
||||
sigcm_cxx_self_reference_in_member_initialization=yes
|
||||
AC_DEFINE([SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION],[1],
|
||||
[does c++ compiler allows usage of member function in initialization of static member field.])
|
||||
AC_MSG_RESULT([$sigcm_cxx_self_reference_in_member_initialization])
|
||||
],[
|
||||
sigcm_cxx_self_reference_in_member_initialization=no
|
||||
AC_MSG_RESULT([$sigcm_cxx_self_reference_in_member_initialization])
|
||||
])
|
||||
])
|
||||
77
libs/sigc++2/scripts/cxx_std.m4
Normal file
77
libs/sigc++2/scripts/cxx_std.m4
Normal file
@@ -0,0 +1,77 @@
|
||||
cv_cxx_has_namespace_std
|
||||
## SIGC_CXX_HAS_NAMESPACE_STD()
|
||||
##
|
||||
## Test whether libstdc++ declares namespace std. For safety,
|
||||
## also check whether several randomly selected STL symbols
|
||||
## are available in namespace std.
|
||||
##
|
||||
## On success, #define SIGC_HAVE_NAMESPACE_STD to 1.
|
||||
##
|
||||
AC_DEFUN([SIGC_CXX_HAS_NAMESPACE_STD],
|
||||
[
|
||||
AC_CACHE_CHECK(
|
||||
[whether C++ library symbols are declared in namespace std],
|
||||
[sigc_cv_cxx_has_namespace_std],
|
||||
[
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
],[
|
||||
using std::min;
|
||||
using std::find;
|
||||
using std::copy;
|
||||
using std::bidirectional_iterator_tag;
|
||||
using std::string;
|
||||
using std::istream;
|
||||
using std::cout;
|
||||
],
|
||||
[sigc_cv_cxx_has_namespace_std="yes"],
|
||||
[sigc_cv_cxx_has_namespace_std="no"]
|
||||
)
|
||||
])
|
||||
|
||||
if test "x${sigc_cv_cxx_has_namespace_std}" = "xyes"; then
|
||||
{
|
||||
AC_DEFINE([SIGC_HAVE_NAMESPACE_STD],[1], [Defined when the libstdc++ declares the std-namespace])
|
||||
}
|
||||
fi
|
||||
])
|
||||
|
||||
## SIGC_CXX_HAS_SUN_REVERSE_ITERATOR()
|
||||
##
|
||||
## Check for Sun libCstd style std::reverse_iterator, which demands more than just one template parameter.
|
||||
## and #define SIGC_HAVE_SUN_REVERSE_ITERATOR if found.
|
||||
##
|
||||
AC_DEFUN([SIGC_CXX_HAS_SUN_REVERSE_ITERATOR],
|
||||
[
|
||||
AC_REQUIRE([SIGC_CXX_HAS_NAMESPACE_STD])
|
||||
|
||||
AC_CACHE_CHECK(
|
||||
[for non-standard Sun libCstd reverse_iterator],
|
||||
[sigc_cv_cxx_has_sun_reverse_iterator],
|
||||
[
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
#include <iterator>
|
||||
#ifdef SIGC_HAVE_NAMESPACE_STD
|
||||
using namespace std;
|
||||
#endif
|
||||
],[
|
||||
typedef reverse_iterator<char*,random_access_iterator_tag,char,char&,char*,int> ReverseIter;
|
||||
],
|
||||
[sigc_cv_cxx_has_sun_reverse_iterator="yes"],
|
||||
[sigc_cv_cxx_has_sun_reverse_iterator="no"]
|
||||
)
|
||||
])
|
||||
|
||||
if test "x${sigc_cv_cxx_has_sun_reverse_iterator}" = "xyes"; then
|
||||
{
|
||||
AC_DEFINE([SIGC_HAVE_SUN_REVERSE_ITERATOR],[1])
|
||||
}
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
10
libs/sigc++2/sigc++-2.0.pc.in
Normal file
10
libs/sigc++2/sigc++-2.0.pc.in
Normal file
@@ -0,0 +1,10 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libsigc++ 2
|
||||
Description: Typesafe signal and callback system for C++
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lsigc-2.0
|
||||
Cflags: -I${includedir}/sigc++-2.0 -I${libdir}/sigc++-2.0/include
|
||||
105
libs/sigc++2/sigc++/Makefile.am
Normal file
105
libs/sigc++2/sigc++/Makefile.am
Normal file
@@ -0,0 +1,105 @@
|
||||
# Base (./)
|
||||
base_m4 = template.macros.m4 signal.h.m4 slot.h.m4 method_slot.h.m4 \
|
||||
object_slot.h.m4 class_slot.h.m4 hide.h.m4 retype.h.m4 \
|
||||
limit_reference.h.m4
|
||||
base_built_cc =
|
||||
base_built_h = signal.h slot.h method_slot.h \
|
||||
object_slot.h class_slot.h hide.h retype.h limit_reference.h
|
||||
|
||||
signal.cc : signal.h signal_base.h functors/slot.h functors/slot_base.h functors/mem_fun.h functors/functor_trait.h
|
||||
|
||||
# Functors (functors/)
|
||||
functors_m4 = functor_trait.h.m4 slot.h.m4 ptr_fun.h.m4 mem_fun.h.m4
|
||||
functors_built_cc =
|
||||
functors_built_h = functor_trait.h slot.h ptr_fun.h mem_fun.h
|
||||
|
||||
functors/slot.cc : functors/slot.h functors/slot_base.h functors/functor_trait.h
|
||||
|
||||
# Adaptors (adaptors/)
|
||||
adaptors_m4 = deduce_result_type.h.m4 adaptor_trait.h.m4 bind.h.m4 bind_return.h.m4 \
|
||||
retype_return.h.m4 hide.h.m4 retype.h.m4 compose.h.m4 exception_catch.h.m4
|
||||
adaptors_built_cc =
|
||||
adaptors_built_h = deduce_result_type.h adaptor_trait.h bind.h bind_return.h \
|
||||
retype_return.h hide.h retype.h compose.h exception_catch.h
|
||||
|
||||
# Lambda (adaptors/lambda)
|
||||
lambda_m4 = base.h.m4 select.h.m4 operator.h.m4 group.h.m4 lambda.cc.m4
|
||||
lambda_built_cc = lambda.cc
|
||||
lambda_built_h = base.h select.h operator.h group.h
|
||||
|
||||
adaptors/lambda/lambda.cc : adaptors/lambda/select.h adaptors/lambda/base.h \
|
||||
adaptors/adaptor_trait.h adaptors/deduce_result_type.h \
|
||||
functors/ptr_fun.h functors/mem_fun.h functors/functor_trait.h
|
||||
|
||||
# Subdirectories needed also in the build dir
|
||||
build_subdirs = functors adaptors adaptors/lambda
|
||||
|
||||
# Combine all the above parts with right directories prefixed
|
||||
sigc_m4 = $(base_m4:%=macros/%) \
|
||||
$(functors_m4:%=functors/macros/%) \
|
||||
$(adaptors_m4:%=adaptors/macros/%) \
|
||||
$(lambda_m4:%=adaptors/lambda/macros/%)
|
||||
sigc_built_cc = $(base_built_cc) \
|
||||
$(functors_built_cc:%=functors/%) \
|
||||
$(adaptors_built_cc:%=adaptors/%) \
|
||||
$(lambda_built_cc:%=adaptors/lambda/%)
|
||||
sigc_built_h = $(base_built_h) \
|
||||
$(functors_built_h:%=functors/%) \
|
||||
$(adaptors_built_h:%=adaptors/%) \
|
||||
$(lambda_built_h:%=adaptors/lambda/%)
|
||||
|
||||
EXTRA_DIST = $(sigc_m4) $(sigc_built_h) $(sigc_built_cc)
|
||||
|
||||
# install the headers
|
||||
library_includedir = $(includedir)/sigc++-2.0/sigc++
|
||||
nobase_library_include_HEADERS = $(sigc_m4) $(sigc_built_h) \
|
||||
sigc++.h connection.h trackable.h reference_wrapper.h type_traits.h visit_each.h \
|
||||
object.h retype_return.h bind.h bind_return.h signal_base.h \
|
||||
functors/functors.h \
|
||||
functors/slot_base.h \
|
||||
adaptors/adaptors.h \
|
||||
adaptors/bound_argument.h \
|
||||
adaptors/lambda/lambda.h
|
||||
|
||||
# Support for DLL on cygwin/mingw using libtool > 1.4
|
||||
if PLATFORM_WIN32
|
||||
win32_dlls_ldflags = -no-undefined -Wl,--export-all-symbols
|
||||
else
|
||||
win32_dlls_ldflags =
|
||||
endif
|
||||
|
||||
# build the library
|
||||
lib_LTLIBRARIES = libsigc-2.0.la
|
||||
libsigc_2_0_la_SOURCES = signal.cc signal_base.cc trackable.cc connection.cc \
|
||||
functors/slot.cc functors/slot_base.cc \
|
||||
adaptors/lambda/lambda.cc
|
||||
libsigc_2_0_la_LDFLAGS = $(win32_dlls_ldflags)
|
||||
BUILT_SOURCES = $(sigc_built_h) $(sigc_built_cc)
|
||||
|
||||
CLEANFILES = build-subdirs-stamp
|
||||
|
||||
# Remove the generated sources during maintainer-clean:
|
||||
MAINTAINERCLEANFILES = $(built_sources)
|
||||
|
||||
M4_DIR = $(top_srcdir)/sigc++/macros
|
||||
|
||||
# Rules to generate .h and .cc from .h.m4 and .cc.m4:
|
||||
%.h: macros/%.h.m4 $(M4_DIR)/template.macros.m4
|
||||
$(M4) $(M4_INCLUDES) $(DEFINES) -I $(M4_DIR) -I macros $< > $@
|
||||
|
||||
%.cc: macros/%.cc.m4 $(M4_DIR)/template.macros.m4
|
||||
$(M4) $(M4_INCLUDES) $(DEFINES) -I $(M4_DIR) -I macros $< > $@
|
||||
|
||||
# This would be a necessary target for VPATH builds from a clean CVS checkout,
|
||||
# but I'm not sure where to invoke it... [rotty]
|
||||
build-subdirs-stamp:
|
||||
for dir in $(build_subdirs); do \
|
||||
test -d $$dir || mkdir $$dir; \
|
||||
done
|
||||
touch build-subdirs-stamp
|
||||
|
||||
# Remove current directory from DEFAULT_INCLUDES because signal.h has
|
||||
# the same name as a standard header:
|
||||
DEFAULT_INCLUDES =
|
||||
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
|
||||
|
||||
641
libs/sigc++2/sigc++/Makefile.in
Normal file
641
libs/sigc++2/sigc++/Makefile.in
Normal file
@@ -0,0 +1,641 @@
|
||||
# Makefile.in generated by automake 1.10 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = sigc++
|
||||
DIST_COMMON = $(nobase_library_include_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/scripts/cxx.m4 \
|
||||
$(top_srcdir)/scripts/cxx_std.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/sigc++config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libdir)" \
|
||||
"$(DESTDIR)$(library_includedir)"
|
||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libsigc_2_0_la_LIBADD =
|
||||
am_libsigc_2_0_la_OBJECTS = signal.lo signal_base.lo trackable.lo \
|
||||
connection.lo slot.lo slot_base.lo lambda.lo
|
||||
libsigc_2_0_la_OBJECTS = $(am_libsigc_2_0_la_OBJECTS)
|
||||
libsigc_2_0_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
|
||||
$(CXXFLAGS) $(libsigc_2_0_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libsigc_2_0_la_SOURCES)
|
||||
DIST_SOURCES = $(libsigc_2_0_la_SOURCES)
|
||||
nobase_library_includeHEADERS_INSTALL = $(install_sh_DATA)
|
||||
HEADERS = $(nobase_library_include_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FP_MAJOR_VERSION = @FP_MAJOR_VERSION@
|
||||
FP_MICRO_VERSION = @FP_MICRO_VERSION@
|
||||
FP_MINOR_VERSION = @FP_MINOR_VERSION@
|
||||
FP_RELEASE = @FP_RELEASE@
|
||||
FP_VERSION = @FP_VERSION@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
M4 = @M4@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL_PATH = @PERL_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
# Base (./)
|
||||
base_m4 = template.macros.m4 signal.h.m4 slot.h.m4 method_slot.h.m4 \
|
||||
object_slot.h.m4 class_slot.h.m4 hide.h.m4 retype.h.m4 \
|
||||
limit_reference.h.m4
|
||||
|
||||
base_built_cc =
|
||||
base_built_h = signal.h slot.h method_slot.h \
|
||||
object_slot.h class_slot.h hide.h retype.h limit_reference.h
|
||||
|
||||
|
||||
# Functors (functors/)
|
||||
functors_m4 = functor_trait.h.m4 slot.h.m4 ptr_fun.h.m4 mem_fun.h.m4
|
||||
functors_built_cc =
|
||||
functors_built_h = functor_trait.h slot.h ptr_fun.h mem_fun.h
|
||||
|
||||
# Adaptors (adaptors/)
|
||||
adaptors_m4 = deduce_result_type.h.m4 adaptor_trait.h.m4 bind.h.m4 bind_return.h.m4 \
|
||||
retype_return.h.m4 hide.h.m4 retype.h.m4 compose.h.m4 exception_catch.h.m4
|
||||
|
||||
adaptors_built_cc =
|
||||
adaptors_built_h = deduce_result_type.h adaptor_trait.h bind.h bind_return.h \
|
||||
retype_return.h hide.h retype.h compose.h exception_catch.h
|
||||
|
||||
|
||||
# Lambda (adaptors/lambda)
|
||||
lambda_m4 = base.h.m4 select.h.m4 operator.h.m4 group.h.m4 lambda.cc.m4
|
||||
lambda_built_cc = lambda.cc
|
||||
lambda_built_h = base.h select.h operator.h group.h
|
||||
|
||||
# Subdirectories needed also in the build dir
|
||||
build_subdirs = functors adaptors adaptors/lambda
|
||||
|
||||
# Combine all the above parts with right directories prefixed
|
||||
sigc_m4 = $(base_m4:%=macros/%) \
|
||||
$(functors_m4:%=functors/macros/%) \
|
||||
$(adaptors_m4:%=adaptors/macros/%) \
|
||||
$(lambda_m4:%=adaptors/lambda/macros/%)
|
||||
|
||||
sigc_built_cc = $(base_built_cc) \
|
||||
$(functors_built_cc:%=functors/%) \
|
||||
$(adaptors_built_cc:%=adaptors/%) \
|
||||
$(lambda_built_cc:%=adaptors/lambda/%)
|
||||
|
||||
sigc_built_h = $(base_built_h) \
|
||||
$(functors_built_h:%=functors/%) \
|
||||
$(adaptors_built_h:%=adaptors/%) \
|
||||
$(lambda_built_h:%=adaptors/lambda/%)
|
||||
|
||||
EXTRA_DIST = $(sigc_m4) $(sigc_built_h) $(sigc_built_cc)
|
||||
|
||||
# install the headers
|
||||
library_includedir = $(includedir)/sigc++-2.0/sigc++
|
||||
nobase_library_include_HEADERS = $(sigc_m4) $(sigc_built_h) \
|
||||
sigc++.h connection.h trackable.h reference_wrapper.h type_traits.h visit_each.h \
|
||||
object.h retype_return.h bind.h bind_return.h signal_base.h \
|
||||
functors/functors.h \
|
||||
functors/slot_base.h \
|
||||
adaptors/adaptors.h \
|
||||
adaptors/bound_argument.h \
|
||||
adaptors/lambda/lambda.h
|
||||
|
||||
@PLATFORM_WIN32_FALSE@win32_dlls_ldflags =
|
||||
|
||||
# Support for DLL on cygwin/mingw using libtool > 1.4
|
||||
@PLATFORM_WIN32_TRUE@win32_dlls_ldflags = -no-undefined -Wl,--export-all-symbols
|
||||
|
||||
# build the library
|
||||
lib_LTLIBRARIES = libsigc-2.0.la
|
||||
libsigc_2_0_la_SOURCES = signal.cc signal_base.cc trackable.cc connection.cc \
|
||||
functors/slot.cc functors/slot_base.cc \
|
||||
adaptors/lambda/lambda.cc
|
||||
|
||||
libsigc_2_0_la_LDFLAGS = $(win32_dlls_ldflags)
|
||||
BUILT_SOURCES = $(sigc_built_h) $(sigc_built_cc)
|
||||
CLEANFILES = build-subdirs-stamp
|
||||
|
||||
# Remove the generated sources during maintainer-clean:
|
||||
MAINTAINERCLEANFILES = $(built_sources)
|
||||
M4_DIR = $(top_srcdir)/sigc++/macros
|
||||
|
||||
# Remove current directory from DEFAULT_INCLUDES because signal.h has
|
||||
# the same name as a standard header:
|
||||
DEFAULT_INCLUDES =
|
||||
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
|
||||
all: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cc .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sigc++/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu sigc++/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libsigc-2.0.la: $(libsigc_2_0_la_OBJECTS) $(libsigc_2_0_la_DEPENDENCIES)
|
||||
$(libsigc_2_0_la_LINK) -rpath $(libdir) $(libsigc_2_0_la_OBJECTS) $(libsigc_2_0_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lambda.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_base.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slot.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slot_base.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trackable.Plo@am__quote@
|
||||
|
||||
.cc.o:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cc.obj:
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cc.lo:
|
||||
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
slot.lo: functors/slot.cc
|
||||
@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT slot.lo -MD -MP -MF $(DEPDIR)/slot.Tpo -c -o slot.lo `test -f 'functors/slot.cc' || echo '$(srcdir)/'`functors/slot.cc
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/slot.Tpo $(DEPDIR)/slot.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='functors/slot.cc' object='slot.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o slot.lo `test -f 'functors/slot.cc' || echo '$(srcdir)/'`functors/slot.cc
|
||||
|
||||
slot_base.lo: functors/slot_base.cc
|
||||
@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT slot_base.lo -MD -MP -MF $(DEPDIR)/slot_base.Tpo -c -o slot_base.lo `test -f 'functors/slot_base.cc' || echo '$(srcdir)/'`functors/slot_base.cc
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/slot_base.Tpo $(DEPDIR)/slot_base.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='functors/slot_base.cc' object='slot_base.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o slot_base.lo `test -f 'functors/slot_base.cc' || echo '$(srcdir)/'`functors/slot_base.cc
|
||||
|
||||
lambda.lo: adaptors/lambda/lambda.cc
|
||||
@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lambda.lo -MD -MP -MF $(DEPDIR)/lambda.Tpo -c -o lambda.lo `test -f 'adaptors/lambda/lambda.cc' || echo '$(srcdir)/'`adaptors/lambda/lambda.cc
|
||||
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/lambda.Tpo $(DEPDIR)/lambda.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='adaptors/lambda/lambda.cc' object='lambda.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lambda.lo `test -f 'adaptors/lambda/lambda.cc' || echo '$(srcdir)/'`adaptors/lambda/lambda.cc
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-nobase_library_includeHEADERS: $(nobase_library_include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(library_includedir)" || $(MKDIR_P) "$(DESTDIR)$(library_includedir)"
|
||||
@$(am__vpath_adj_setup) \
|
||||
list='$(nobase_library_include_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
$(am__vpath_adj) \
|
||||
echo " $(nobase_library_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(library_includedir)/$$f'"; \
|
||||
$(nobase_library_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(library_includedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-nobase_library_includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@$(am__vpath_adj_setup) \
|
||||
list='$(nobase_library_include_HEADERS)'; for p in $$list; do \
|
||||
$(am__vpath_adj) \
|
||||
echo " rm -f '$(DESTDIR)$(library_includedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(library_includedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(library_includedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-nobase_library_includeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-libLTLIBRARIES \
|
||||
uninstall-nobase_library_includeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man \
|
||||
install-nobase_library_includeHEADERS install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-libLTLIBRARIES \
|
||||
uninstall-nobase_library_includeHEADERS
|
||||
|
||||
|
||||
signal.cc : signal.h signal_base.h functors/slot.h functors/slot_base.h functors/mem_fun.h functors/functor_trait.h
|
||||
|
||||
functors/slot.cc : functors/slot.h functors/slot_base.h functors/functor_trait.h
|
||||
|
||||
adaptors/lambda/lambda.cc : adaptors/lambda/select.h adaptors/lambda/base.h \
|
||||
adaptors/adaptor_trait.h adaptors/deduce_result_type.h \
|
||||
functors/ptr_fun.h functors/mem_fun.h functors/functor_trait.h
|
||||
|
||||
# Rules to generate .h and .cc from .h.m4 and .cc.m4:
|
||||
%.h: macros/%.h.m4 $(M4_DIR)/template.macros.m4
|
||||
$(M4) $(M4_INCLUDES) $(DEFINES) -I $(M4_DIR) -I macros $< > $@
|
||||
|
||||
%.cc: macros/%.cc.m4 $(M4_DIR)/template.macros.m4
|
||||
$(M4) $(M4_INCLUDES) $(DEFINES) -I $(M4_DIR) -I macros $< > $@
|
||||
|
||||
# This would be a necessary target for VPATH builds from a clean CVS checkout,
|
||||
# but I'm not sure where to invoke it... [rotty]
|
||||
build-subdirs-stamp:
|
||||
for dir in $(build_subdirs); do \
|
||||
test -d $$dir || mkdir $$dir; \
|
||||
done
|
||||
touch build-subdirs-stamp
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
365
libs/sigc++2/sigc++/adaptors/adaptor_trait.h
Normal file
365
libs/sigc++2/sigc++/adaptors/adaptor_trait.h
Normal file
@@ -0,0 +1,365 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#ifndef _SIGC_ADAPTORS_MACROS_ADAPTOR_TRAITHM4_
|
||||
#define _SIGC_ADAPTORS_MACROS_ADAPTOR_TRAITHM4_
|
||||
#include <sigc++config.h> //To get SIGC_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD
|
||||
#include <sigc++/visit_each.h>
|
||||
#include <sigc++/functors/functor_trait.h>
|
||||
#include <sigc++/functors/ptr_fun.h>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
#include <sigc++/adaptors/deduce_result_type.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
// Call either operator()<>() or sun_forte_workaround<>(),
|
||||
// depending on the compiler:
|
||||
#ifdef SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#define SIGC_WORKAROUND_OPERATOR_PARENTHESES template operator()
|
||||
#define SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#else
|
||||
#ifdef SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#define SIGC_WORKAROUND_OPERATOR_PARENTHESES operator()
|
||||
#define SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#else
|
||||
#define SIGC_WORKAROUND_OPERATOR_PARENTHESES sun_forte_workaround
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
template <class T_functor> struct adapts;
|
||||
|
||||
/** @defgroup adaptors Adaptors
|
||||
* Adaptors are functors that alter the signature of a functor's
|
||||
* operator()().
|
||||
*
|
||||
* The adaptor types libsigc++ provides
|
||||
* are created with bind(), bind_return(), hide(), hide_return(),
|
||||
* retype_return(), retype(), compose(), exception_catch() and group().
|
||||
*
|
||||
* You can easily derive your own adaptor type from sigc::adapts.
|
||||
*/
|
||||
|
||||
/** Converts an arbitrary functor into an adaptor type.
|
||||
* All adaptor tyes in libsigc++ are unnumbered and have
|
||||
* a <tt>template operator()</tt> member of every argument count
|
||||
* they support. These functions in turn invoke a stored adaptor's
|
||||
* <tt>template operator()</tt> processing the arguments and return
|
||||
* value in a characteristic manner. Explicit function template
|
||||
* instantiation is used to pass type hints thus saving copy costs.
|
||||
*
|
||||
* adaptor_functor is a glue between adaptors and arbitrary functors
|
||||
* that just passes on the arguments. You won't use this type directly.
|
||||
*
|
||||
* The template argument @e T_functor determines the type of stored
|
||||
* functor.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct adaptor_functor : public adaptor_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename sigc::deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type type; };
|
||||
typedef typename functor_trait<T_functor>::result_type result_type;
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
result_type
|
||||
operator()() const;
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
result_type sun_forte_workaround() const
|
||||
{ return operator(); }
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @param _A_arg1 Argument to be passed on to the functor.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator()(T_arg1 _A_arg1) const
|
||||
{ return functor_(_A_arg1); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
sun_forte_workaround(T_arg1 _A_arg1) const
|
||||
{ //Just calling operator() tries to copy the argument:
|
||||
return functor_(_A_arg1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @param _A_arg1 Argument to be passed on to the functor.
|
||||
* @param _A_arg2 Argument to be passed on to the functor.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator()(T_arg1 _A_arg1,T_arg2 _A_arg2) const
|
||||
{ return functor_(_A_arg1,_A_arg2); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
sun_forte_workaround(T_arg1 _A_arg1,T_arg2 _A_arg2) const
|
||||
{ //Just calling operator() tries to copy the argument:
|
||||
return functor_(_A_arg1,_A_arg2);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @param _A_arg1 Argument to be passed on to the functor.
|
||||
* @param _A_arg2 Argument to be passed on to the functor.
|
||||
* @param _A_arg3 Argument to be passed on to the functor.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator()(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3) const
|
||||
{ return functor_(_A_arg1,_A_arg2,_A_arg3); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
sun_forte_workaround(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3) const
|
||||
{ //Just calling operator() tries to copy the argument:
|
||||
return functor_(_A_arg1,_A_arg2,_A_arg3);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @param _A_arg1 Argument to be passed on to the functor.
|
||||
* @param _A_arg2 Argument to be passed on to the functor.
|
||||
* @param _A_arg3 Argument to be passed on to the functor.
|
||||
* @param _A_arg4 Argument to be passed on to the functor.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator()(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3,T_arg4 _A_arg4) const
|
||||
{ return functor_(_A_arg1,_A_arg2,_A_arg3,_A_arg4); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
sun_forte_workaround(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3,T_arg4 _A_arg4) const
|
||||
{ //Just calling operator() tries to copy the argument:
|
||||
return functor_(_A_arg1,_A_arg2,_A_arg3,_A_arg4);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @param _A_arg1 Argument to be passed on to the functor.
|
||||
* @param _A_arg2 Argument to be passed on to the functor.
|
||||
* @param _A_arg3 Argument to be passed on to the functor.
|
||||
* @param _A_arg4 Argument to be passed on to the functor.
|
||||
* @param _A_arg5 Argument to be passed on to the functor.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator()(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3,T_arg4 _A_arg4,T_arg5 _A_arg5) const
|
||||
{ return functor_(_A_arg1,_A_arg2,_A_arg3,_A_arg4,_A_arg5); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
sun_forte_workaround(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3,T_arg4 _A_arg4,T_arg5 _A_arg5) const
|
||||
{ //Just calling operator() tries to copy the argument:
|
||||
return functor_(_A_arg1,_A_arg2,_A_arg3,_A_arg4,_A_arg5);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @param _A_arg1 Argument to be passed on to the functor.
|
||||
* @param _A_arg2 Argument to be passed on to the functor.
|
||||
* @param _A_arg3 Argument to be passed on to the functor.
|
||||
* @param _A_arg4 Argument to be passed on to the functor.
|
||||
* @param _A_arg5 Argument to be passed on to the functor.
|
||||
* @param _A_arg6 Argument to be passed on to the functor.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator()(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3,T_arg4 _A_arg4,T_arg5 _A_arg5,T_arg6 _A_arg6) const
|
||||
{ return functor_(_A_arg1,_A_arg2,_A_arg3,_A_arg4,_A_arg5,_A_arg6); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
sun_forte_workaround(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3,T_arg4 _A_arg4,T_arg5 _A_arg5,T_arg6 _A_arg6) const
|
||||
{ //Just calling operator() tries to copy the argument:
|
||||
return functor_(_A_arg1,_A_arg2,_A_arg3,_A_arg4,_A_arg5,_A_arg6);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @param _A_arg1 Argument to be passed on to the functor.
|
||||
* @param _A_arg2 Argument to be passed on to the functor.
|
||||
* @param _A_arg3 Argument to be passed on to the functor.
|
||||
* @param _A_arg4 Argument to be passed on to the functor.
|
||||
* @param _A_arg5 Argument to be passed on to the functor.
|
||||
* @param _A_arg6 Argument to be passed on to the functor.
|
||||
* @param _A_arg7 Argument to be passed on to the functor.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator()(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3,T_arg4 _A_arg4,T_arg5 _A_arg5,T_arg6 _A_arg6,T_arg7 _A_arg7) const
|
||||
{ return functor_(_A_arg1,_A_arg2,_A_arg3,_A_arg4,_A_arg5,_A_arg6,_A_arg7); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
sun_forte_workaround(T_arg1 _A_arg1,T_arg2 _A_arg2,T_arg3 _A_arg3,T_arg4 _A_arg4,T_arg5 _A_arg5,T_arg6 _A_arg6,T_arg7 _A_arg7) const
|
||||
{ //Just calling operator() tries to copy the argument:
|
||||
return functor_(_A_arg1,_A_arg2,_A_arg3,_A_arg4,_A_arg5,_A_arg6,_A_arg7);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
adaptor_functor()
|
||||
{}
|
||||
|
||||
/** Constructs an adaptor_functor object that wraps the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
*/
|
||||
explicit adaptor_functor(const T_functor& _A_functor)
|
||||
: functor_(_A_functor)
|
||||
{}
|
||||
|
||||
/** Constructs an adaptor_functor object that wraps the passed (member)
|
||||
* function pointer.
|
||||
* @param _A_type Pointer to function or class method to invoke from operator()().
|
||||
*/
|
||||
template <class T_type>
|
||||
explicit adaptor_functor(const T_type& _A_type)
|
||||
: functor_(_A_type)
|
||||
{}
|
||||
|
||||
/// Functor that is invoked from operator()().
|
||||
mutable T_functor functor_;
|
||||
};
|
||||
|
||||
template <class T_functor>
|
||||
typename adaptor_functor<T_functor>::result_type
|
||||
adaptor_functor<T_functor>::operator()() const
|
||||
{ return functor_(); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::adaptor_functor performs a functor
|
||||
* on the functor stored in the sigc::adaptor_functor object.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_action, class T_functor>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const adaptor_functor<T_functor>& _A_target)
|
||||
{
|
||||
//The extra sigc:: prefix avoids ambiguity in some strange
|
||||
//situations.
|
||||
sigc::visit_each(_A_action, _A_target.functor_);
|
||||
}
|
||||
|
||||
|
||||
/** Trait that specifies what is the adaptor version of a functor type.
|
||||
* Template specializations for sigc::adaptor_base derived functors,
|
||||
* for function pointers and for class methods are provided.
|
||||
*
|
||||
* The template argument @e T_functor is the functor type to convert.
|
||||
* @e I_isadaptor indicates whether @e T_functor inherits from sigc::adaptor_base.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_functor, bool I_isadaptor = is_base_and_derived<adaptor_base, T_functor>::value> struct adaptor_trait;
|
||||
|
||||
/** Trait that specifies what is the adaptor version of a functor type.
|
||||
* This template specialization is used for types that inherit from adaptor_base.
|
||||
* adaptor_type is equal to @p T_functor in this case.
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct adaptor_trait<T_functor, true>
|
||||
{
|
||||
typedef typename T_functor::result_type result_type;
|
||||
typedef T_functor functor_type;
|
||||
typedef T_functor adaptor_type;
|
||||
};
|
||||
|
||||
/** Trait that specifies what is the adaptor version of a functor type.
|
||||
* This template specialization is used for arbitrary functors,
|
||||
* for function pointers and for class methods are provided.
|
||||
* The latter are converted into @p pointer_functor or @p mem_functor types.
|
||||
* adaptor_type is equal to @p adaptor_functor<functor_type>.
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct adaptor_trait<T_functor, false>
|
||||
{
|
||||
typedef typename functor_trait<T_functor>::result_type result_type;
|
||||
typedef typename functor_trait<T_functor>::functor_type functor_type;
|
||||
typedef adaptor_functor<functor_type> adaptor_type;
|
||||
};
|
||||
|
||||
|
||||
/** Base type for adaptors.
|
||||
* adapts wraps adaptors, functors, function pointers and class methods.
|
||||
* It contains a single member functor which is always a sigc::adaptor_base.
|
||||
* The typedef adaptor_type defines the exact type that is used
|
||||
* to store the adaptor, functor, function pointer or class method passed
|
||||
* into the constructor. It differs from @e T_functor unless @e T_functor
|
||||
* inherits from sigc::adaptor_base.
|
||||
*
|
||||
* @par Example of a simple adaptor:
|
||||
* @code
|
||||
* template <T_functor>
|
||||
* struct my_adpator : public sigc::adapts<T_functor>
|
||||
* {
|
||||
* template <class T_arg1=void, class T_arg2=void>
|
||||
* struct deduce_result_type
|
||||
* { typedef typename sigc::deduce_result_type<T_functor, T_arg1, T_arg2>::type type; };
|
||||
* typedef typename sigc::functor_trait<T_functor>::result_type result_type;
|
||||
*
|
||||
* result_type
|
||||
* operator()() const;
|
||||
*
|
||||
* template <class T_arg1>
|
||||
* typename deduce_result_type<T_arg1>::type
|
||||
* operator()(T_arg1 _A_arg1) const;
|
||||
*
|
||||
* template <class T_arg1, class T_arg2>
|
||||
* typename deduce_result_type<T_arg1, T_arg2>::type
|
||||
* operator()(T_arg1 _A_arg1, class T_arg2) const;
|
||||
*
|
||||
* explicit adaptor_functor(const T_functor& _A_functor) // Constructs a my_functor object that wraps the passed functor.
|
||||
* : sigc::adapts<T_functor>(_A_functor) {}
|
||||
*
|
||||
* mutable T_functor functor_; // Functor that is invoked from operator()().
|
||||
* };
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct adapts : public adaptor_base
|
||||
{
|
||||
typedef typename adaptor_trait<T_functor>::result_type result_type;
|
||||
typedef typename adaptor_trait<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
/** Constructs an adaptor that wraps the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
*/
|
||||
explicit adapts(const T_functor& _A_functor)
|
||||
: functor_(_A_functor)
|
||||
{}
|
||||
|
||||
/// Adaptor that is invoked from operator()().
|
||||
mutable adaptor_type functor_;
|
||||
};
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_ADAPTORS_MACROS_ADAPTOR_TRAITHM4_ */
|
||||
32
libs/sigc++2/sigc++/adaptors/adaptors.h
Normal file
32
libs/sigc++2/sigc++/adaptors/adaptors.h
Normal file
@@ -0,0 +1,32 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_ADAPTOR_HPP_
|
||||
#define _SIGC_ADAPTOR_HPP_
|
||||
|
||||
#include <sigc++/adaptors/bind.h>
|
||||
#include <sigc++/adaptors/bind_return.h>
|
||||
#include <sigc++/adaptors/hide.h>
|
||||
#include <sigc++/adaptors/retype_return.h>
|
||||
#include <sigc++/adaptors/retype.h>
|
||||
#include <sigc++/adaptors/compose.h>
|
||||
#include <sigc++/adaptors/exception_catch.h>
|
||||
#include <sigc++/adaptors/lambda/lambda.h>
|
||||
|
||||
#endif /* _SIGC_ADAPTOR_HPP_ */
|
||||
2265
libs/sigc++2/sigc++/adaptors/bind.h
Normal file
2265
libs/sigc++2/sigc++/adaptors/bind.h
Normal file
File diff suppressed because it is too large
Load Diff
206
libs/sigc++2/sigc++/adaptors/bind_return.h
Normal file
206
libs/sigc++2/sigc++/adaptors/bind_return.h
Normal file
@@ -0,0 +1,206 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#ifndef _SIGC_ADAPTORS_MACROS_BIND_RETURNHM4_
|
||||
#define _SIGC_ADAPTORS_MACROS_BIND_RETURNHM4_
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/adaptors/bound_argument.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** Adaptor that fixes the return value of the wrapped functor.
|
||||
* Use the convenience function sigc::bind_return() to create an instance of sigc::bind_return_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_return Type of the fixed return value.
|
||||
* - @e T_functor Type of the functor to wrap.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_return, class T_functor>
|
||||
struct bind_return_functor : public adapts<T_functor>
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename unwrap_reference<T_return>::type type; };
|
||||
typedef typename unwrap_reference<T_return>::type result_type;
|
||||
|
||||
/** Invokes the wrapped functor dropping its return value.
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
typename unwrap_reference<T_return>::type operator()();
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.,
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.)
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
template <class T_arg1>
|
||||
inline typename unwrap_reference<T_return>::type operator()(T_arg1 _A_a1)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_a1); return ret_value_.invoke();
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
inline typename unwrap_reference<T_return>::type sun_forte_workaround(T_arg1 _A_a1)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_a1); return ret_value_.invoke();
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.,
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.)
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2>
|
||||
inline typename unwrap_reference<T_return>::type operator()(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_a1,_A_a2); return ret_value_.invoke();
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
inline typename unwrap_reference<T_return>::type sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_a1,_A_a2); return ret_value_.invoke();
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.,
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.)
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
inline typename unwrap_reference<T_return>::type operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_a1,_A_a2,_A_a3); return ret_value_.invoke();
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
inline typename unwrap_reference<T_return>::type sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_a1,_A_a2,_A_a3); return ret_value_.invoke();
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.,
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.)
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
inline typename unwrap_reference<T_return>::type operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4); return ret_value_.invoke();
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
inline typename unwrap_reference<T_return>::type sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4); return ret_value_.invoke();
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.,
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.)
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
inline typename unwrap_reference<T_return>::type operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); return ret_value_.invoke();
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
inline typename unwrap_reference<T_return>::type sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); return ret_value_.invoke();
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.,
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.)
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
inline typename unwrap_reference<T_return>::type operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); return ret_value_.invoke();
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
inline typename unwrap_reference<T_return>::type sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); return ret_value_.invoke();
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.,
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.)
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
inline typename unwrap_reference<T_return>::type operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); return ret_value_.invoke();
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
inline typename unwrap_reference<T_return>::type sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); return ret_value_.invoke();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** Constructs a bind_return_functor object that fixes the return value to @p _A_ret_value.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
* @param _A_ret_value Value to return from operator()().
|
||||
*/
|
||||
bind_return_functor(typename type_trait<T_functor>::take _A_functor, typename type_trait<T_return>::take _A_ret_value)
|
||||
: adapts<T_functor>(_A_functor), ret_value_(_A_ret_value)
|
||||
{}
|
||||
|
||||
/// The fixed return value.
|
||||
bound_argument<T_return> ret_value_; // public, so that visit_each() can access it
|
||||
};
|
||||
|
||||
template <class T_return, class T_functor>
|
||||
typename unwrap_reference<T_return>::type bind_return_functor<T_return, T_functor>::operator()()
|
||||
{ this->functor_(); return ret_value_.invoke(); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::bind_return_functor performs a functor on the
|
||||
* functor and on the object instance stored in the sigc::bind_return_functor object.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_action, class T_return, class T_functor>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const bind_return_functor<T_return, T_functor>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.ret_value_);
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
}
|
||||
|
||||
|
||||
/** Creates an adaptor of type sigc::bind_return_functor which fixes the return value of the passed functor to the passed argument.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @param _A_ret_value Argument to fix the return value of @e _A_functor to.
|
||||
* @return Adaptor that executes @e _A_functor on invokation and returns @e _A_ret_value.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_return, class T_functor>
|
||||
inline bind_return_functor<T_return, T_functor>
|
||||
bind_return(const T_functor& _A_functor, T_return _A_ret_value)
|
||||
{ return bind_return_functor<T_return, T_functor>(_A_functor, _A_ret_value); }
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_ADAPTORS_MACROS_BIND_RETURNHM4_ */
|
||||
165
libs/sigc++2/sigc++/adaptors/bound_argument.h
Normal file
165
libs/sigc++2/sigc++/adaptors/bound_argument.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Copyright 2005, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _SIGC_BOUND_ARGUMENT_H_
|
||||
#define _SIGC_BOUND_ARGUMENT_H_
|
||||
|
||||
|
||||
#include <sigc++/limit_reference.h>
|
||||
#include <sigc++/reference_wrapper.h>
|
||||
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** A bound_argument<Foo> object stores a bound (for instance, with sigc::bind(), or sigc::bind_return()) argument.
|
||||
*
|
||||
* If Foo is a wrapped reference to a class Bar (reference_wrapper<Bar>) then this
|
||||
* object is implemented on top of a limit_reference. When the slot is
|
||||
* invoked, the limit_reference::invoke() method provides the argument (a Bar&).
|
||||
* When the slot is visited (e.g. visit_each<>()), we simply visit the limit_reference,
|
||||
* which will visit the derived type, or a sigc::trackable base if necessary.
|
||||
*
|
||||
* Likewise, If Foo is a wrapped const reference to a class Bar (const_reference_wrapper<Bar>)
|
||||
* then this object is implemented on top of a const_limit_reference.
|
||||
*
|
||||
* If Foo is something else (such as an argument that is bound by value) bound_argument just
|
||||
* stores a cop of that value, and both invoke() and visit() simply return it.
|
||||
*
|
||||
* This object is used by the bind_functor<> and bind_return_functor<> objects,
|
||||
* depending on whether the argument is bound as a parameter or as a return value.
|
||||
*
|
||||
* The general template implementation is used for parameters that are passed by value.
|
||||
* @e T_type The type of the bound argument.
|
||||
*/
|
||||
template <class T_type>
|
||||
class bound_argument
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_argument The argument to bind.
|
||||
*/
|
||||
bound_argument(const T_type& _A_argument)
|
||||
: visited_(_A_argument)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit in visit_each().
|
||||
* @return The bound argument.
|
||||
*/
|
||||
inline const T_type& visit() const
|
||||
{ return visited_; }
|
||||
|
||||
/** Retrieve the entity to pass to the bound functor or return.
|
||||
* @return The bound argument.
|
||||
*/
|
||||
inline T_type& invoke()
|
||||
{ return visited_; }
|
||||
|
||||
private:
|
||||
/** The value of the argument.
|
||||
*/
|
||||
T_type visited_;
|
||||
};
|
||||
|
||||
//Template specialization:
|
||||
/** bound_argument object for a bound argument that is passed by bind() or
|
||||
* returned by bind_return() by reference, specialized for reference_wrapper<> types.
|
||||
* @e T_wrapped The type of the bound argument.
|
||||
*/
|
||||
template <class T_wrapped>
|
||||
class bound_argument< reference_wrapper<T_wrapped> >
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_argument The argument to bind.
|
||||
*/
|
||||
bound_argument(const reference_wrapper<T_wrapped>& _A_argument)
|
||||
: visited_(unwrap(_A_argument))
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit in visit_each().
|
||||
* @return The limited_reference to the bound argument.
|
||||
*/
|
||||
inline const limit_reference<T_wrapped>& visit() const
|
||||
{ return visited_; }
|
||||
|
||||
/** Retrieve the entity to pass to the bound functor or return.
|
||||
* @return The bound argument.
|
||||
*/
|
||||
inline T_wrapped& invoke()
|
||||
{ return visited_.invoke(); }
|
||||
|
||||
private:
|
||||
/** The limited_reference to the bound argument.
|
||||
*/
|
||||
limit_reference<T_wrapped> visited_;
|
||||
};
|
||||
|
||||
/** bound_argument object for a bound argument that is passed by bind() or
|
||||
* returned by bind_return() by const reference, specialized for const reference_wrapper<> types.
|
||||
* - @e T_wrapped The type of the bound argument.
|
||||
*/
|
||||
template <class T_wrapped>
|
||||
class bound_argument< const_reference_wrapper<T_wrapped> >
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_argument The argument to bind.
|
||||
*/
|
||||
bound_argument(const const_reference_wrapper<T_wrapped>& _A_argument)
|
||||
: visited_(unwrap(_A_argument))
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit in visit_each().
|
||||
* @return The const_limited_reference to the bound argument.
|
||||
*/
|
||||
inline const const_limit_reference<T_wrapped>& visit() const
|
||||
{ return visited_; }
|
||||
|
||||
/** Retrieve the entity to pass to the bound functor or return.
|
||||
* @return The bound argument.
|
||||
*/
|
||||
inline const T_wrapped& invoke()
|
||||
{ return visited_.invoke(); }
|
||||
|
||||
private:
|
||||
/** The const_limited_reference to the bound argument.
|
||||
*/
|
||||
const_limit_reference<T_wrapped> visited_;
|
||||
};
|
||||
|
||||
/** Implementation of visit_each() specialized for the bound_argument class.
|
||||
* Call visit_each() on the entity returned by the bound_argument's visit()
|
||||
* method.
|
||||
* @e T_action The type of functor to invoke.
|
||||
* @e T_type The type of bound_argument.
|
||||
* @param _A_action The functor to invoke.
|
||||
* @param _A_argument The visited instance.
|
||||
*/
|
||||
template <class T_action, class T_type>
|
||||
void
|
||||
visit_each(const T_action& _A_action,
|
||||
const bound_argument<T_type>& _A_argument)
|
||||
{
|
||||
visit_each(_A_action, _A_argument.visit());
|
||||
}
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
|
||||
#endif /* _SIGC_BOUND_ARGUMENT_H_ */
|
||||
314
libs/sigc++2/sigc++/adaptors/compose.h
Normal file
314
libs/sigc++2/sigc++/adaptors/compose.h
Normal file
@@ -0,0 +1,314 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
|
||||
#ifndef _SIGC_ADAPTORS_MACROS_COMPOSEHM4_
|
||||
#define _SIGC_ADAPTORS_MACROS_COMPOSEHM4_
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup compose compose()
|
||||
* sigc::compose() combines two or three arbitrary functors.
|
||||
* On invokation parameters are passed on to one or two getter functor(s).
|
||||
* The return value(s) are then passed on to the setter function.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* float square_root(float a) { return sqrtf(a); }
|
||||
* float sum(float a, float b) { return a+b; }
|
||||
* std::cout << sigc::compose(&square_root, &sum)(9, 16); // calls square_root(sum(3,6))
|
||||
* std::cout << sigc::compose(&sum, &square_root, &square_root)(9); // calls sum(square_root(9), square_root(9))
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::compose() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<float,float,float> some_signal;
|
||||
* some_signal.connect(sigc::compose(&square_root, &sum));
|
||||
* @endcode
|
||||
*
|
||||
* For a more powerful version of this functionality see the lambda
|
||||
* library adaptor sigc::group() which can bind, hide and reorder
|
||||
* arguments arbitrarily. Although sigc::group() is more flexible,
|
||||
* sigc::bind() provides a means of binding parameters when then total
|
||||
* number of parameters called is variable.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
|
||||
/** Adaptor that combines two functors.
|
||||
* Use the convenience function sigc::compose() to create an instance of sigc::compose1_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_setter Type of the setter functor to wrap.
|
||||
* - @e T_getter Type of the getter functor to wrap.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_setter, class T_getter>
|
||||
struct compose1_functor : public adapts<T_setter>
|
||||
{
|
||||
typedef typename adapts<T_setter>::adaptor_type adaptor_type;
|
||||
typedef T_setter setter_type;
|
||||
typedef T_getter getter_type;
|
||||
|
||||
template <class T_arg1 = void,class T_arg2 = void,class T_arg3 = void,class T_arg4 = void,class T_arg5 = void,class T_arg6 = void,class T_arg7 = void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename adaptor_type::template deduce_result_type<
|
||||
typename sigc::deduce_result_type<T_getter, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
>::type type; };
|
||||
typedef typename adaptor_type::result_type result_type;
|
||||
|
||||
result_type
|
||||
operator()();
|
||||
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator()(T_arg1 _A_a1)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter, T_arg1>::type>
|
||||
(get_(_A_a1));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter, T_arg1,T_arg2>::type>
|
||||
(get_(_A_a1,_A_a2));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter, T_arg1,T_arg2,T_arg3>::type>
|
||||
(get_(_A_a1,_A_a2,_A_a3));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter, T_arg1,T_arg2,T_arg3,T_arg4>::type>
|
||||
(get_(_A_a1,_A_a2,_A_a3,_A_a4));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type>
|
||||
(get_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type>
|
||||
(get_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type>
|
||||
(get_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7));
|
||||
}
|
||||
|
||||
|
||||
/** Constructs a compose1_functor object that combines the passed functors.
|
||||
* @param _A_setter Functor that receives the return values of the invokation of @e _A_getter1 and @e _A_getter2.
|
||||
* @param _A_getter1 Functor to invoke from operator()().
|
||||
* @param _A_getter2 Functor to invoke from operator()().
|
||||
*/
|
||||
compose1_functor(const T_setter& _A_setter, const T_getter& _A_getter)
|
||||
: adapts<T_setter>(_A_setter), get_(_A_getter)
|
||||
{}
|
||||
|
||||
getter_type get_; // public, so that visit_each() can access it
|
||||
};
|
||||
|
||||
template <class T_setter, class T_getter>
|
||||
typename compose1_functor<T_setter, T_getter>::result_type
|
||||
compose1_functor<T_setter, T_getter>::operator()()
|
||||
{ return this->functor_(get_()); }
|
||||
|
||||
/** Adaptor that combines three functors.
|
||||
* Use the convenience function sigc::compose() to create an instance of sigc::compose2_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_setter Type of the setter functor to wrap.
|
||||
* - @e T_getter1 Type of the first getter functor to wrap.
|
||||
* - @e T_getter2 Type of the second getter functor to wrap.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_setter, class T_getter1, class T_getter2>
|
||||
struct compose2_functor : public adapts<T_setter>
|
||||
{
|
||||
typedef typename adapts<T_setter>::adaptor_type adaptor_type;
|
||||
typedef T_setter setter_type;
|
||||
typedef T_getter1 getter1_type;
|
||||
typedef T_getter2 getter2_type;
|
||||
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename adaptor_type::template deduce_result_type<
|
||||
typename sigc::deduce_result_type<T_getter1, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type,
|
||||
typename sigc::deduce_result_type<T_getter2, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
>::type result_type; };
|
||||
typedef typename adaptor_type::result_type result_type;
|
||||
|
||||
result_type
|
||||
operator()();
|
||||
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator()(T_arg1 _A_a1)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter1, T_arg1>::type,
|
||||
typename sigc::deduce_result_type<T_getter2, T_arg1>::type>
|
||||
(get1_(_A_a1), get2_(_A_a1));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter1, T_arg1,T_arg2>::type,
|
||||
typename sigc::deduce_result_type<T_getter2, T_arg1,T_arg2>::type>
|
||||
(get1_(_A_a1,_A_a2), get2_(_A_a1,_A_a2));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter1, T_arg1,T_arg2,T_arg3>::type,
|
||||
typename sigc::deduce_result_type<T_getter2, T_arg1,T_arg2,T_arg3>::type>
|
||||
(get1_(_A_a1,_A_a2,_A_a3), get2_(_A_a1,_A_a2,_A_a3));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter1, T_arg1,T_arg2,T_arg3,T_arg4>::type,
|
||||
typename sigc::deduce_result_type<T_getter2, T_arg1,T_arg2,T_arg3,T_arg4>::type>
|
||||
(get1_(_A_a1,_A_a2,_A_a3,_A_a4), get2_(_A_a1,_A_a2,_A_a3,_A_a4));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter1, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type,
|
||||
typename sigc::deduce_result_type<T_getter2, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type>
|
||||
(get1_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5), get2_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter1, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type,
|
||||
typename sigc::deduce_result_type<T_getter2, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type>
|
||||
(get1_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6), get2_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6));
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<T_getter1, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type,
|
||||
typename sigc::deduce_result_type<T_getter2, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type>
|
||||
(get1_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7), get2_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7));
|
||||
}
|
||||
|
||||
|
||||
/** Constructs a compose2_functor object that combines the passed functors.
|
||||
* @param _A_setter Functor that receives the return values of the invokation of @e _A_getter1 and @e _A_getter2.
|
||||
* @param _A_getter1 Functor to invoke from operator()().
|
||||
* @param _A_getter2 Functor to invoke from operator()().
|
||||
*/
|
||||
compose2_functor(const T_setter& _A_setter,
|
||||
const T_getter1& _A_getter1,
|
||||
const T_getter2& _A_getter2)
|
||||
: adapts<T_setter>(_A_setter), get1_(_A_getter1), get2_(_A_getter2)
|
||||
{}
|
||||
|
||||
getter1_type get1_; // public, so that visit_each() can access it
|
||||
getter2_type get2_; // public, so that visit_each() can access it
|
||||
};
|
||||
|
||||
template <class T_setter, class T_getter1, class T_getter2>
|
||||
typename compose2_functor<T_setter, T_getter1, T_getter2>::result_type
|
||||
compose2_functor<T_setter, T_getter1, T_getter2>::operator()()
|
||||
{ return this->functor_(get1_(), get2_()); }
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::compose1_functor performs a functor on the
|
||||
* functors stored in the sigc::compose1_functor object.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_action, class T_setter, class T_getter>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const compose1_functor<T_setter, T_getter>& _A_target)
|
||||
{
|
||||
typedef compose1_functor<T_setter, T_getter> type_functor;
|
||||
|
||||
//Note that the AIX compiler needs the actual template types of visit_each to be specified:
|
||||
typedef typename type_functor::setter_type type_functor1;
|
||||
visit_each<T_action, type_functor1>(_A_action, _A_target.functor_);
|
||||
|
||||
typedef typename type_functor::getter_type type_functor_getter;
|
||||
visit_each<T_action, type_functor_getter>(_A_action, _A_target.get_);
|
||||
}
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::compose2_functor performs a functor on the
|
||||
* functors stored in the sigc::compose2_functor object.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_action, class T_setter, class T_getter1, class T_getter2>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const compose2_functor<T_setter, T_getter1, T_getter2>& _A_target)
|
||||
{
|
||||
typedef compose2_functor<T_setter, T_getter1, T_getter2> type_functor;
|
||||
|
||||
//Note that the AIX compiler needs the actual template types of visit_each to be specified:
|
||||
typedef typename type_functor::setter_type type_functor1;
|
||||
visit_each<T_action, type_functor1>(_A_action, _A_target.functor_);
|
||||
|
||||
typedef typename type_functor::getter1_type type_functor_getter1;
|
||||
visit_each<T_action, type_functor_getter1>(_A_action, _A_target.get1_);
|
||||
|
||||
typedef typename type_functor::getter2_type type_functor_getter2;
|
||||
visit_each<T_action, type_functor_getter2>(_A_action, _A_target.get2_);
|
||||
}
|
||||
|
||||
|
||||
/** Creates an adaptor of type sigc::compose1_functor which combines two functors.
|
||||
*
|
||||
* @param _A_setter Functor that receives the return value of the invokation of @e _A_getter.
|
||||
* @param _A_getter Functor to invoke from operator()().
|
||||
* @return Adaptor that executes @e _A_setter with the value returned from invokation of @e _A_getter.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_setter, class T_getter>
|
||||
inline compose1_functor<T_setter, T_getter>
|
||||
compose(const T_setter& _A_setter, const T_getter& _A_getter)
|
||||
{ return compose1_functor<T_setter, T_getter>(_A_setter, _A_getter); }
|
||||
|
||||
/** Creates an adaptor of type sigc::compose2_functor which combines three functors.
|
||||
*
|
||||
* @param _A_setter Functor that receives the return values of the invokation of @e _A_getter1 and @e _A_getter2.
|
||||
* @param _A_getter1 Functor to invoke from operator()().
|
||||
* @param _A_getter2 Functor to invoke from operator()().
|
||||
* @return Adaptor that executes @e _A_setter with the values return from invokation of @e _A_getter1 and @e _A_getter2.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_setter, class T_getter1, class T_getter2>
|
||||
inline compose2_functor<T_setter, T_getter1, T_getter2>
|
||||
compose(const T_setter& _A_setter, const T_getter1& _A_getter1, const T_getter2& _A_getter2)
|
||||
{ return compose2_functor<T_setter, T_getter1, T_getter2>(_A_setter, _A_getter1, _A_getter2); }
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_ADAPTORS_MACROS_COMPOSEHM4_ */
|
||||
121
libs/sigc++2/sigc++/adaptors/deduce_result_type.h
Normal file
121
libs/sigc++2/sigc++/adaptors/deduce_result_type.h
Normal file
@@ -0,0 +1,121 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
/*
|
||||
*/
|
||||
#ifndef _SIGC_ADAPTORS_MACROS_DEDUCE_RESULT_TYPEHM4_
|
||||
#define _SIGC_ADAPTORS_MACROS_DEDUCE_RESULT_TYPEHM4_
|
||||
#include <sigc++/functors/functor_trait.h>
|
||||
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** A hint to the compiler.
|
||||
* Functors which have all methods based on templates
|
||||
* should publicly inherit from this hint and define
|
||||
* a nested template class @p deduce_result_type that
|
||||
* can be used to deduce the methods' return types.
|
||||
*
|
||||
* adaptor_base inherits from the functor_base hint so
|
||||
* derived types should also have a result_type defined.
|
||||
*
|
||||
* Adaptors don't inherit from this type directly. They use
|
||||
* use sigc::adapts as a base type instead. sigc::adaptors
|
||||
* wraps arbitrary functor types as well as function pointers
|
||||
* and class methods.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
struct adaptor_base : public functor_base {};
|
||||
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* <tt>typename deduce_result_type<functor_type, list of arg_types>::type</tt>
|
||||
* deduces a functor's result type if @p functor_type inherits from
|
||||
* sigc::functor_base and defines @p result_type or if @p functor_type
|
||||
* is actually a (member) function type. Multi-type functors are not
|
||||
* supported.
|
||||
*
|
||||
* sigc++ adaptors use
|
||||
* <tt>typename deduce_result_type<functor_type, list of arg_types>::type</tt>
|
||||
* to determine the return type of their <tt>templated operator()</tt> overloads.
|
||||
*
|
||||
* Adaptors in turn define a nested template class @p deduce_result_type
|
||||
* that is used by template specializations of the global deduce_result_type
|
||||
* template to correctly deduce the return types of the adaptor's suitable
|
||||
* <tt>template operator()</tt> overload.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_functor,
|
||||
class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void,
|
||||
bool I_derives_adaptor_base=is_base_and_derived<adaptor_base,T_functor>::value>
|
||||
struct deduce_result_type
|
||||
{ typedef typename functor_trait<T_functor>::result_type type; };
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for 0 arguments.
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct deduce_result_type<T_functor, void,void,void,void,void,void,void, true>
|
||||
{ typedef typename T_functor::template deduce_result_type<>::type type; };
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for 1 arguments.
|
||||
*/
|
||||
template <class T_functor, class T_arg1>
|
||||
struct deduce_result_type<T_functor, T_arg1, void,void,void,void,void,void, true>
|
||||
{ typedef typename T_functor::template deduce_result_type<T_arg1>::type type; };
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for 2 arguments.
|
||||
*/
|
||||
template <class T_functor, class T_arg1,class T_arg2>
|
||||
struct deduce_result_type<T_functor, T_arg1,T_arg2, void,void,void,void,void, true>
|
||||
{ typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2>::type type; };
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for 3 arguments.
|
||||
*/
|
||||
template <class T_functor, class T_arg1,class T_arg2,class T_arg3>
|
||||
struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3, void,void,void,void, true>
|
||||
{ typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type type; };
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for 4 arguments.
|
||||
*/
|
||||
template <class T_functor, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4, void,void,void, true>
|
||||
{ typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type type; };
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for 5 arguments.
|
||||
*/
|
||||
template <class T_functor, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, void,void, true>
|
||||
{ typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type type; };
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for 6 arguments.
|
||||
*/
|
||||
template <class T_functor, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, void, true>
|
||||
{ typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type type; };
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for 7 arguments.
|
||||
*/
|
||||
template <class T_functor, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, true>
|
||||
{ typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type type; };
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_ADAPTORS_MACROS_DEDUCE_RESULT_TYPEHM4_ */
|
||||
318
libs/sigc++2/sigc++/adaptors/exception_catch.h
Normal file
318
libs/sigc++2/sigc++/adaptors/exception_catch.h
Normal file
@@ -0,0 +1,318 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#ifndef _SIGC_ADAPTORS_MACROS_EXCEPTION_CATCHHM4_
|
||||
#define _SIGC_ADAPTORS_MACROS_EXCEPTION_CATCHHM4_
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/*
|
||||
functor adaptor: exception_catch(functor, catcher)
|
||||
|
||||
usage:
|
||||
|
||||
|
||||
Future directions:
|
||||
The catcher should be told what type of return it needs to
|
||||
return for multiple type functors, to do this the user
|
||||
will need to derive from catcher_base.
|
||||
*/
|
||||
/** @defgroup exception_catch exception_catch()
|
||||
* sigc::exception_catch() catches an exception thrown from within
|
||||
* the wrapped functor and directs it to a catcher functor.
|
||||
* This catcher can then rethrow the exception and catch it with the proper type.
|
||||
*
|
||||
* Note that the catcher is expected to return the same type
|
||||
* as the wrapped functor so that normal flow can continue.
|
||||
*
|
||||
* Catchers can be cascaded to catch multiple types because uncaught
|
||||
* rethrown exceptions proceed to the next catcher adaptor.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* struct my_catch
|
||||
* {
|
||||
* int operator()()
|
||||
* {
|
||||
* try { throw; }
|
||||
* catch (std::range_error e) // catch what types we know
|
||||
* { std::cerr << "caught " << e.what() << std::endl; }
|
||||
* return 1;
|
||||
* }
|
||||
* }
|
||||
* int foo(); // throws std::range_error
|
||||
* sigc::exception_catch(&foo, my_catch())();
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::execption_catch() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<int> some_signal;
|
||||
* some_signal.connect(sigc::exception_catch(&foo, my_catch));
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
|
||||
template <class T_functor, class T_catcher, class T_return = typename adapts<T_functor>::result_type>
|
||||
struct exception_catch_functor : public adapts<T_functor>
|
||||
{
|
||||
typedef typename adapts<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename adaptor_type::template deduce_result_type<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>::type type; };
|
||||
typedef T_return result_type;
|
||||
|
||||
result_type
|
||||
operator()();
|
||||
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator()(T_arg1 _A_a1)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_a1);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_a1,_A_a2);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_a1,_A_a2,_A_a3);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
exception_catch_functor(const T_functor& _A_func,
|
||||
const T_catcher& _A_catcher)
|
||||
: adapts<T_functor>(_A_func), catcher_(_A_catcher)
|
||||
{}
|
||||
|
||||
T_catcher catcher_;
|
||||
};
|
||||
|
||||
template <class T_functor, class T_catcher, class T_return>
|
||||
typename exception_catch_functor<T_functor, T_catcher, T_return>::result_type
|
||||
exception_catch_functor<T_functor, T_catcher, T_return>::operator()()
|
||||
{
|
||||
try
|
||||
{ return this->functor_(); }
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
// void specialization
|
||||
template <class T_functor, class T_catcher>
|
||||
struct exception_catch_functor<T_functor, T_catcher, void> : public adapts<T_functor>
|
||||
{
|
||||
typedef void result_type;
|
||||
typedef typename adapts<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
void
|
||||
operator()();
|
||||
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator()(T_arg1 _A_a1)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_a1);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_a1,_A_a2);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_a1,_A_a2,_A_a3);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
exception_catch_functor() {}
|
||||
exception_catch_functor(const T_functor& _A_func,
|
||||
const T_catcher& _A_catcher)
|
||||
: adapts<T_functor>(_A_func), catcher_(_A_catcher)
|
||||
{}
|
||||
~exception_catch_functor() {}
|
||||
|
||||
T_catcher catcher_;
|
||||
};
|
||||
|
||||
template <class T_functor, class T_catcher>
|
||||
void exception_catch_functor<T_functor, T_catcher, void>::operator()()
|
||||
{
|
||||
try
|
||||
{ this->functor_(); } // I don't understand why void return doesn't work here (Martin)
|
||||
catch (...)
|
||||
{ this->catcher_(); }
|
||||
}
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_functor, class T_catcher, class T_return>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const exception_catch_functor<T_functor, T_catcher, T_return>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
visit_each(_A_action, _A_target.catcher_);
|
||||
}
|
||||
|
||||
|
||||
template <class T_functor, class T_catcher>
|
||||
inline exception_catch_functor<T_functor, T_catcher>
|
||||
exception_catch(const T_functor& _A_func, const T_catcher& _A_catcher)
|
||||
{ return exception_catch_functor<T_functor, T_catcher>(_A_func, _A_catcher); }
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_ADAPTORS_MACROS_EXCEPTION_CATCHHM4_ */
|
||||
1064
libs/sigc++2/sigc++/adaptors/hide.h
Normal file
1064
libs/sigc++2/sigc++/adaptors/hide.h
Normal file
File diff suppressed because it is too large
Load Diff
415
libs/sigc++2/sigc++/adaptors/lambda/base.h
Normal file
415
libs/sigc++2/sigc++/adaptors/lambda/base.h
Normal file
@@ -0,0 +1,415 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#ifndef _SIGC_LAMBDA_BASE_HPP_
|
||||
#define _SIGC_LAMBDA_BASE_HPP_
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/reference_wrapper.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup lambdas Lambdas
|
||||
* libsigc++ ships with basic lambda functionality and the sigc::group adaptor that uses lambdas to transform a functor's parameter list.
|
||||
*
|
||||
* The lambda selectors sigc::_1, sigc::_2, ..., sigc::_9 are used to select the
|
||||
* first, second, ..., nineth argument from a list.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* std::cout << sigc::_1(10,20,30); // returns 10
|
||||
* std::cout << sigc::_2(10,20,30); // returns 20
|
||||
* ...
|
||||
* @endcode
|
||||
*
|
||||
* Operators are defined so that lambda selectors can be used e.g. as placeholders in
|
||||
* arithmetic expressions.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* std::cout << (sigc::_1 + 5)(3); // returns (3 + 5)
|
||||
* std::cout << (sigc::_1 * sigc::_2)(7,10); // returns (7 * 10)
|
||||
* @endcode
|
||||
*/
|
||||
|
||||
/** A hint to the compiler.
|
||||
* All lambda types publically inherit from this hint.
|
||||
*
|
||||
* @ingroup lambdas
|
||||
*/
|
||||
struct lambda_base : public adaptor_base {};
|
||||
|
||||
// Forward declaration of lambda.
|
||||
template <class T_type> struct lambda;
|
||||
|
||||
|
||||
namespace internal {
|
||||
|
||||
/** Abstracts lambda functionality.
|
||||
* Objects of this type store a value that may be of type lambda itself.
|
||||
* In this case, operator()() executes the lambda (a lambda is always a functor at the same time).
|
||||
* Otherwise, operator()() simply returns the stored value.
|
||||
*/
|
||||
template <class T_type, bool I_islambda = is_base_and_derived<lambda_base, T_type>::value> struct lambda_core;
|
||||
|
||||
/// Abstracts lambda functionality (template specialization for lambda values).
|
||||
template <class T_type>
|
||||
struct lambda_core<T_type, true> : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename T_type::template deduce_result_type<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>::type type; };
|
||||
typedef typename T_type::result_type result_type;
|
||||
typedef T_type lambda_type;
|
||||
|
||||
result_type
|
||||
operator()() const;
|
||||
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator ()(T_arg1 _A_1) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_1);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
sun_forte_workaround(T_arg1 _A_1) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_1);
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator ()(T_arg1 _A_1,T_arg2 _A_2) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_1,_A_2);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_1,_A_2);
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator ()(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_1,_A_2,_A_3);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_1,_A_2,_A_3);
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator ()(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_1,_A_2,_A_3,_A_4);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_1,_A_2,_A_3,_A_4);
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator ()(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_1,_A_2,_A_3,_A_4,_A_5);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_1,_A_2,_A_3,_A_4,_A_5);
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator ()(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6);
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator ()(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7);
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
lambda_core() {}
|
||||
|
||||
explicit lambda_core(const T_type& v)
|
||||
: value_(v) {}
|
||||
|
||||
T_type value_;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
typename lambda_core<T_type, true>::result_type
|
||||
lambda_core<T_type, true>::operator()() const
|
||||
{ return value_(); }
|
||||
|
||||
|
||||
/// Abstracts lambda functionality (template specialization for other value types).
|
||||
template <class T_type>
|
||||
struct lambda_core<T_type, false> : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_type type; };
|
||||
typedef T_type result_type; // all operator() overloads return T_type.
|
||||
typedef lambda<T_type> lambda_type;
|
||||
|
||||
result_type operator()() const;
|
||||
|
||||
template <class T_arg1>
|
||||
result_type operator ()(T_arg1) const
|
||||
{ return value_; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
result_type sun_forte_workaround(T_arg1) const
|
||||
{ return value_; }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
result_type operator ()(T_arg1,T_arg2) const
|
||||
{ return value_; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
result_type sun_forte_workaround(T_arg1,T_arg2) const
|
||||
{ return value_; }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
result_type operator ()(T_arg1,T_arg2,T_arg3) const
|
||||
{ return value_; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
result_type sun_forte_workaround(T_arg1,T_arg2,T_arg3) const
|
||||
{ return value_; }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
result_type operator ()(T_arg1,T_arg2,T_arg3,T_arg4) const
|
||||
{ return value_; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
result_type sun_forte_workaround(T_arg1,T_arg2,T_arg3,T_arg4) const
|
||||
{ return value_; }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
result_type operator ()(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5) const
|
||||
{ return value_; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
result_type sun_forte_workaround(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5) const
|
||||
{ return value_; }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
result_type operator ()(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6) const
|
||||
{ return value_; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
result_type sun_forte_workaround(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6) const
|
||||
{ return value_; }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
result_type operator ()(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7) const
|
||||
{ return value_; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
result_type sun_forte_workaround(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7) const
|
||||
{ return value_; }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
explicit lambda_core(typename type_trait<T_type>::take v)
|
||||
: value_(v) {}
|
||||
|
||||
T_type value_;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
typename lambda_core<T_type, false>::result_type lambda_core<T_type, false>::operator()() const
|
||||
{ return value_; }
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_functor, bool I_islambda>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const internal::lambda_core<T_functor, I_islambda>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.value_);
|
||||
}
|
||||
|
||||
|
||||
// forward declarations for lambda operators other<subscript> and other<assign>
|
||||
template <class T_type>
|
||||
struct other;
|
||||
struct subscript;
|
||||
struct assign;
|
||||
|
||||
template <class T_action, class T_type1, class T_type2>
|
||||
struct lambda_operator;
|
||||
|
||||
template <class T_type>
|
||||
struct unwrap_lambda_type;
|
||||
|
||||
|
||||
/** Lambda type.
|
||||
* Objects of this type store a value that may be of type lambda itself.
|
||||
* In this case, operator()() executes the lambda (a lambda is always a functor at the same time).
|
||||
* Otherwise, operator()() simply returns the stored value.
|
||||
* The assign and subscript operators are defined to return a lambda operator.
|
||||
*
|
||||
* @ingroup lambdas
|
||||
*/
|
||||
template <class T_type>
|
||||
struct lambda : public internal::lambda_core<T_type>
|
||||
{
|
||||
typedef lambda<T_type> self;
|
||||
|
||||
lambda()
|
||||
{}
|
||||
|
||||
lambda(typename type_trait<T_type>::take v)
|
||||
: internal::lambda_core<T_type>(v)
|
||||
{}
|
||||
|
||||
// operators for other<subscript>
|
||||
template <class T_arg>
|
||||
lambda<lambda_operator<other<subscript>, self, typename unwrap_lambda_type<T_arg>::type> >
|
||||
operator [] (const T_arg& a) const
|
||||
{ typedef lambda_operator<other<subscript>, self, typename unwrap_lambda_type<T_arg>::type> lambda_operator_type;
|
||||
return lambda<lambda_operator_type>(lambda_operator_type(this->value_, unwrap_lambda_value(a))); }
|
||||
|
||||
// operators for other<assign>
|
||||
template <class T_arg>
|
||||
lambda<lambda_operator<other<assign>, self, typename unwrap_lambda_type<T_arg>::type> >
|
||||
operator = (const T_arg& a) const
|
||||
{ typedef lambda_operator<other<assign>, self, typename unwrap_lambda_type<T_arg>::type> lambda_operator_type;
|
||||
return lambda<lambda_operator_type>(lambda_operator_type(this->value_, unwrap_lambda_value(a))); }
|
||||
};
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_type>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda<T_type>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.value_);
|
||||
}
|
||||
|
||||
|
||||
/** Converts a reference into a lambda object.
|
||||
* sigc::var creates a 0-ary functor, returning the value of a referenced variable.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* int main(int argc, char* argv)
|
||||
* {
|
||||
* int data;
|
||||
* sigc::signal<int> readValue;
|
||||
*
|
||||
* readValue.connect(sigc::var(data));
|
||||
*
|
||||
* data = 3;
|
||||
* std::cout << readValue() << std::endl; //Prints 3.
|
||||
*
|
||||
* data = 5;
|
||||
* std::cout << readValue() << std::endl; //Prints 5.
|
||||
* }
|
||||
* @endcode
|
||||
*/
|
||||
template <class T_type>
|
||||
lambda<T_type&> var(T_type& v)
|
||||
{ return lambda<T_type&>(v); }
|
||||
|
||||
/** Converts a constant reference into a lambda object.
|
||||
*/
|
||||
template <class T_type>
|
||||
lambda<const T_type&> var(const T_type& v)
|
||||
{ return lambda<const T_type&>(v); }
|
||||
|
||||
|
||||
/** Deduces the type of the object stored in an object of the passed lambda type.
|
||||
* If the type passed as template argument is no lambda type,
|
||||
* type is defined to unwrap_reference<T_type>::type.
|
||||
*/
|
||||
template <class T_type>
|
||||
struct unwrap_lambda_type
|
||||
{ typedef typename unwrap_reference<T_type>::type type; };
|
||||
|
||||
template <class T_type>
|
||||
struct unwrap_lambda_type<lambda<T_type> >
|
||||
{ typedef T_type type; };
|
||||
|
||||
|
||||
/** Gets the object stored inside a lambda object.
|
||||
* Returns the object passed as argument if it is not of type lambda.
|
||||
*/
|
||||
template <class T_type>
|
||||
T_type& unwrap_lambda_value(T_type& a)
|
||||
{ return a; }
|
||||
|
||||
template <class T_type>
|
||||
const T_type& unwrap_lambda_value(const T_type& a)
|
||||
{ return a; }
|
||||
|
||||
template <class T_type>
|
||||
const T_type& unwrap_lambda_value(const lambda<T_type>& a)
|
||||
{ return a.value_; }
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
#endif /* _SIGC_LAMBDA_BASE_HPP_ */
|
||||
737
libs/sigc++2/sigc++/adaptors/lambda/group.h
Normal file
737
libs/sigc++2/sigc++/adaptors/lambda/group.h
Normal file
@@ -0,0 +1,737 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#ifndef _SIGC_ADAPTORS_LAMBDA_MACROS_GROUPHM4_
|
||||
#define _SIGC_ADAPTORS_LAMBDA_MACROS_GROUPHM4_
|
||||
#include <sigc++/adaptors/lambda/base.h>
|
||||
|
||||
/** @defgroup group_ group()
|
||||
* sigc::group() alters an arbitrary functor by rebuilding its arguments from one or more lambda expressions.
|
||||
* For each parameter that should be passed to the wrapped functor one lambda expression
|
||||
* has to be passed into group(). Lambda selectors can be used as placeholders for the
|
||||
* arguments passed into the new functor. Arguments that don't have a placeholder in one
|
||||
* of the lambda expressions are dropped.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* void foo(int, int);
|
||||
* int bar(int);
|
||||
* // argument binding ...
|
||||
* sigc::group(&foo,10,sigc::_1)(20); //fixes the first argument and calls foo(10,20)
|
||||
* sigc::group(&foo,sigc::_1,30)(40); //fixes the second argument and calls foo(40,30)
|
||||
* // argument reordering ...
|
||||
* sigc::group(&foo,sigc::_2,sigc::_1)(1,2); //calls foo(2,1)
|
||||
* // argument hiding ...
|
||||
* sigc::group(&foo,sigc::_1,sigc::_2)(1,2,3); //calls foo(1,2)
|
||||
* // functor composition ...
|
||||
* sigc::group(&foo,sigc::_1,sigc::group(&bar,sigc::_2))(1,2); //calls foo(1,bar(2))
|
||||
* // algebraic expressions ...
|
||||
* sigc::group(&foo,sigc::_1*sigc::_2,sigc::_1/sigc::_2)(6,3); //calls foo(6*3,6/3)
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::group() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<void,int,int> some_signal;
|
||||
* void foo(int);
|
||||
* some_signal.connect(sigc::group(&foo,sigc::_2));
|
||||
* @endcode
|
||||
*
|
||||
* Like in sigc::bind() you can bind references to functors by passing the objects
|
||||
* through the sigc::ref() helper function.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* int some_int;
|
||||
* sigc::signal<void> some_signal;
|
||||
* void foo(int&);
|
||||
* some_signal.connect(sigc::group(&foo,sigc::ref(some_int)));
|
||||
* @endcode
|
||||
*
|
||||
* If you bind an object of a sigc::trackable derived type to a functor
|
||||
* by reference, a slot assigned to the group adaptor is cleared automatically
|
||||
* when the object goes out of scope.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct bar : public sigc::trackable {} some_bar;
|
||||
* sigc::signal<void> some_signal;
|
||||
* void foo(bar&);
|
||||
* some_signal.connect(sigc::group(&foo,sigc::ref(some_bar)));
|
||||
* // disconnected automatically if some_bar goes out of scope
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup adaptors, lambdas
|
||||
*/
|
||||
|
||||
namespace sigc {
|
||||
|
||||
template <class T_functor, class T_type1>
|
||||
struct lambda_group1 : public lambda_base
|
||||
{
|
||||
typedef typename functor_trait<T_functor>::result_type result_type;
|
||||
typedef typename lambda<T_type1>::lambda_type value1_type;
|
||||
typedef typename adaptor_trait<T_functor>::adaptor_type functor_type;
|
||||
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename functor_type::template deduce_result_type<
|
||||
typename value1_type::template deduce_result_type<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>::type
|
||||
>::type type; };
|
||||
|
||||
result_type
|
||||
operator ()() const;
|
||||
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator() (T_arg1 _A_1) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
sun_forte_workaround (T_arg1 _A_1) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
lambda_group1(typename type_trait<T_functor>::take _A_func, typename type_trait<T_type1>::take _A_1)
|
||||
: value1_(_A_1), func_(_A_func) {}
|
||||
|
||||
value1_type value1_;
|
||||
mutable functor_type func_;
|
||||
};
|
||||
|
||||
template <class T_functor, class T_type1>
|
||||
typename lambda_group1<T_functor, T_type1>::result_type
|
||||
lambda_group1<T_functor, T_type1>::operator ()() const
|
||||
{ return func_(value1_()); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_functor, class T_type1>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda_group1<T_functor, T_type1>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.value1_);
|
||||
visit_each(_A_action, _A_target.func_);
|
||||
}
|
||||
|
||||
|
||||
template <class T_functor, class T_type1,class T_type2>
|
||||
struct lambda_group2 : public lambda_base
|
||||
{
|
||||
typedef typename functor_trait<T_functor>::result_type result_type;
|
||||
typedef typename lambda<T_type1>::lambda_type value1_type;
|
||||
typedef typename lambda<T_type2>::lambda_type value2_type;
|
||||
typedef typename adaptor_trait<T_functor>::adaptor_type functor_type;
|
||||
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename functor_type::template deduce_result_type<
|
||||
typename value1_type::template deduce_result_type<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>::type,
|
||||
typename value2_type::template deduce_result_type<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>::type
|
||||
>::type type; };
|
||||
|
||||
result_type
|
||||
operator ()() const;
|
||||
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator() (T_arg1 _A_1) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
sun_forte_workaround (T_arg1 _A_1) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
lambda_group2(typename type_trait<T_functor>::take _A_func, typename type_trait<T_type1>::take _A_1,typename type_trait<T_type2>::take _A_2)
|
||||
: value1_(_A_1),value2_(_A_2), func_(_A_func) {}
|
||||
|
||||
value1_type value1_;
|
||||
value2_type value2_;
|
||||
mutable functor_type func_;
|
||||
};
|
||||
|
||||
template <class T_functor, class T_type1,class T_type2>
|
||||
typename lambda_group2<T_functor, T_type1,T_type2>::result_type
|
||||
lambda_group2<T_functor, T_type1,T_type2>::operator ()() const
|
||||
{ return func_(value1_(),value2_()); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_functor, class T_type1,class T_type2>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda_group2<T_functor, T_type1,T_type2>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.value1_);
|
||||
visit_each(_A_action, _A_target.value2_);
|
||||
visit_each(_A_action, _A_target.func_);
|
||||
}
|
||||
|
||||
|
||||
template <class T_functor, class T_type1,class T_type2,class T_type3>
|
||||
struct lambda_group3 : public lambda_base
|
||||
{
|
||||
typedef typename functor_trait<T_functor>::result_type result_type;
|
||||
typedef typename lambda<T_type1>::lambda_type value1_type;
|
||||
typedef typename lambda<T_type2>::lambda_type value2_type;
|
||||
typedef typename lambda<T_type3>::lambda_type value3_type;
|
||||
typedef typename adaptor_trait<T_functor>::adaptor_type functor_type;
|
||||
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef typename functor_type::template deduce_result_type<
|
||||
typename value1_type::template deduce_result_type<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>::type,
|
||||
typename value2_type::template deduce_result_type<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>::type,
|
||||
typename value3_type::template deduce_result_type<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>::type
|
||||
>::type type; };
|
||||
|
||||
result_type
|
||||
operator ()() const;
|
||||
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator() (T_arg1 _A_1) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
sun_forte_workaround (T_arg1 _A_1) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass>(_A_1)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
typename deduce_result_type<T_arg1,T_arg2>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>(_A_1,_A_2)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>(_A_1,_A_2,_A_3)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>(_A_1,_A_2,_A_3,_A_4)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
operator() (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
typename deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type
|
||||
sun_forte_workaround (T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename value1_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type,
|
||||
typename value2_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type,
|
||||
typename value3_type::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type>(
|
||||
this->value1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7),
|
||||
this->value2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7),
|
||||
this->value3_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<
|
||||
typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>(_A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
lambda_group3(typename type_trait<T_functor>::take _A_func, typename type_trait<T_type1>::take _A_1,typename type_trait<T_type2>::take _A_2,typename type_trait<T_type3>::take _A_3)
|
||||
: value1_(_A_1),value2_(_A_2),value3_(_A_3), func_(_A_func) {}
|
||||
|
||||
value1_type value1_;
|
||||
value2_type value2_;
|
||||
value3_type value3_;
|
||||
mutable functor_type func_;
|
||||
};
|
||||
|
||||
template <class T_functor, class T_type1,class T_type2,class T_type3>
|
||||
typename lambda_group3<T_functor, T_type1,T_type2,T_type3>::result_type
|
||||
lambda_group3<T_functor, T_type1,T_type2,T_type3>::operator ()() const
|
||||
{ return func_(value1_(),value2_(),value3_()); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_functor, class T_type1,class T_type2,class T_type3>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda_group3<T_functor, T_type1,T_type2,T_type3>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.value1_);
|
||||
visit_each(_A_action, _A_target.value2_);
|
||||
visit_each(_A_action, _A_target.value3_);
|
||||
visit_each(_A_action, _A_target.func_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class T_functor, class T_type1>
|
||||
lambda<lambda_group1<T_functor, typename unwrap_reference<T_type1>::type> >
|
||||
group(const T_functor& _A_func, T_type1 _A_1)
|
||||
{
|
||||
typedef lambda_group1<T_functor, typename unwrap_reference<T_type1>::type> T_lambda;
|
||||
return lambda<T_lambda>(T_lambda(_A_func, _A_1));
|
||||
}
|
||||
|
||||
template <class T_functor, class T_type1,class T_type2>
|
||||
lambda<lambda_group2<T_functor, typename unwrap_reference<T_type1>::type,typename unwrap_reference<T_type2>::type> >
|
||||
group(const T_functor& _A_func, T_type1 _A_1,T_type2 _A_2)
|
||||
{
|
||||
typedef lambda_group2<T_functor, typename unwrap_reference<T_type1>::type,typename unwrap_reference<T_type2>::type> T_lambda;
|
||||
return lambda<T_lambda>(T_lambda(_A_func, _A_1,_A_2));
|
||||
}
|
||||
|
||||
template <class T_functor, class T_type1,class T_type2,class T_type3>
|
||||
lambda<lambda_group3<T_functor, typename unwrap_reference<T_type1>::type,typename unwrap_reference<T_type2>::type,typename unwrap_reference<T_type3>::type> >
|
||||
group(const T_functor& _A_func, T_type1 _A_1,T_type2 _A_2,T_type3 _A_3)
|
||||
{
|
||||
typedef lambda_group3<T_functor, typename unwrap_reference<T_type1>::type,typename unwrap_reference<T_type2>::type,typename unwrap_reference<T_type3>::type> T_lambda;
|
||||
return lambda<T_lambda>(T_lambda(_A_func, _A_1,_A_2,_A_3));
|
||||
}
|
||||
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_ADAPTORS_LAMBDA_MACROS_GROUPHM4_ */
|
||||
15
libs/sigc++2/sigc++/adaptors/lambda/lambda.cc
Normal file
15
libs/sigc++2/sigc++/adaptors/lambda/lambda.cc
Normal file
@@ -0,0 +1,15 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#include <sigc++/adaptors/lambda/select.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
const lambda<internal::lambda_select1> _1;
|
||||
const lambda<internal::lambda_select2> _2;
|
||||
const lambda<internal::lambda_select3> _3;
|
||||
const lambda<internal::lambda_select4> _4;
|
||||
const lambda<internal::lambda_select5> _5;
|
||||
const lambda<internal::lambda_select6> _6;
|
||||
const lambda<internal::lambda_select7> _7;
|
||||
|
||||
} /* namespace sigc */
|
||||
28
libs/sigc++2/sigc++/adaptors/lambda/lambda.h
Normal file
28
libs/sigc++2/sigc++/adaptors/lambda/lambda.h
Normal file
@@ -0,0 +1,28 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_LAMBDA_HPP_
|
||||
#define _SIGC_LAMBDA_HPP_
|
||||
|
||||
#include <sigc++/adaptors/lambda/base.h>
|
||||
#include <sigc++/adaptors/lambda/select.h>
|
||||
#include <sigc++/adaptors/lambda/operator.h>
|
||||
#include <sigc++/adaptors/lambda/group.h>
|
||||
|
||||
#endif /* _SIGC_LAMBDA_HPP_ */
|
||||
317
libs/sigc++2/sigc++/adaptors/lambda/macros/base.h.m4
Normal file
317
libs/sigc++2/sigc++/adaptors/lambda/macros/base.h.m4
Normal file
@@ -0,0 +1,317 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
include(template.macros.m4)
|
||||
|
||||
define([LAMBDA_DO],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
operator ()(LOOP(T_arg%1 _A_%1, $1)) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
|
||||
{ return value_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1));
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
])dnl
|
||||
define([LAMBDA_DO_VALUE],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
result_type operator ()(LOOP(T_arg%1, $1)) const
|
||||
{ return value_; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
result_type sun_forte_workaround(LOOP(T_arg%1, $1)) const
|
||||
{ return value_; }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
])dnl
|
||||
|
||||
divert(0)dnl
|
||||
#ifndef _SIGC_LAMBDA_BASE_HPP_
|
||||
#define _SIGC_LAMBDA_BASE_HPP_
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/reference_wrapper.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup lambdas Lambdas
|
||||
* libsigc++ ships with basic lambda functionality and the sigc::group adaptor that uses lambdas to transform a functor's parameter list.
|
||||
*
|
||||
* The lambda selectors sigc::_1, sigc::_2, ..., sigc::_9 are used to select the
|
||||
* first, second, ..., nineth argument from a list.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* std::cout << sigc::_1(10,20,30); // returns 10
|
||||
* std::cout << sigc::_2(10,20,30); // returns 20
|
||||
* ...
|
||||
* @endcode
|
||||
*
|
||||
* Operators are defined so that lambda selectors can be used e.g. as placeholders in
|
||||
* arithmetic expressions.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* std::cout << (sigc::_1 + 5)(3); // returns (3 + 5)
|
||||
* std::cout << (sigc::_1 * sigc::_2)(7,10); // returns (7 * 10)
|
||||
* @endcode
|
||||
*/
|
||||
|
||||
/** A hint to the compiler.
|
||||
* All lambda types publically inherit from this hint.
|
||||
*
|
||||
* @ingroup lambdas
|
||||
*/
|
||||
struct lambda_base : public adaptor_base {};
|
||||
|
||||
// Forward declaration of lambda.
|
||||
template <class T_type> struct lambda;
|
||||
|
||||
|
||||
namespace internal {
|
||||
|
||||
/** Abstracts lambda functionality.
|
||||
* Objects of this type store a value that may be of type lambda itself.
|
||||
* In this case, operator()() executes the lambda (a lambda is always a functor at the same time).
|
||||
* Otherwise, operator()() simply returns the stored value.
|
||||
*/
|
||||
template <class T_type, bool I_islambda = is_base_and_derived<lambda_base, T_type>::value> struct lambda_core;
|
||||
|
||||
/// Abstracts lambda functionality (template specialization for lambda values).
|
||||
template <class T_type>
|
||||
struct lambda_core<T_type, true> : public lambda_base
|
||||
{
|
||||
template <LOOP(class T_arg%1=void,CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename T_type::template deduce_result_type<LOOP(_P_(T_arg%1),CALL_SIZE)>::type type; };
|
||||
typedef typename T_type::result_type result_type;
|
||||
typedef T_type lambda_type;
|
||||
|
||||
result_type
|
||||
operator()() const;
|
||||
|
||||
FOR(1,CALL_SIZE,[[LAMBDA_DO(%1)]])dnl
|
||||
lambda_core() {}
|
||||
|
||||
explicit lambda_core(const T_type& v)
|
||||
: value_(v) {}
|
||||
|
||||
T_type value_;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
typename lambda_core<T_type, true>::result_type
|
||||
lambda_core<T_type, true>::operator()() const
|
||||
{ return value_(); }
|
||||
|
||||
|
||||
/// Abstracts lambda functionality (template specialization for other value types).
|
||||
template <class T_type>
|
||||
struct lambda_core<T_type, false> : public lambda_base
|
||||
{
|
||||
template <LOOP(class T_arg%1=void,CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef T_type type; };
|
||||
typedef T_type result_type; // all operator() overloads return T_type.
|
||||
typedef lambda<T_type> lambda_type;
|
||||
|
||||
result_type operator()() const;
|
||||
|
||||
FOR(1,CALL_SIZE,[[LAMBDA_DO_VALUE(%1)]])dnl
|
||||
explicit lambda_core(typename type_trait<T_type>::take v)
|
||||
: value_(v) {}
|
||||
|
||||
T_type value_;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
typename lambda_core<T_type, false>::result_type lambda_core<T_type, false>::operator()() const
|
||||
{ return value_; }
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_functor, bool I_islambda>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const internal::lambda_core<T_functor, I_islambda>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.value_);
|
||||
}
|
||||
|
||||
|
||||
// forward declarations for lambda operators other<subscript> and other<assign>
|
||||
template <class T_type>
|
||||
struct other;
|
||||
struct subscript;
|
||||
struct assign;
|
||||
|
||||
template <class T_action, class T_type1, class T_type2>
|
||||
struct lambda_operator;
|
||||
|
||||
template <class T_type>
|
||||
struct unwrap_lambda_type;
|
||||
|
||||
|
||||
/** Lambda type.
|
||||
* Objects of this type store a value that may be of type lambda itself.
|
||||
* In this case, operator()() executes the lambda (a lambda is always a functor at the same time).
|
||||
* Otherwise, operator()() simply returns the stored value.
|
||||
* The assign and subscript operators are defined to return a lambda operator.
|
||||
*
|
||||
* @ingroup lambdas
|
||||
*/
|
||||
template <class T_type>
|
||||
struct lambda : public internal::lambda_core<T_type>
|
||||
{
|
||||
typedef lambda<T_type> self;
|
||||
|
||||
lambda()
|
||||
{}
|
||||
|
||||
lambda(typename type_trait<T_type>::take v)
|
||||
: internal::lambda_core<T_type>(v)
|
||||
{}
|
||||
|
||||
// operators for other<subscript>
|
||||
template <class T_arg>
|
||||
lambda<lambda_operator<other<subscript>, self, typename unwrap_lambda_type<T_arg>::type> >
|
||||
operator [[]] (const T_arg& a) const
|
||||
{ typedef lambda_operator<other<subscript>, self, typename unwrap_lambda_type<T_arg>::type> lambda_operator_type;
|
||||
return lambda<lambda_operator_type>(lambda_operator_type(this->value_, unwrap_lambda_value(a))); }
|
||||
|
||||
// operators for other<assign>
|
||||
template <class T_arg>
|
||||
lambda<lambda_operator<other<assign>, self, typename unwrap_lambda_type<T_arg>::type> >
|
||||
operator = (const T_arg& a) const
|
||||
{ typedef lambda_operator<other<assign>, self, typename unwrap_lambda_type<T_arg>::type> lambda_operator_type;
|
||||
return lambda<lambda_operator_type>(lambda_operator_type(this->value_, unwrap_lambda_value(a))); }
|
||||
};
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_type>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda<T_type>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.value_);
|
||||
}
|
||||
|
||||
dnl /* With the Sun FORTE and the Compaq C++ compiler,
|
||||
dnl * sigc::var() doesn't work with string constants.
|
||||
dnl * Some work-araound is needed to convert 'const (&) char[N]'
|
||||
dnl * into 'const char*'. The following work-around works with gcc
|
||||
dnl * but neither with the Sun FORTE nor with the Compaq C++ compiler
|
||||
dnl * (for the gcc the work-around is not needed, anyway):
|
||||
dnl */
|
||||
dnl namespace internal {
|
||||
dnl
|
||||
dnl template <class T_type>
|
||||
dnl struct convert_array
|
||||
dnl { typedef T_type& type; };
|
||||
dnl
|
||||
dnl template <class T_type, int N>
|
||||
dnl struct convert_array<T_type[[N]]>
|
||||
dnl { typedef T_type* type; };
|
||||
dnl
|
||||
dnl } /* namespace internal */
|
||||
dnl
|
||||
dnl /// Converts a constant variable into a lambda object.
|
||||
dnl template <class T_type>
|
||||
dnl lambda<T_type> constant(const T_type& v)
|
||||
dnl { return lambda<T_type>(v); }
|
||||
dnl
|
||||
dnl /// Converts a reference into a lambda object.
|
||||
dnl template <class T_type>
|
||||
dnl lambda<typename internal::convert_array<T_type>::type> var(T_type& v)
|
||||
dnl { return lambda<typename internal::convert_array<T_type>::type>(v); }
|
||||
dnl
|
||||
dnl /// Converts a constant reference into a lambda object.
|
||||
dnl template <class T_type>
|
||||
dnl lambda<typename internal::convert_array<const T_type>::type> var(const T_type& v)
|
||||
dnl { return lambda<typename internal::convert_array<const T_type>::type>(v); }
|
||||
|
||||
/** Converts a reference into a lambda object.
|
||||
* sigc::var creates a 0-ary functor, returning the value of a referenced variable.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* int main(int argc, char* argv[])
|
||||
* {
|
||||
* int data;
|
||||
* sigc::signal<int> readValue;
|
||||
*
|
||||
* readValue.connect(sigc::var(data));
|
||||
*
|
||||
* data = 3;
|
||||
* std::cout << readValue() << std::endl; //Prints 3.
|
||||
*
|
||||
* data = 5;
|
||||
* std::cout << readValue() << std::endl; //Prints 5.
|
||||
* }
|
||||
* @endcode
|
||||
*/
|
||||
template <class T_type>
|
||||
lambda<T_type&> var(T_type& v)
|
||||
{ return lambda<T_type&>(v); }
|
||||
|
||||
/** Converts a constant reference into a lambda object.
|
||||
*/
|
||||
template <class T_type>
|
||||
lambda<const T_type&> var(const T_type& v)
|
||||
{ return lambda<const T_type&>(v); }
|
||||
|
||||
|
||||
/** Deduces the type of the object stored in an object of the passed lambda type.
|
||||
* If the type passed as template argument is no lambda type,
|
||||
* type is defined to unwrap_reference<T_type>::type.
|
||||
*/
|
||||
template <class T_type>
|
||||
struct unwrap_lambda_type
|
||||
{ typedef typename unwrap_reference<T_type>::type type; };
|
||||
|
||||
template <class T_type>
|
||||
struct unwrap_lambda_type<lambda<T_type> >
|
||||
{ typedef T_type type; };
|
||||
|
||||
|
||||
/** Gets the object stored inside a lambda object.
|
||||
* Returns the object passed as argument if it is not of type lambda.
|
||||
*/
|
||||
template <class T_type>
|
||||
T_type& unwrap_lambda_value(T_type& a)
|
||||
{ return a; }
|
||||
|
||||
template <class T_type>
|
||||
const T_type& unwrap_lambda_value(const T_type& a)
|
||||
{ return a; }
|
||||
|
||||
template <class T_type>
|
||||
const T_type& unwrap_lambda_value(const lambda<T_type>& a)
|
||||
{ return a.value_; }
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
#endif /* _SIGC_LAMBDA_BASE_HPP_ */
|
||||
176
libs/sigc++2/sigc++/adaptors/lambda/macros/group.h.m4
Normal file
176
libs/sigc++2/sigc++/adaptors/lambda/macros/group.h.m4
Normal file
@@ -0,0 +1,176 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
include(template.macros.m4)
|
||||
|
||||
dnl
|
||||
dnl How to call the darn thing!
|
||||
define([LAMBDA_GROUP_FACTORY],[dnl
|
||||
template <class T_functor, LOOP(class T_type%1, $1)>
|
||||
lambda<lambda_group$1<T_functor, LOOP(typename unwrap_reference<T_type%1>::type, $1)> >
|
||||
group(const T_functor& _A_func, LOOP(T_type%1 _A_%1, $1))
|
||||
{
|
||||
typedef lambda_group$1<T_functor, LOOP(typename unwrap_reference<T_type%1>::type, $1)> T_lambda;
|
||||
return lambda<T_lambda>(T_lambda(_A_func, LOOP(_A_%1, $1)));
|
||||
}
|
||||
|
||||
])
|
||||
dnl
|
||||
dnl How to call the darn thing!
|
||||
define([LAMBDA_GROUP_DO],[dnl
|
||||
define([_L_],[LOOP(_A_%1, $2)])dnl
|
||||
define([_T_],[LOOP(T_arg%1, $2)])dnl
|
||||
dnl Please someone get a gun!
|
||||
template <LOOP(class T_arg%1, $2)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$2)>::type
|
||||
operator() (LOOP(T_arg%1 _A_%1, $2)) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP([
|
||||
typename value%1_type::template deduce_result_type<LOOP(T_arg%1,$2)>::type],$1)>(LOOP([
|
||||
this->value%1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP([
|
||||
_P_(T_arg%1)],$2)>(_L_)],$1)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $2)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$2)>::type
|
||||
sun_forte_workaround (LOOP(T_arg%1 _A_%1, $2)) const
|
||||
{ return this->func_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP([
|
||||
typename value%1_type::template deduce_result_type<LOOP(T_arg%1,$2)>::type],$1)>(LOOP([
|
||||
this->value%1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP([
|
||||
_P_(T_arg%1)],$2)>(_L_)],$1)); }
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
])
|
||||
dnl
|
||||
dnl This really doesn't have much to do with lambda other than
|
||||
dnl holding lambdas with in itself.
|
||||
define([LAMBDA_GROUP],[dnl
|
||||
template <class T_functor, LOOP(class T_type%1, $1)>
|
||||
struct lambda_group$1 : public lambda_base
|
||||
{
|
||||
typedef typename functor_trait<T_functor>::result_type result_type;dnl
|
||||
FOR(1, $1,[
|
||||
typedef typename lambda<T_type%1>::lambda_type value%1_type;])
|
||||
typedef typename adaptor_trait<T_functor>::adaptor_type functor_type;
|
||||
|
||||
template <LOOP(class T_arg%1=void,$2)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename functor_type::template deduce_result_type<LOOP([
|
||||
typename value%1_type::template deduce_result_type<LOOP([
|
||||
_P_(T_arg%1)],$2)>::type],$1)
|
||||
>::type type; };
|
||||
|
||||
result_type
|
||||
operator ()() const;
|
||||
|
||||
FOR(1,CALL_SIZE,[[LAMBDA_GROUP_DO($1,%1)]])dnl
|
||||
lambda_group$1(typename type_trait<T_functor>::take _A_func, LOOP(typename type_trait<T_type%1>::take _A_%1, $1))
|
||||
: LOOP(value%1_(_A_%1), $1), func_(_A_func) {}dnl
|
||||
|
||||
FOR(1, $1,[
|
||||
value%1_type value%1_;])
|
||||
mutable functor_type func_;
|
||||
};
|
||||
|
||||
template <class T_functor, LOOP(class T_type%1, $1)>
|
||||
typename lambda_group$1<T_functor, LOOP(T_type%1, $1)>::result_type
|
||||
lambda_group$1<T_functor, LOOP(T_type%1, $1)>::operator ()() const
|
||||
{ return func_(LOOP(value%1_(), $1)); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_functor, LOOP(class T_type%1, $1)>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda_group$1<T_functor, LOOP(T_type%1, $1)>& _A_target)
|
||||
{dnl
|
||||
FOR(1, $1,[
|
||||
visit_each(_A_action, _A_target.value%1_);])
|
||||
visit_each(_A_action, _A_target.func_);
|
||||
}
|
||||
|
||||
|
||||
])
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/lambda/base.h>
|
||||
|
||||
/** @defgroup group_ group()
|
||||
* sigc::group() alters an arbitrary functor by rebuilding its arguments from one or more lambda expressions.
|
||||
* For each parameter that should be passed to the wrapped functor one lambda expression
|
||||
* has to be passed into group(). Lambda selectors can be used as placeholders for the
|
||||
* arguments passed into the new functor. Arguments that don't have a placeholder in one
|
||||
* of the lambda expressions are dropped.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* void foo(int, int);
|
||||
* int bar(int);
|
||||
* // argument binding ...
|
||||
* sigc::group(&foo,10,sigc::_1)(20); //fixes the first argument and calls foo(10,20)
|
||||
* sigc::group(&foo,sigc::_1,30)(40); //fixes the second argument and calls foo(40,30)
|
||||
* // argument reordering ...
|
||||
* sigc::group(&foo,sigc::_2,sigc::_1)(1,2); //calls foo(2,1)
|
||||
* // argument hiding ...
|
||||
* sigc::group(&foo,sigc::_1,sigc::_2)(1,2,3); //calls foo(1,2)
|
||||
* // functor composition ...
|
||||
* sigc::group(&foo,sigc::_1,sigc::group(&bar,sigc::_2))(1,2); //calls foo(1,bar(2))
|
||||
* // algebraic expressions ...
|
||||
* sigc::group(&foo,sigc::_1*sigc::_2,sigc::_1/sigc::_2)(6,3); //calls foo(6*3,6/3)
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::group() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<void,int,int> some_signal;
|
||||
* void foo(int);
|
||||
* some_signal.connect(sigc::group(&foo,sigc::_2));
|
||||
* @endcode
|
||||
*
|
||||
* Like in sigc::bind() you can bind references to functors by passing the objects
|
||||
* through the sigc::ref() helper function.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* int some_int;
|
||||
* sigc::signal<void> some_signal;
|
||||
* void foo(int&);
|
||||
* some_signal.connect(sigc::group(&foo,sigc::ref(some_int)));
|
||||
* @endcode
|
||||
*
|
||||
* If you bind an object of a sigc::trackable derived type to a functor
|
||||
* by reference, a slot assigned to the group adaptor is cleared automatically
|
||||
* when the object goes out of scope.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct bar : public sigc::trackable {} some_bar;
|
||||
* sigc::signal<void> some_signal;
|
||||
* void foo(bar&);
|
||||
* some_signal.connect(sigc::group(&foo,sigc::ref(some_bar)));
|
||||
* // disconnected automatically if some_bar goes out of scope
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup adaptors, lambdas
|
||||
*/
|
||||
|
||||
namespace sigc {
|
||||
|
||||
FOR(1,3,[[LAMBDA_GROUP(%1, CALL_SIZE)]])
|
||||
FOR(1,3,[[LAMBDA_GROUP_FACTORY(%1)]])
|
||||
|
||||
} /* namespace sigc */
|
||||
26
libs/sigc++2/sigc++/adaptors/lambda/macros/lambda.cc.m4
Normal file
26
libs/sigc++2/sigc++/adaptors/lambda/macros/lambda.cc.m4
Normal file
@@ -0,0 +1,26 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
include(template.macros.m4)
|
||||
divert(0)dnl
|
||||
#include <sigc++/adaptors/lambda/select.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
FOR(1,CALL_SIZE,[[const lambda<internal::lambda_select%1> _%1;
|
||||
]])
|
||||
} /* namespace sigc */
|
||||
523
libs/sigc++2/sigc++/adaptors/lambda/macros/operator.h.m4
Normal file
523
libs/sigc++2/sigc++/adaptors/lambda/macros/operator.h.m4
Normal file
@@ -0,0 +1,523 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
include(template.macros.m4)
|
||||
|
||||
dnl
|
||||
dnl Macros to make operators
|
||||
define([LAMBDA_OPERATOR_DO],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
operator ()(LOOP(T_arg%1 _A_%1, $1)) const
|
||||
{
|
||||
return lambda_action<T_action>::template do_action<
|
||||
typename deduce_result_type<LOOP(_P_(T_arg%1),$1)>::left_type,
|
||||
typename deduce_result_type<LOOP(_P_(T_arg%1),$1)>::right_type>
|
||||
(arg1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1)),
|
||||
arg2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1)));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
|
||||
{
|
||||
return lambda_action<T_action>::template do_action<
|
||||
typename deduce_result_type<LOOP(_P_(T_arg%1),$1)>::left_type,
|
||||
typename deduce_result_type<LOOP(_P_(T_arg%1),$1)>::right_type>
|
||||
(arg1_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1)),
|
||||
arg2_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1)));
|
||||
}
|
||||
#endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
|
||||
])dnl
|
||||
define([LAMBDA_OPERATOR_UNARY_DO],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
operator ()(LOOP(T_arg%1 _A_%1, $1)) const
|
||||
{
|
||||
return lambda_action_unary<T_action>::template do_action<
|
||||
typename deduce_result_type<LOOP(_P_(T_arg%1),$1)>::operand_type>
|
||||
(arg_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1)));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
|
||||
{
|
||||
return lambda_action_unary<T_action>::template do_action<
|
||||
typename deduce_result_type<LOOP(_P_(T_arg%1),$1)>::operand_type>
|
||||
(arg_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1)));
|
||||
}
|
||||
#endif
|
||||
|
||||
])dnl
|
||||
define([LAMBDA_OPERATOR_CONVERT_DO],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
operator ()(LOOP(T_arg%1 _A_%1, $1)) const
|
||||
{
|
||||
return lambda_action_convert<T_action, T_type>::template do_action<
|
||||
typename deduce_result_type<LOOP(_P_(T_arg%1),$1)>::operand_type>
|
||||
(arg_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1)));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
|
||||
{
|
||||
return lambda_action_convert<T_action, T_type>::template do_action<
|
||||
typename deduce_result_type<LOOP(_P_(T_arg%1),$1)>::operand_type>
|
||||
(arg_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_%1, $1)));
|
||||
}
|
||||
#endif
|
||||
|
||||
])dnl
|
||||
define([LAMBDA_OPERATOR],[dnl
|
||||
divert(1)dnl
|
||||
template <>
|
||||
struct lambda_action<$1 >
|
||||
{
|
||||
template <class T_arg1, class T_arg2>
|
||||
static typename lambda_action_deduce_result_type<$1, T_arg1, T_arg2>::type
|
||||
do_action(T_arg1 _A_1, T_arg2 _A_2)
|
||||
{ return _A_1 $2 _A_2; }
|
||||
};
|
||||
|
||||
divert(2)dnl
|
||||
// Operators for lambda action $1. At least one of the arguments needs to be of type lamdba, hence the overloads.
|
||||
template <class T_arg1, class T_arg2>
|
||||
lambda<lambda_operator<$1, T_arg1, T_arg2> >
|
||||
operator $2 (const lambda<T_arg1>& a1, const lambda<T_arg2>& a2)
|
||||
{ typedef lambda_operator<$1, T_arg1, T_arg2> operator_type;
|
||||
return lambda<operator_type>(operator_type(a1.value_,a2.value_)); }
|
||||
template <class T_arg1, class T_arg2>
|
||||
lambda<lambda_operator<$1, T_arg1, typename unwrap_reference<T_arg2>::type> >
|
||||
operator $2 (const lambda<T_arg1>& a1, const T_arg2& a2)
|
||||
{ typedef lambda_operator<$1, T_arg1, typename unwrap_reference<T_arg2>::type> operator_type;
|
||||
return lambda<operator_type>(operator_type(a1.value_,a2)); }
|
||||
template <class T_arg1, class T_arg2>
|
||||
lambda<lambda_operator<$1, typename unwrap_reference<T_arg1>::type, T_arg2> >
|
||||
operator $2 (const T_arg1& a1, const lambda<T_arg2>& a2)
|
||||
{ typedef lambda_operator<$1, typename unwrap_reference<T_arg1>::type, T_arg2> operator_type;
|
||||
return lambda<operator_type>(operator_type(a1,a2.value_)); }
|
||||
|
||||
divert(0)dnl
|
||||
])
|
||||
define([LAMBDA_OPERATOR_UNARY],[dnl
|
||||
divert(1)dnl
|
||||
template <>
|
||||
struct lambda_action_unary<$1 >
|
||||
{
|
||||
template <class T_arg>
|
||||
static typename lambda_action_unary_deduce_result_type<$1, T_arg>::type
|
||||
do_action(T_arg _Aa)
|
||||
{ return $2[]_Aa; }
|
||||
};
|
||||
|
||||
divert(2)dnl
|
||||
// Operator for lambda action $1.
|
||||
template <class T_arg>
|
||||
lambda<lambda_operator_unary<$1, T_arg> >
|
||||
operator $2 (const lambda<T_arg>& a)
|
||||
{ typedef lambda_operator_unary<$1, T_arg> operator_type;
|
||||
return lambda<operator_type>(operator_type(a.value_)); }
|
||||
|
||||
divert(0)dnl
|
||||
])
|
||||
define([LAMBDA_OPERATOR_CONVERT],[dnl
|
||||
divert(1)dnl
|
||||
template <class T_type>
|
||||
struct lambda_action_convert<$1, T_type>
|
||||
{
|
||||
template <class T_arg>
|
||||
static typename lambda_action_convert_deduce_result_type<$1, T_type, T_arg>::type
|
||||
do_action(T_arg _Aa)
|
||||
{ return $2<T_type>(_Aa); }
|
||||
};
|
||||
|
||||
divert(2)dnl
|
||||
// Creators for lambda action $1.
|
||||
template <class T_type, class T_arg>
|
||||
lambda<lambda_operator_convert<$1, T_type, typename unwrap_lambda_type<T_arg>::type> >
|
||||
$2_(const T_arg& a)
|
||||
{ typedef lambda_operator_convert<$1, T_type, typename unwrap_lambda_type<T_arg>::type> operator_type;
|
||||
return lambda<operator_type>(operator_type(unwrap_lambda_value(a))); }
|
||||
|
||||
divert(0)dnl
|
||||
])
|
||||
divert(0)dnl
|
||||
#ifndef _SIGC_LAMBDA_OPERATOR_HPP_
|
||||
#define _SIGC_LAMBDA_OPERATOR_HPP_
|
||||
#include <sigc++/adaptors/lambda/base.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** Deduces the base type of a reference or a pointer.
|
||||
* @ingroup internal
|
||||
*/
|
||||
template <class T_type>
|
||||
struct dereference_trait
|
||||
{ typedef void type; };
|
||||
|
||||
template <class T_type>
|
||||
struct dereference_trait<T_type*>
|
||||
{ typedef T_type type; };
|
||||
|
||||
template <class T_type>
|
||||
struct dereference_trait<const T_type*>
|
||||
{ typedef const T_type type; };
|
||||
|
||||
template <class T_type>
|
||||
struct dereference_trait<T_type*&>
|
||||
{ typedef T_type type; };
|
||||
|
||||
template <class T_type>
|
||||
struct dereference_trait<const T_type*&>
|
||||
{ typedef const T_type type; };
|
||||
|
||||
template <class T_type>
|
||||
struct dereference_trait<T_type* const&>
|
||||
{ typedef T_type type; };
|
||||
|
||||
template <class T_type>
|
||||
struct dereference_trait<const T_type* const&>
|
||||
{ typedef const T_type type; };
|
||||
|
||||
template <class T_type>
|
||||
struct arithmetic {};
|
||||
|
||||
template <class T_type>
|
||||
struct bitwise {};
|
||||
|
||||
template <class T_type>
|
||||
struct logical {};
|
||||
|
||||
template <class T_type>
|
||||
struct relational {};
|
||||
|
||||
template <class T_type>
|
||||
struct arithmetic_assign {};
|
||||
|
||||
template <class T_type>
|
||||
struct bitwise_assign {};
|
||||
|
||||
template <class T_type>
|
||||
struct other {};
|
||||
|
||||
template <class T_type>
|
||||
struct unary_arithmetic {};
|
||||
|
||||
template <class T_type>
|
||||
struct unary_bitwise {};
|
||||
|
||||
template <class T_type>
|
||||
struct unary_logical {};
|
||||
|
||||
template <class T_type>
|
||||
struct unary_other {};
|
||||
|
||||
template <class T_type>
|
||||
struct cast_ {};
|
||||
|
||||
struct plus {};
|
||||
struct minus {};
|
||||
struct multiplies {};
|
||||
struct divides {};
|
||||
struct modulus {};
|
||||
struct leftshift {};
|
||||
struct rightshift {};
|
||||
struct and_ {};
|
||||
struct or_ {};
|
||||
struct xor_ {};
|
||||
struct less {};
|
||||
struct greater {};
|
||||
struct less_equal {};
|
||||
struct greater_equal {};
|
||||
struct equal_to {};
|
||||
struct not_equal_to {};
|
||||
struct subscript {};
|
||||
struct assign {};
|
||||
struct pre_increment {};
|
||||
struct pre_decrement {};
|
||||
struct negate {};
|
||||
struct not_ {};
|
||||
struct address {};
|
||||
struct dereference {};
|
||||
struct reinterpret_ {};
|
||||
struct static_ {};
|
||||
struct dynamic_ {};
|
||||
|
||||
template <class T_action, class T_test1, class T_test2>
|
||||
struct lambda_action_deduce_result_type
|
||||
{ typedef typename type_trait<T_test1>::type type; }; // TODO: e.g. T_test1=int, T_test2=double yields int but it should yield double !
|
||||
|
||||
template <class T_action, class T_test1, class T_test2>
|
||||
struct lambda_action_deduce_result_type<logical<T_action>, T_test1, T_test2>
|
||||
{ typedef bool type; };
|
||||
|
||||
template <class T_action, class T_test1, class T_test2>
|
||||
struct lambda_action_deduce_result_type<relational<T_action>, T_test1, T_test2>
|
||||
{ typedef bool type; };
|
||||
|
||||
template <class T_action, class T_test1, class T_test2>
|
||||
struct lambda_action_deduce_result_type<arithmetic_assign<T_action>, T_test1, T_test2>
|
||||
{ typedef T_test1 type; };
|
||||
|
||||
template <class T_action, class T_test1, class T_test2>
|
||||
struct lambda_action_deduce_result_type<bitwise_assign<T_action>, T_test1, T_test2>
|
||||
{ typedef T_test1 type; };
|
||||
|
||||
template <class T_test1, class T_test2>
|
||||
struct lambda_action_deduce_result_type<other<subscript>, T_test1, T_test2>
|
||||
{ typedef typename type_trait<typename dereference_trait<T_test1>::type>::pass type; };
|
||||
|
||||
template <class T_action, class T_test>
|
||||
struct lambda_action_unary_deduce_result_type
|
||||
{ typedef typename type_trait<T_test>::type type; };
|
||||
|
||||
template <class T_action, class T_type, class T_test>
|
||||
struct lambda_action_convert_deduce_result_type
|
||||
{ typedef typename type_trait<T_type>::type type; };
|
||||
|
||||
template <class T_action, class T_test>
|
||||
struct lambda_action_unary_deduce_result_type<unary_logical<T_action>, T_test>
|
||||
{ typedef bool type; };
|
||||
|
||||
template <class T_test>
|
||||
struct lambda_action_unary_deduce_result_type<unary_other<address>, T_test>
|
||||
{ typedef typename type_trait<T_test>::pointer type; };
|
||||
|
||||
template <class T_test>
|
||||
struct lambda_action_unary_deduce_result_type<unary_other<dereference>, T_test>
|
||||
{ typedef typename type_trait<typename dereference_trait<T_test>::type>::pass type; };
|
||||
|
||||
LAMBDA_OPERATOR(arithmetic<plus>,+)dnl
|
||||
LAMBDA_OPERATOR(arithmetic<minus>,-)dnl
|
||||
LAMBDA_OPERATOR(arithmetic<multiplies>,*)dnl
|
||||
LAMBDA_OPERATOR(arithmetic<divides>,/)dnl
|
||||
LAMBDA_OPERATOR(arithmetic<modulus>,%)dnl
|
||||
LAMBDA_OPERATOR(bitwise<leftshift>,<<)dnl
|
||||
LAMBDA_OPERATOR(bitwise<rightshift>,>>)dnl
|
||||
LAMBDA_OPERATOR(bitwise<and_>,&)dnl
|
||||
LAMBDA_OPERATOR(bitwise<or_>,|)dnl
|
||||
LAMBDA_OPERATOR(bitwise<xor_>,^)dnl
|
||||
LAMBDA_OPERATOR(logical<and_>,&&)dnl
|
||||
LAMBDA_OPERATOR(logical<or_>,||)dnl
|
||||
LAMBDA_OPERATOR(relational<less>,<)dnl
|
||||
LAMBDA_OPERATOR(relational<greater>,>)dnl
|
||||
LAMBDA_OPERATOR(relational<less_equal>,<=)dnl
|
||||
LAMBDA_OPERATOR(relational<greater_equal>,>=)dnl
|
||||
LAMBDA_OPERATOR(relational<equal_to>,==)dnl
|
||||
LAMBDA_OPERATOR(relational<not_equal_to>,!=)dnl
|
||||
LAMBDA_OPERATOR(arithmetic_assign<plus>,+=)dnl
|
||||
LAMBDA_OPERATOR(arithmetic_assign<minus>,-=)dnl
|
||||
LAMBDA_OPERATOR(arithmetic_assign<multiplies>,*=)dnl
|
||||
LAMBDA_OPERATOR(arithmetic_assign<divides>,/=)dnl
|
||||
LAMBDA_OPERATOR(arithmetic_assign<modulus>,%=)dnl
|
||||
LAMBDA_OPERATOR(bitwise_assign<leftshift>,<<=)dnl
|
||||
LAMBDA_OPERATOR(bitwise_assign<rightshift>,>>=)dnl
|
||||
LAMBDA_OPERATOR(bitwise_assign<and_>,&=)dnl
|
||||
LAMBDA_OPERATOR(bitwise_assign<or_>,|=)dnl
|
||||
LAMBDA_OPERATOR(bitwise_assign<xor_>,^=)dnl
|
||||
divert(1)dnl
|
||||
template <>
|
||||
struct lambda_action<other<subscript> >
|
||||
{
|
||||
template <class T_arg1, class T_arg2>
|
||||
static typename lambda_action_deduce_result_type<other<subscript>, T_arg1, T_arg2>::type
|
||||
do_action(T_arg1 _A_1, T_arg2 _A_2)
|
||||
{ return _A_1[[_A_2]]; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct lambda_action<other<assign> >
|
||||
{
|
||||
template <class T_arg1, class T_arg2>
|
||||
static typename lambda_action_deduce_result_type<other<assign>, T_arg1, T_arg2>::type
|
||||
do_action(T_arg1 _A_1, T_arg2 _A_2)
|
||||
{ return _A_1 = _A_2; }
|
||||
};
|
||||
|
||||
divert(0)dnl
|
||||
|
||||
LAMBDA_OPERATOR_UNARY(unary_arithmetic<pre_increment>,++)dnl
|
||||
LAMBDA_OPERATOR_UNARY(unary_arithmetic<pre_decrement>,--)dnl
|
||||
LAMBDA_OPERATOR_UNARY(unary_arithmetic<negate>,-)dnl
|
||||
LAMBDA_OPERATOR_UNARY(unary_bitwise<not_>,~)dnl
|
||||
LAMBDA_OPERATOR_UNARY(unary_logical<not_>,!)dnl
|
||||
LAMBDA_OPERATOR_UNARY(unary_other<address>,&)dnl
|
||||
LAMBDA_OPERATOR_UNARY(unary_other<dereference>,*)dnl
|
||||
LAMBDA_OPERATOR_CONVERT(cast_<reinterpret_>,reinterpret_cast)dnl
|
||||
LAMBDA_OPERATOR_CONVERT(cast_<static_>,static_cast)dnl
|
||||
LAMBDA_OPERATOR_CONVERT(cast_<dynamic_>,dynamic_cast)dnl
|
||||
|
||||
template <class T_action>
|
||||
struct lambda_action {};
|
||||
|
||||
template <class T_action>
|
||||
struct lambda_action_unary {};
|
||||
|
||||
template <class T_action, class T_type>
|
||||
struct lambda_action_convert {};
|
||||
|
||||
undivert(1)
|
||||
|
||||
template <class T_action, class T_type1, class T_type2>
|
||||
struct lambda_operator : public lambda_base
|
||||
{
|
||||
typedef typename lambda<T_type1>::lambda_type arg1_type;
|
||||
typedef typename lambda<T_type2>::lambda_type arg2_type;
|
||||
|
||||
template <LOOP(class T_arg%1=void,CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename arg1_type::template deduce_result_type<LOOP(_P_(T_arg%1),CALL_SIZE)>::type left_type;
|
||||
typedef typename arg2_type::template deduce_result_type<LOOP(_P_(T_arg%1),CALL_SIZE)>::type right_type;
|
||||
typedef typename lambda_action_deduce_result_type<T_action, left_type, right_type>::type type;
|
||||
};
|
||||
typedef typename lambda_action_deduce_result_type<
|
||||
T_action,
|
||||
typename arg1_type::result_type,
|
||||
typename arg2_type::result_type
|
||||
>::type result_type;
|
||||
|
||||
result_type
|
||||
operator ()() const;
|
||||
|
||||
FOR(1, CALL_SIZE,[[LAMBDA_OPERATOR_DO]](%1))dnl
|
||||
lambda_operator(_R_(T_type1) a1, _R_(T_type2) a2 )
|
||||
: arg1_(a1), arg2_(a2) {}
|
||||
|
||||
arg1_type arg1_;
|
||||
arg2_type arg2_;
|
||||
};
|
||||
|
||||
template <class T_action, class T_type1, class T_type2>
|
||||
typename lambda_operator<T_action, T_type1, T_type2>::result_type
|
||||
lambda_operator<T_action, T_type1, T_type2>::operator ()() const
|
||||
{ return lambda_action<T_action>::template do_action<
|
||||
typename arg1_type::result_type,
|
||||
typename arg2_type::result_type>
|
||||
(arg1_(), arg2_()); }
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_lambda_action, class T_arg1, class T_arg2>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda_operator<T_lambda_action, T_arg1, T_arg2>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.arg1_);
|
||||
visit_each(_A_action, _A_target.arg2_);
|
||||
}
|
||||
|
||||
|
||||
template <class T_action, class T_type>
|
||||
struct lambda_operator_unary : public lambda_base
|
||||
{
|
||||
typedef typename lambda<T_type>::lambda_type arg_type;
|
||||
|
||||
template <LOOP(class T_arg%1=void,CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename arg_type::template deduce_result_type<LOOP(_P_(T_arg%1),CALL_SIZE)>::type operand_type;
|
||||
typedef typename lambda_action_unary_deduce_result_type<T_action, operand_type>::type type;
|
||||
};
|
||||
typedef typename lambda_action_unary_deduce_result_type<
|
||||
T_action,
|
||||
typename arg_type::result_type
|
||||
>::type result_type;
|
||||
|
||||
result_type
|
||||
operator ()() const;
|
||||
|
||||
FOR(1, CALL_SIZE,[[LAMBDA_OPERATOR_UNARY_DO]](%1))dnl
|
||||
lambda_operator_unary(_R_(T_type) a)
|
||||
: arg_(a) {}
|
||||
|
||||
arg_type arg_;
|
||||
};
|
||||
|
||||
template <class T_action, class T_type>
|
||||
typename lambda_operator_unary<T_action, T_type>::result_type
|
||||
lambda_operator_unary<T_action, T_type>::operator ()() const
|
||||
{ return lambda_action_unary<T_action>::template do_action<
|
||||
typename arg_type::result_type>
|
||||
(arg_()); }
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_lambda_action, class T_arg>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda_operator_unary<T_lambda_action, T_arg>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.arg_);
|
||||
}
|
||||
|
||||
|
||||
template <class T_action, class T_type, class T_arg>
|
||||
struct lambda_operator_convert : public lambda_base
|
||||
{
|
||||
typedef typename lambda<T_arg>::lambda_type arg_type;
|
||||
|
||||
template <LOOP(class T_arg%1=void,CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename arg_type::template deduce_result_type<LOOP(_P_(T_arg%1),CALL_SIZE)>::type operand_type;
|
||||
typedef typename lambda_action_convert_deduce_result_type<T_action, T_type, operand_type>::type type;
|
||||
};
|
||||
typedef typename lambda_action_convert_deduce_result_type<
|
||||
T_action, T_type,
|
||||
typename arg_type::result_type
|
||||
>::type result_type;
|
||||
|
||||
result_type
|
||||
operator ()() const;
|
||||
|
||||
FOR(1, CALL_SIZE,[[LAMBDA_OPERATOR_CONVERT_DO]](%1))dnl
|
||||
lambda_operator_convert(_R_(T_arg) a)
|
||||
: arg_(a) {}
|
||||
|
||||
arg_type arg_;
|
||||
};
|
||||
|
||||
template <class T_action, class T_type, class T_arg>
|
||||
typename lambda_operator_convert<T_action, T_type, T_arg>::result_type
|
||||
lambda_operator_convert<T_action, T_type, T_arg>::operator ()() const
|
||||
{ return lambda_action_convert<T_action, T_type>::template do_action<
|
||||
typename arg_type::result_type>
|
||||
(arg_()); }
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_lambda_action, class T_type, class T_arg>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const lambda_operator_convert<T_lambda_action, T_type, T_arg>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.arg_);
|
||||
}
|
||||
|
||||
|
||||
undivert(2)dnl
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
#endif /* _SIGC_LAMBDA_OPERATOR_HPP_ */
|
||||
64
libs/sigc++2/sigc++/adaptors/lambda/macros/select.h.m4
Normal file
64
libs/sigc++2/sigc++/adaptors/lambda/macros/select.h.m4
Normal file
@@ -0,0 +1,64 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
include(template.macros.m4)
|
||||
|
||||
dnl
|
||||
dnl Macros to make select arguments
|
||||
define([LAMBDA_SELECT_DO],[dnl
|
||||
template <LOOP(class T_arg%1, $2)>
|
||||
dnl T_arg$1 operator ()(LOOP(T_arg%1 _A_%1, $2)) const { return _A_$1; }
|
||||
T_arg$1 operator ()(LIST(FOR(1,eval($1-1),[T_arg%1,]),T_arg$1 _A_$1,FOR(eval($1+1),$2,[T_arg%1,]))) const { return _A_$1; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $2)>
|
||||
//Does not work: T_arg$1 sun_forte_workaround(LOOP(T_arg%1 _A_%1, $2)) const { return operator()( LOOP(_A_%1, $2) ); }
|
||||
T_arg$1 sun_forte_workaround(LIST(FOR(1,eval($1-1),[T_arg%1,]),T_arg$1 _A_$1,FOR(eval($1+1),$2,[T_arg%1,]))) const { return _A_$1; }
|
||||
#endif
|
||||
|
||||
])
|
||||
define([LAMBDA_SELECT],[dnl
|
||||
struct lambda_select$1 : public lambda_base
|
||||
{
|
||||
template <LOOP(class T_arg%1=void,$2)>
|
||||
struct deduce_result_type
|
||||
{ typedef T_arg$1 type; };
|
||||
typedef void result_type; // no operator ()() overload
|
||||
|
||||
void operator ()() const; // not implemented
|
||||
FOR($1, $2,[[LAMBDA_SELECT_DO($1,%1)]])dnl
|
||||
};
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
#ifndef _SIGC_LAMBDA_SELECT_HPP_
|
||||
#define _SIGC_LAMBDA_SELECT_HPP_
|
||||
#include <sigc++/adaptors/lambda/base.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
namespace internal {
|
||||
FOR(1,CALL_SIZE,[[LAMBDA_SELECT(%1,CALL_SIZE)]])
|
||||
} /* namespace internal */
|
||||
|
||||
FOR(1,CALL_SIZE,[[extern SIGC_API const lambda<internal::lambda_select%1> _%1;
|
||||
]])
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
#endif /* _SIGC_LAMBDA_SELECT_HPP_ */
|
||||
1700
libs/sigc++2/sigc++/adaptors/lambda/operator.h
Normal file
1700
libs/sigc++2/sigc++/adaptors/lambda/operator.h
Normal file
File diff suppressed because it is too large
Load Diff
346
libs/sigc++2/sigc++/adaptors/lambda/select.h
Normal file
346
libs/sigc++2/sigc++/adaptors/lambda/select.h
Normal file
@@ -0,0 +1,346 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#ifndef _SIGC_LAMBDA_SELECT_HPP_
|
||||
#define _SIGC_LAMBDA_SELECT_HPP_
|
||||
#include <sigc++/adaptors/lambda/base.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
namespace internal {
|
||||
struct lambda_select1 : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_arg1 type; };
|
||||
typedef void result_type; // no operator ()() overload
|
||||
|
||||
void operator ()() const; // not implemented
|
||||
template <class T_arg1>
|
||||
T_arg1 operator ()(T_arg1 _A_1) const { return _A_1; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
//Does not work: T_arg1 sun_forte_workaround(T_arg1 _A_1) const { return operator()( _A_1 ); }
|
||||
T_arg1 sun_forte_workaround(T_arg1 _A_1) const { return _A_1; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
T_arg1 operator ()(T_arg1 _A_1, T_arg2) const { return _A_1; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
//Does not work: T_arg1 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2) const { return operator()( _A_1,_A_2 ); }
|
||||
T_arg1 sun_forte_workaround(T_arg1 _A_1, T_arg2) const { return _A_1; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
T_arg1 operator ()(T_arg1 _A_1, T_arg2, T_arg3) const { return _A_1; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
//Does not work: T_arg1 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const { return operator()( _A_1,_A_2,_A_3 ); }
|
||||
T_arg1 sun_forte_workaround(T_arg1 _A_1, T_arg2, T_arg3) const { return _A_1; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
T_arg1 operator ()(T_arg1 _A_1, T_arg2, T_arg3, T_arg4) const { return _A_1; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
//Does not work: T_arg1 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const { return operator()( _A_1,_A_2,_A_3,_A_4 ); }
|
||||
T_arg1 sun_forte_workaround(T_arg1 _A_1, T_arg2, T_arg3, T_arg4) const { return _A_1; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
T_arg1 operator ()(T_arg1 _A_1, T_arg2, T_arg3, T_arg4, T_arg5) const { return _A_1; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
//Does not work: T_arg1 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5 ); }
|
||||
T_arg1 sun_forte_workaround(T_arg1 _A_1, T_arg2, T_arg3, T_arg4, T_arg5) const { return _A_1; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
T_arg1 operator ()(T_arg1 _A_1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6) const { return _A_1; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
//Does not work: T_arg1 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6 ); }
|
||||
T_arg1 sun_forte_workaround(T_arg1 _A_1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6) const { return _A_1; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
T_arg1 operator ()(T_arg1 _A_1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7) const { return _A_1; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
//Does not work: T_arg1 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7 ); }
|
||||
T_arg1 sun_forte_workaround(T_arg1 _A_1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7) const { return _A_1; }
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
struct lambda_select2 : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_arg2 type; };
|
||||
typedef void result_type; // no operator ()() overload
|
||||
|
||||
void operator ()() const; // not implemented
|
||||
template <class T_arg1,class T_arg2>
|
||||
T_arg2 operator ()(T_arg1, T_arg2 _A_2) const { return _A_2; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
//Does not work: T_arg2 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2) const { return operator()( _A_1,_A_2 ); }
|
||||
T_arg2 sun_forte_workaround(T_arg1, T_arg2 _A_2) const { return _A_2; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
T_arg2 operator ()(T_arg1, T_arg2 _A_2, T_arg3) const { return _A_2; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
//Does not work: T_arg2 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const { return operator()( _A_1,_A_2,_A_3 ); }
|
||||
T_arg2 sun_forte_workaround(T_arg1, T_arg2 _A_2, T_arg3) const { return _A_2; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
T_arg2 operator ()(T_arg1, T_arg2 _A_2, T_arg3, T_arg4) const { return _A_2; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
//Does not work: T_arg2 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const { return operator()( _A_1,_A_2,_A_3,_A_4 ); }
|
||||
T_arg2 sun_forte_workaround(T_arg1, T_arg2 _A_2, T_arg3, T_arg4) const { return _A_2; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
T_arg2 operator ()(T_arg1, T_arg2 _A_2, T_arg3, T_arg4, T_arg5) const { return _A_2; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
//Does not work: T_arg2 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5 ); }
|
||||
T_arg2 sun_forte_workaround(T_arg1, T_arg2 _A_2, T_arg3, T_arg4, T_arg5) const { return _A_2; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
T_arg2 operator ()(T_arg1, T_arg2 _A_2, T_arg3, T_arg4, T_arg5, T_arg6) const { return _A_2; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
//Does not work: T_arg2 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6 ); }
|
||||
T_arg2 sun_forte_workaround(T_arg1, T_arg2 _A_2, T_arg3, T_arg4, T_arg5, T_arg6) const { return _A_2; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
T_arg2 operator ()(T_arg1, T_arg2 _A_2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7) const { return _A_2; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
//Does not work: T_arg2 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7 ); }
|
||||
T_arg2 sun_forte_workaround(T_arg1, T_arg2 _A_2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7) const { return _A_2; }
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
struct lambda_select3 : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_arg3 type; };
|
||||
typedef void result_type; // no operator ()() overload
|
||||
|
||||
void operator ()() const; // not implemented
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
T_arg3 operator ()(T_arg1, T_arg2, T_arg3 _A_3) const { return _A_3; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
//Does not work: T_arg3 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3) const { return operator()( _A_1,_A_2,_A_3 ); }
|
||||
T_arg3 sun_forte_workaround(T_arg1, T_arg2, T_arg3 _A_3) const { return _A_3; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
T_arg3 operator ()(T_arg1, T_arg2, T_arg3 _A_3, T_arg4) const { return _A_3; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
//Does not work: T_arg3 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const { return operator()( _A_1,_A_2,_A_3,_A_4 ); }
|
||||
T_arg3 sun_forte_workaround(T_arg1, T_arg2, T_arg3 _A_3, T_arg4) const { return _A_3; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
T_arg3 operator ()(T_arg1, T_arg2, T_arg3 _A_3, T_arg4, T_arg5) const { return _A_3; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
//Does not work: T_arg3 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5 ); }
|
||||
T_arg3 sun_forte_workaround(T_arg1, T_arg2, T_arg3 _A_3, T_arg4, T_arg5) const { return _A_3; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
T_arg3 operator ()(T_arg1, T_arg2, T_arg3 _A_3, T_arg4, T_arg5, T_arg6) const { return _A_3; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
//Does not work: T_arg3 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6 ); }
|
||||
T_arg3 sun_forte_workaround(T_arg1, T_arg2, T_arg3 _A_3, T_arg4, T_arg5, T_arg6) const { return _A_3; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
T_arg3 operator ()(T_arg1, T_arg2, T_arg3 _A_3, T_arg4, T_arg5, T_arg6, T_arg7) const { return _A_3; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
//Does not work: T_arg3 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7 ); }
|
||||
T_arg3 sun_forte_workaround(T_arg1, T_arg2, T_arg3 _A_3, T_arg4, T_arg5, T_arg6, T_arg7) const { return _A_3; }
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
struct lambda_select4 : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_arg4 type; };
|
||||
typedef void result_type; // no operator ()() overload
|
||||
|
||||
void operator ()() const; // not implemented
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
T_arg4 operator ()(T_arg1, T_arg2, T_arg3, T_arg4 _A_4) const { return _A_4; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
//Does not work: T_arg4 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4) const { return operator()( _A_1,_A_2,_A_3,_A_4 ); }
|
||||
T_arg4 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4 _A_4) const { return _A_4; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
T_arg4 operator ()(T_arg1, T_arg2, T_arg3, T_arg4 _A_4, T_arg5) const { return _A_4; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
//Does not work: T_arg4 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5 ); }
|
||||
T_arg4 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4 _A_4, T_arg5) const { return _A_4; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
T_arg4 operator ()(T_arg1, T_arg2, T_arg3, T_arg4 _A_4, T_arg5, T_arg6) const { return _A_4; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
//Does not work: T_arg4 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6 ); }
|
||||
T_arg4 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4 _A_4, T_arg5, T_arg6) const { return _A_4; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
T_arg4 operator ()(T_arg1, T_arg2, T_arg3, T_arg4 _A_4, T_arg5, T_arg6, T_arg7) const { return _A_4; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
//Does not work: T_arg4 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7 ); }
|
||||
T_arg4 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4 _A_4, T_arg5, T_arg6, T_arg7) const { return _A_4; }
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
struct lambda_select5 : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_arg5 type; };
|
||||
typedef void result_type; // no operator ()() overload
|
||||
|
||||
void operator ()() const; // not implemented
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
T_arg5 operator ()(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 _A_5) const { return _A_5; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
//Does not work: T_arg5 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5 ); }
|
||||
T_arg5 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 _A_5) const { return _A_5; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
T_arg5 operator ()(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 _A_5, T_arg6) const { return _A_5; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
//Does not work: T_arg5 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6 ); }
|
||||
T_arg5 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 _A_5, T_arg6) const { return _A_5; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
T_arg5 operator ()(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 _A_5, T_arg6, T_arg7) const { return _A_5; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
//Does not work: T_arg5 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7 ); }
|
||||
T_arg5 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 _A_5, T_arg6, T_arg7) const { return _A_5; }
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
struct lambda_select6 : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_arg6 type; };
|
||||
typedef void result_type; // no operator ()() overload
|
||||
|
||||
void operator ()() const; // not implemented
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
T_arg6 operator ()(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 _A_6) const { return _A_6; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
//Does not work: T_arg6 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6 ); }
|
||||
T_arg6 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 _A_6) const { return _A_6; }
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
T_arg6 operator ()(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 _A_6, T_arg7) const { return _A_6; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
//Does not work: T_arg6 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7 ); }
|
||||
T_arg6 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 _A_6, T_arg7) const { return _A_6; }
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
struct lambda_select7 : public lambda_base
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_arg7 type; };
|
||||
typedef void result_type; // no operator ()() overload
|
||||
|
||||
void operator ()() const; // not implemented
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
T_arg7 operator ()(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 _A_7) const { return _A_7; }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
//Does not work: T_arg7 sun_forte_workaround(T_arg1 _A_1,T_arg2 _A_2,T_arg3 _A_3,T_arg4 _A_4,T_arg5 _A_5,T_arg6 _A_6,T_arg7 _A_7) const { return operator()( _A_1,_A_2,_A_3,_A_4,_A_5,_A_6,_A_7 ); }
|
||||
T_arg7 sun_forte_workaround(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 _A_7) const { return _A_7; }
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
extern SIGC_API const lambda<internal::lambda_select1> _1;
|
||||
extern SIGC_API const lambda<internal::lambda_select2> _2;
|
||||
extern SIGC_API const lambda<internal::lambda_select3> _3;
|
||||
extern SIGC_API const lambda<internal::lambda_select4> _4;
|
||||
extern SIGC_API const lambda<internal::lambda_select5> _5;
|
||||
extern SIGC_API const lambda<internal::lambda_select6> _6;
|
||||
extern SIGC_API const lambda<internal::lambda_select7> _7;
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
#endif /* _SIGC_LAMBDA_SELECT_HPP_ */
|
||||
288
libs/sigc++2/sigc++/adaptors/macros/adaptor_trait.h.m4
Normal file
288
libs/sigc++2/sigc++/adaptors/macros/adaptor_trait.h.m4
Normal file
@@ -0,0 +1,288 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
include(template.macros.m4)
|
||||
|
||||
dnl
|
||||
dnl The idea here is simple. To prevent the need to
|
||||
dnl specializing every adaptor for every type of functor
|
||||
dnl and worse non-functors like function pointers, we
|
||||
dnl will make an adaptor trait which can take ordinary
|
||||
dnl functors and make them adaptor functors for which
|
||||
dnl we will of course be able to avoid excess copies.
|
||||
dnl (in theory)
|
||||
dnl
|
||||
dnl this all depends on partial specialization to allow
|
||||
dnl us to do
|
||||
dnl functor_.template operator() <types> (args);
|
||||
dnl
|
||||
|
||||
dnl I don't understand much of the above. However, I can
|
||||
dnl see that adaptors are implemented like they are because
|
||||
dnl there is no way to extract the return type and the argument
|
||||
dnl types from a functor type. Therefore, operator() is templated.
|
||||
dnl It's instatiated in slot_call#<>::operator() where the
|
||||
dnl argument types are known. The return type is finally determined
|
||||
dnl via the callof<> template - a tricky way to detect the return
|
||||
dnl type of a functor when the argument types are known. Martin.
|
||||
|
||||
])
|
||||
define([ADAPTOR_DO],[dnl
|
||||
ifelse($1,0,[dnl
|
||||
dnl typename internal::callof_safe0<T_functor>::result_type // doesn't compile if T_functor has an overloaded operator()!
|
||||
dnl typename functor_trait<T_functor>::result_type
|
||||
dnl operator()() const
|
||||
dnl { return functor_(); }
|
||||
],[dnl
|
||||
/** Invokes the wrapped functor passing on the arguments.dnl
|
||||
FOR(1, $1,[
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.])
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <LOOP([class T_arg%1], $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1, $1)>::type
|
||||
operator()(LOOP(T_arg%1 _A_arg%1, $1)) const
|
||||
{ return functor_(LOOP(_A_arg%1, $1)); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP([class T_arg%1], $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1, $1)>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_arg%1, $1)) const
|
||||
{ //Just calling operator() tries to copy the argument:
|
||||
return functor_(LOOP(_A_arg%1, $1));
|
||||
}
|
||||
#endif
|
||||
|
||||
])dnl
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++config.h> //To get SIGC_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD
|
||||
#include <sigc++/visit_each.h>
|
||||
#include <sigc++/functors/functor_trait.h>
|
||||
#include <sigc++/functors/ptr_fun.h>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
#include <sigc++/adaptors/deduce_result_type.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
// Call either operator()<>() or sun_forte_workaround<>(),
|
||||
// depending on the compiler:
|
||||
#ifdef SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#define SIGC_WORKAROUND_OPERATOR_PARENTHESES template operator()
|
||||
#define SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#else
|
||||
#ifdef SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#define SIGC_WORKAROUND_OPERATOR_PARENTHESES operator()
|
||||
#define SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#else
|
||||
#define SIGC_WORKAROUND_OPERATOR_PARENTHESES sun_forte_workaround
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
template <class T_functor> struct adapts;
|
||||
|
||||
/** @defgroup adaptors Adaptors
|
||||
* Adaptors are functors that alter the signature of a functor's
|
||||
* operator()().
|
||||
*
|
||||
* The adaptor types libsigc++ provides
|
||||
* are created with bind(), bind_return(), hide(), hide_return(),
|
||||
* retype_return(), retype(), compose(), exception_catch() and group().
|
||||
*
|
||||
* You can easily derive your own adaptor type from sigc::adapts.
|
||||
*/
|
||||
|
||||
/** Converts an arbitrary functor into an adaptor type.
|
||||
* All adaptor tyes in libsigc++ are unnumbered and have
|
||||
* a <tt>template operator()</tt> member of every argument count
|
||||
* they support. These functions in turn invoke a stored adaptor's
|
||||
* <tt>template operator()</tt> processing the arguments and return
|
||||
* value in a characteristic manner. Explicit function template
|
||||
* instantiation is used to pass type hints thus saving copy costs.
|
||||
*
|
||||
* adaptor_functor is a glue between adaptors and arbitrary functors
|
||||
* that just passes on the arguments. You won't use this type directly.
|
||||
*
|
||||
* The template argument @e T_functor determines the type of stored
|
||||
* functor.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct adaptor_functor : public adaptor_base
|
||||
{
|
||||
template <LOOP(class T_arg%1=void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename sigc::deduce_result_type<LIST(T_functor, LOOP(T_arg%1,CALL_SIZE))>::type type; };
|
||||
typedef typename functor_trait<T_functor>::result_type result_type;
|
||||
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
result_type
|
||||
operator()() const;
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
result_type sun_forte_workaround() const
|
||||
{ return operator(); }
|
||||
#endif
|
||||
|
||||
FOR(0,CALL_SIZE,[[ADAPTOR_DO(%1)]])dnl
|
||||
/// Constructs an invalid functor.
|
||||
adaptor_functor()
|
||||
{}
|
||||
|
||||
/** Constructs an adaptor_functor object that wraps the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
*/
|
||||
explicit adaptor_functor(const T_functor& _A_functor)
|
||||
: functor_(_A_functor)
|
||||
{}
|
||||
|
||||
/** Constructs an adaptor_functor object that wraps the passed (member)
|
||||
* function pointer.
|
||||
* @param _A_type Pointer to function or class method to invoke from operator()().
|
||||
*/
|
||||
template <class T_type>
|
||||
explicit adaptor_functor(const T_type& _A_type)
|
||||
: functor_(_A_type)
|
||||
{}
|
||||
|
||||
/// Functor that is invoked from operator()().
|
||||
mutable T_functor functor_;
|
||||
};
|
||||
|
||||
template <class T_functor>
|
||||
typename adaptor_functor<T_functor>::result_type
|
||||
adaptor_functor<T_functor>::operator()() const
|
||||
{ return functor_(); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::adaptor_functor performs a functor
|
||||
* on the functor stored in the sigc::adaptor_functor object.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_action, class T_functor>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const adaptor_functor<T_functor>& _A_target)
|
||||
{
|
||||
//The extra sigc:: prefix avoids ambiguity in some strange
|
||||
//situations.
|
||||
sigc::visit_each(_A_action, _A_target.functor_);
|
||||
}
|
||||
|
||||
|
||||
/** Trait that specifies what is the adaptor version of a functor type.
|
||||
* Template specializations for sigc::adaptor_base derived functors,
|
||||
* for function pointers and for class methods are provided.
|
||||
*
|
||||
* The template argument @e T_functor is the functor type to convert.
|
||||
* @e I_isadaptor indicates whether @e T_functor inherits from sigc::adaptor_base.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_functor, bool I_isadaptor = is_base_and_derived<adaptor_base, T_functor>::value> struct adaptor_trait;
|
||||
|
||||
/** Trait that specifies what is the adaptor version of a functor type.
|
||||
* This template specialization is used for types that inherit from adaptor_base.
|
||||
* adaptor_type is equal to @p T_functor in this case.
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct adaptor_trait<T_functor, true>
|
||||
{
|
||||
typedef typename T_functor::result_type result_type;
|
||||
typedef T_functor functor_type;
|
||||
typedef T_functor adaptor_type;
|
||||
};
|
||||
|
||||
/** Trait that specifies what is the adaptor version of a functor type.
|
||||
* This template specialization is used for arbitrary functors,
|
||||
* for function pointers and for class methods are provided.
|
||||
* The latter are converted into @p pointer_functor or @p mem_functor types.
|
||||
* adaptor_type is equal to @p adaptor_functor<functor_type>.
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct adaptor_trait<T_functor, false>
|
||||
{
|
||||
typedef typename functor_trait<T_functor>::result_type result_type;
|
||||
typedef typename functor_trait<T_functor>::functor_type functor_type;
|
||||
typedef adaptor_functor<functor_type> adaptor_type;
|
||||
};
|
||||
|
||||
|
||||
/** Base type for adaptors.
|
||||
* adapts wraps adaptors, functors, function pointers and class methods.
|
||||
* It contains a single member functor which is always a sigc::adaptor_base.
|
||||
* The typedef adaptor_type defines the exact type that is used
|
||||
* to store the adaptor, functor, function pointer or class method passed
|
||||
* into the constructor. It differs from @e T_functor unless @e T_functor
|
||||
* inherits from sigc::adaptor_base.
|
||||
*
|
||||
* @par Example of a simple adaptor:
|
||||
* @code
|
||||
* template <T_functor>
|
||||
* struct my_adpator : public sigc::adapts<T_functor>
|
||||
* {
|
||||
* template <class T_arg1=void, class T_arg2=void>
|
||||
* struct deduce_result_type
|
||||
* { typedef typename sigc::deduce_result_type<T_functor, T_arg1, T_arg2>::type type; };
|
||||
* typedef typename sigc::functor_trait<T_functor>::result_type result_type;
|
||||
*
|
||||
* result_type
|
||||
* operator()() const;
|
||||
*
|
||||
* template <class T_arg1>
|
||||
* typename deduce_result_type<T_arg1>::type
|
||||
* operator()(T_arg1 _A_arg1) const;
|
||||
*
|
||||
* template <class T_arg1, class T_arg2>
|
||||
* typename deduce_result_type<T_arg1, T_arg2>::type
|
||||
* operator()(T_arg1 _A_arg1, class T_arg2) const;
|
||||
*
|
||||
* explicit adaptor_functor(const T_functor& _A_functor) // Constructs a my_functor object that wraps the passed functor.
|
||||
* : sigc::adapts<T_functor>(_A_functor) {}
|
||||
*
|
||||
* mutable T_functor functor_; // Functor that is invoked from operator()().
|
||||
* };
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct adapts : public adaptor_base
|
||||
{
|
||||
typedef typename adaptor_trait<T_functor>::result_type result_type;
|
||||
typedef typename adaptor_trait<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
/** Constructs an adaptor that wraps the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
*/
|
||||
explicit adapts(const T_functor& _A_functor)
|
||||
: functor_(_A_functor)
|
||||
{}
|
||||
|
||||
/// Adaptor that is invoked from operator()().
|
||||
mutable adaptor_type functor_;
|
||||
};
|
||||
|
||||
} /* namespace sigc */
|
||||
377
libs/sigc++2/sigc++/adaptors/macros/bind.h.m4
Normal file
377
libs/sigc++2/sigc++/adaptors/macros/bind.h.m4
Normal file
@@ -0,0 +1,377 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([DEDUCE_RESULT_TYPE_COUNT],[dnl
|
||||
template <LOOP(class T_arg%1, eval(CALL_SIZE))>
|
||||
struct deduce_result_type_internal<LIST($2, LOOP(T_arg%1,eval(CALL_SIZE)))>
|
||||
{ typedef typename adaptor_type::template deduce_result_type<LIST(LOOP(_P_(T_arg%1), eval(CALL_SIZE-$2)), LOOP(_P_(typename unwrap_reference<T_type%1>::type), $1))>::type type; };
|
||||
])
|
||||
define([BIND_OPERATOR_LOCATION],[dnl
|
||||
ifelse($2,1,,[dnl
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* bound_ is passed as the $1[]th argument.dnl
|
||||
FOR(1, eval($2-1),[
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.])
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <LOOP([class T_arg%1], eval($2-1))>
|
||||
typename deduce_result_type<LOOP(T_arg%1,eval($2-1))>::type
|
||||
operator()(LOOP(T_arg%1 _A_arg%1,eval($2-1)))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([_P_(T_arg%1)],eval($1-1)), _P_(typename unwrap_reference<T_bound>::type), FOR($1,eval($2-1),[_P_(T_arg%1),]))>
|
||||
(LIST(LOOP(_A_arg%1,eval($1-1)), bound_.invoke(), FOR($1,eval($2-1),[_A_arg%1,])));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP([class T_arg%1], eval($2-1))>
|
||||
typename deduce_result_type<LOOP(T_arg%1,eval($2-1))>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_arg%1,eval($2-1)))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([_P_(T_arg%1)],eval($1-1)), _P_(typename unwrap_reference<T_bound>::type), FOR($1,eval($2-1),[_P_(T_arg%1),]))>
|
||||
(LIST(LOOP(_A_arg%1,eval($1-1)), bound_.invoke(), FOR($1,eval($2-1),[_A_arg%1,])));
|
||||
}
|
||||
#endif
|
||||
|
||||
])dnl
|
||||
])
|
||||
define([BIND_OPERATOR_COUNT],[dnl
|
||||
/** Invokes the wrapped functor passing on the arguments.
|
||||
* The last $1 argument(s) are fixed.dnl
|
||||
FOR(1, eval($2-1),[
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.])
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <LOOP([class T_arg%1], eval($2-1))>
|
||||
typename deduce_result_type<LOOP(T_arg%1,eval($2-1))>::type
|
||||
operator()(LOOP(T_arg%1 _A_arg%1, eval($2-1)))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([_P_(T_arg%1)],eval($2-1)), LOOP(_P_(typename unwrap_reference<T_type%1>::type), $1))>
|
||||
(LIST(LOOP(_A_arg%1,eval($2-1)), LOOP(bound%1_.invoke(), $1)));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP([class T_arg%1], eval($2-1))>
|
||||
typename deduce_result_type<LOOP(T_arg%1,eval($2-1))>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_arg%1, eval($2-1)))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([_P_(T_arg%1)],eval($2-1)), LOOP(_P_(typename unwrap_reference<T_type%1>::type), $1))>
|
||||
(LIST(LOOP(_A_arg%1,eval($2-1)), LOOP(bound%1_.invoke(), $1)));
|
||||
}
|
||||
#endif
|
||||
|
||||
])
|
||||
define([BIND_FUNCTOR_LOCATION],[dnl
|
||||
/** Adaptor that binds an argument to the wrapped functor.
|
||||
* This template specialization fixes the eval($1+1)[]th argument of the wrapped functor.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_functor, class T_bound>
|
||||
struct bind_functor<$1, T_functor, T_bound, LIST(LOOP(nil, CALL_SIZE - 1))> : public adapts<T_functor>
|
||||
{
|
||||
typedef typename adapts<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
template <LOOP(class T_arg%1=void, eval(CALL_SIZE))>
|
||||
struct deduce_result_type
|
||||
{ typedef typename adaptor_type::template deduce_result_type<LIST(LOOP(_P_(T_arg%1),eval($1)), _P_(typename unwrap_reference<T_bound>::type), FOR(eval($1+1),eval(CALL_SIZE-1),[_P_(T_arg%1),]))>::type type; };
|
||||
typedef typename adaptor_type::result_type result_type;
|
||||
|
||||
/** Invokes the wrapped functor passing on the bound argument only.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
result_type
|
||||
operator()()
|
||||
{
|
||||
//Note: The AIX compiler sometimes gives linker errors if we do not define this in the class.
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<_P_(typename unwrap_reference<T_bound>::type)> (bound_.invoke());
|
||||
}
|
||||
|
||||
FOR(eval($1+1),CALL_SIZE,[[BIND_OPERATOR_LOCATION(eval($1+1),%1)]])dnl
|
||||
/** Constructs a bind_functor object that binds an argument to the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
* @param _A_bound Argument to bind to the functor.
|
||||
*/
|
||||
bind_functor(_R_(T_functor) _A_func, _R_(T_bound) _A_bound)
|
||||
: adapts<T_functor>(_A_func), bound_(_A_bound)
|
||||
{}
|
||||
|
||||
/// The argument bound to the functor.
|
||||
bound_argument<T_bound> bound_;
|
||||
};
|
||||
|
||||
])
|
||||
define([BIND_FUNCTOR_COUNT],[dnl
|
||||
/** Adaptor that binds $1 argument(s) to the wrapped functor.
|
||||
* This template specialization fixes the last $1 argument(s) of the wrapped functor.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <LIST(class T_functor, LOOP(class T_type%1, $1))>
|
||||
struct bind_functor<LIST(-1, T_functor, LIST(LOOP(T_type%1, $1), LOOP(nil, CALL_SIZE - $1)))> : public adapts<T_functor>
|
||||
{
|
||||
typedef typename adapts<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
template <LIST(int count, LOOP(class T_arg%1, eval(CALL_SIZE)))>
|
||||
struct deduce_result_type_internal
|
||||
{ typedef typename adaptor_type::template deduce_result_type<LIST(LOOP(_P_(T_arg%1), eval(CALL_SIZE-$1)), LOOP(_P_(typename unwrap_reference<T_type%1>::type), $1))>::type type; };
|
||||
FOR(eval($1+1),eval(CALL_SIZE-1),[[DEDUCE_RESULT_TYPE_COUNT($1,%1)]])dnl
|
||||
#endif /*DOXYGEN_SHOULD_SKIP_THIS*/
|
||||
|
||||
template <LOOP(class T_arg%1=void, eval(CALL_SIZE))>
|
||||
struct deduce_result_type {
|
||||
typedef typename deduce_result_type_internal<internal::count_void<LOOP(T_arg%1, eval(CALL_SIZE))>::value,
|
||||
LOOP(T_arg%1, eval(CALL_SIZE))>::type type;
|
||||
};
|
||||
typedef typename adaptor_type::result_type result_type;
|
||||
|
||||
/** Invokes the wrapped functor passing on the bound argument only.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
result_type
|
||||
operator()()
|
||||
{
|
||||
//Note: The AIX compiler sometimes gives linker errors if we do not define this in the class.
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(typename unwrap_reference<T_type%1>::type), $1)> (LOOP(bound%1_.invoke(), $1));
|
||||
}
|
||||
|
||||
FOR(2,eval(CALL_SIZE-$1+1),[[BIND_OPERATOR_COUNT($1,%1)]])dnl
|
||||
/** Constructs a bind_functor object that binds an argument to the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
* @param _A_bound Argument to bind to the functor.
|
||||
*/
|
||||
bind_functor(_R_(T_functor) _A_func, LOOP(_R_(T_type%1) _A_bound%1, $1))
|
||||
: adapts<T_functor>(_A_func), LOOP(bound%1_(_A_bound%1), $1)
|
||||
{}
|
||||
|
||||
/// The argument bound to the functor.dnl
|
||||
FOR(1,$1,[
|
||||
bound_argument<T_type%1> bound%1_;])
|
||||
};
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::bind_functor performs a functor on the
|
||||
* functor and on the object instances stored in the sigc::bind_functor object.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_action, class T_functor, LOOP(class T_type%1, $1)>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const bind_functor<-1, T_functor, LOOP(T_type%1, $1)>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.functor_);dnl
|
||||
FOR(1,$1,[
|
||||
visit_each(_A_action, _A_target.bound%1_);])
|
||||
}
|
||||
|
||||
])
|
||||
define([BIND_COUNT],[dnl
|
||||
/** Creates an adaptor of type sigc::bind_functor which fixes the last $1 argument(s) of the passed functor.
|
||||
* This function overload fixes the last $1 argument(s) of @e _A_func.
|
||||
*
|
||||
* @param _A_func Functor that should be wrapped.dnl
|
||||
FOR(1,$1,[
|
||||
* @param _A_b%1 Argument to bind to @e _A_func.])
|
||||
* @return Adaptor that executes _A_func with the bound argument on invokation.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <LIST(LOOP(class T_type%1, $1), class T_functor)>
|
||||
inline bind_functor<-1, T_functor,dnl
|
||||
FOR(1,eval($1-1),[
|
||||
T_type%1,])
|
||||
T_type$1>
|
||||
bind(const T_functor& _A_func, LOOP(T_type%1 _A_b%1, $1))
|
||||
{ return bind_functor<-1, T_functor,dnl
|
||||
FOR(1,eval($1-1),[
|
||||
T_type%1,])
|
||||
T_type$1>
|
||||
(_A_func, LOOP(_A_b%1, $1));
|
||||
}
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/adaptors/bound_argument.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
struct count_void
|
||||
{ static const int value=0; };
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
struct count_void<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,void>
|
||||
{ static const int value=1; };
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
struct count_void<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,void,void>
|
||||
{ static const int value=2; };
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
struct count_void<T_arg1,T_arg2,T_arg3,T_arg4,void,void,void>
|
||||
{ static const int value=3; };
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
struct count_void<T_arg1,T_arg2,T_arg3,void,void,void,void>
|
||||
{ static const int value=4; };
|
||||
template <class T_arg1,class T_arg2>
|
||||
struct count_void<T_arg1,T_arg2,void,void,void,void,void>
|
||||
{ static const int value=5; };
|
||||
template <class T_arg1>
|
||||
struct count_void<T_arg1,void,void,void,void,void,void>
|
||||
{ static const int value=6; };
|
||||
template <>
|
||||
struct count_void<void,void,void,void,void,void,void>
|
||||
{ static const int value=7; };
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
#endif /*DOXYGEN_SHOULD_SKIP_THIS*/
|
||||
|
||||
|
||||
/** @defgroup bind bind(), bind_return()
|
||||
* sigc::bind() alters an arbitrary functor by fixing arguments to certain values.
|
||||
* Up to CALL_SIZE arguments can be bound at a time.
|
||||
* For single argument binding overloads of sigc::bind() are provided that let you
|
||||
* specify the zero-based position of the argument to fix with the first template parameter.
|
||||
* (A value of @p -1 fixes the last argument so sigc::bind<-1>() gives the same result as sigc::bind().)
|
||||
* The types of the arguments can optionally be specified if not deduced.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* void foo(int, int, int);
|
||||
* // single argument binding ...
|
||||
* sigc::bind(&foo,1)(2,3); //fixes the last (third) argument and calls foo(2,3,1)
|
||||
* sigc::bind<-1>(&foo,1)(2,3); //same as bind(&foo,1)(2,3) (calls foo(2,3,1))
|
||||
* sigc::bind<0>(&foo,1)(2,3); //fixes the first argument and calls foo(1,2,3)
|
||||
* sigc::bind<1>(&foo,1)(2,3); //fixes the second argument and calls foo(2,1,3)
|
||||
* sigc::bind<2>(&foo,1)(2,3); //fixes the third argument and calls foo(2,3,1)
|
||||
* // multi argument binding ...
|
||||
* sigc::bind(&foo,1,2)(3); //fixes the last two arguments and calls foo(3,1,2)
|
||||
* sigc::bind(&foo,1,2,3)(); //fixes all three arguments and calls foo(1,2,3)
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::bind() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<void> some_signal;
|
||||
* void foo(int);
|
||||
* some_signal.connect(sigc::bind(&foo,1));
|
||||
* @endcode
|
||||
*
|
||||
* sigc::bind_return() alters an arbitrary functor by
|
||||
* fixing its return value to a certain value.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* void foo();
|
||||
* std::cout << sigc::bind_return(&foo, 5)(); // calls foo() and returns 5
|
||||
* @endcode
|
||||
*
|
||||
* You can bind references to functors by passing the objects through
|
||||
* the sigc::ref() helper function.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* int some_int;
|
||||
* sigc::signal<void> some_signal;
|
||||
* void foo(int&);
|
||||
* some_signal.connect(sigc::bind(&foo,sigc::ref(some_int)));
|
||||
* @endcode
|
||||
*
|
||||
* If you bind an object of a sigc::trackable derived type to a functor
|
||||
* by reference, a slot assigned to the bind adaptor is cleared automatically
|
||||
* when the object goes out of scope.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct bar : public sigc::trackable {} some_bar;
|
||||
* sigc::signal<void> some_signal;
|
||||
* void foo(bar&);
|
||||
* some_signal.connect(sigc::bind(&foo,sigc::ref(some_bar)));
|
||||
* // disconnected automatically if some_bar goes out of scope
|
||||
* @endcode
|
||||
*
|
||||
* For a more powerful version of this functionality see the lambda
|
||||
* library adaptor sigc::group() which can bind, hide and reorder
|
||||
* arguments arbitrarily. Although sigc::group() is more flexible,
|
||||
* sigc::bind() provides a means of binding parameters when then total
|
||||
* number of parameters called is variable.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
|
||||
/** Adaptor that binds an argument to the wrapped functor.
|
||||
* Use the convenience function sigc::bind() to create an instance of sigc::bind_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e I_location Zero-based position of the argument to fix (@p -1 for the last argument).
|
||||
FOR(1, CALL_SIZE,[
|
||||
* - @e T_type%1 Type of the %1st bound argument.])
|
||||
* - @e T_functor Type of the functor to wrap.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <LIST(int I_location, class T_functor, LOOP(class T_type%1=nil, CALL_SIZE))>
|
||||
struct bind_functor;
|
||||
|
||||
FOR(0,eval(CALL_SIZE-1),[[BIND_FUNCTOR_LOCATION(%1)]])dnl
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::bind_functor performs a functor on the
|
||||
* functor and on the object instances stored in the sigc::bind_functor object.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_action, int T_loc, class T_functor, class T_bound>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const bind_functor<T_loc, T_functor, T_bound>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
visit_each(_A_action, _A_target.bound_);
|
||||
}
|
||||
|
||||
FOR(1,CALL_SIZE,[[BIND_FUNCTOR_COUNT(%1)]])dnl
|
||||
|
||||
/** Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor.
|
||||
* The optional template argument @e I_location specifies the zero-based
|
||||
* position of the argument to be fixed (@p -1 stands for the last argument).
|
||||
*
|
||||
* @param _A_func Functor that should be wrapped.
|
||||
* @param _A_b1 Argument to bind to @e _A_func.
|
||||
* @return Adaptor that executes @e _A_func with the bound argument on invokation.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <int I_location, class T_bound1, class T_functor>
|
||||
inline bind_functor<I_location, T_functor, T_bound1>
|
||||
bind(const T_functor& _A_func, T_bound1 _A_b1)
|
||||
{
|
||||
return bind_functor<I_location, T_functor, T_bound1>
|
||||
(_A_func, _A_b1);
|
||||
}
|
||||
|
||||
FOR(1,CALL_SIZE,[[BIND_COUNT(%1)]])dnl
|
||||
|
||||
} /* namespace sigc */
|
||||
120
libs/sigc++2/sigc++/adaptors/macros/bind_return.h.m4
Normal file
120
libs/sigc++2/sigc++/adaptors/macros/bind_return.h.m4
Normal file
@@ -0,0 +1,120 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([BIND_RETURN_OPERATOR],[dnl
|
||||
/** Invokes the wrapped functor passing on the arguments.dnl
|
||||
FOR(1, $1),[
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.])
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline typename unwrap_reference<T_return>::type operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_a%1, $1)); return ret_value_.invoke();
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline typename unwrap_reference<T_return>::type sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_a%1, $1)); return ret_value_.invoke();
|
||||
}
|
||||
#endif
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/adaptors/bound_argument.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** Adaptor that fixes the return value of the wrapped functor.
|
||||
* Use the convenience function sigc::bind_return() to create an instance of sigc::bind_return_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_return Type of the fixed return value.
|
||||
* - @e T_functor Type of the functor to wrap.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_return, class T_functor>
|
||||
struct bind_return_functor : public adapts<T_functor>
|
||||
{
|
||||
template <LOOP(class T_arg%1=void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename unwrap_reference<T_return>::type type; };
|
||||
typedef typename unwrap_reference<T_return>::type result_type;
|
||||
|
||||
/** Invokes the wrapped functor dropping its return value.
|
||||
* @return The fixed return value.
|
||||
*/
|
||||
typename unwrap_reference<T_return>::type operator()();
|
||||
|
||||
FOR(1,CALL_SIZE,[[BIND_RETURN_OPERATOR(%1)]])dnl
|
||||
|
||||
/** Constructs a bind_return_functor object that fixes the return value to @p _A_ret_value.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
* @param _A_ret_value Value to return from operator()().
|
||||
*/
|
||||
bind_return_functor(_R_(T_functor) _A_functor, _R_(T_return) _A_ret_value)
|
||||
: adapts<T_functor>(_A_functor), ret_value_(_A_ret_value)
|
||||
{}
|
||||
|
||||
/// The fixed return value.
|
||||
bound_argument<T_return> ret_value_; // public, so that visit_each() can access it
|
||||
};
|
||||
|
||||
template <class T_return, class T_functor>
|
||||
typename unwrap_reference<T_return>::type bind_return_functor<T_return, T_functor>::operator()()
|
||||
{ this->functor_(); return ret_value_.invoke(); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::bind_return_functor performs a functor on the
|
||||
* functor and on the object instance stored in the sigc::bind_return_functor object.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_action, class T_return, class T_functor>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const bind_return_functor<T_return, T_functor>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.ret_value_);
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
}
|
||||
|
||||
|
||||
/** Creates an adaptor of type sigc::bind_return_functor which fixes the return value of the passed functor to the passed argument.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @param _A_ret_value Argument to fix the return value of @e _A_functor to.
|
||||
* @return Adaptor that executes @e _A_functor on invokation and returns @e _A_ret_value.
|
||||
*
|
||||
* @ingroup bind
|
||||
*/
|
||||
template <class T_return, class T_functor>
|
||||
inline bind_return_functor<T_return, T_functor>
|
||||
bind_return(const T_functor& _A_functor, T_return _A_ret_value)
|
||||
{ return bind_return_functor<T_return, T_functor>(_A_functor, _A_ret_value); }
|
||||
|
||||
} /* namespace sigc */
|
||||
248
libs/sigc++2/sigc++/adaptors/macros/compose.h.m4
Normal file
248
libs/sigc++2/sigc++/adaptors/macros/compose.h.m4
Normal file
@@ -0,0 +1,248 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([COMPOSE1_OPERATOR],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1, $1)>::type
|
||||
operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<LIST(T_getter, LOOP(T_arg%1,$1))>::type>
|
||||
(get_(LOOP(_A_a%1, $1)));
|
||||
}
|
||||
|
||||
])
|
||||
|
||||
define([COMPOSE2_OPERATOR],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1, $1)>::type
|
||||
operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<LIST(T_getter1, LOOP(T_arg%1,$1))>::type,
|
||||
typename sigc::deduce_result_type<LIST(T_getter2, LOOP(T_arg%1,$1))>::type>
|
||||
(get1_(LOOP(_A_a%1, $1)), get2_(LOOP(_A_a%1,$1)));
|
||||
}
|
||||
|
||||
])
|
||||
|
||||
divert(0)
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup compose compose()
|
||||
* sigc::compose() combines two or three arbitrary functors.
|
||||
* On invokation parameters are passed on to one or two getter functor(s).
|
||||
* The return value(s) are then passed on to the setter function.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* float square_root(float a) { return sqrtf(a); }
|
||||
* float sum(float a, float b) { return a+b; }
|
||||
* std::cout << sigc::compose(&square_root, &sum)(9, 16); // calls square_root(sum(3,6))
|
||||
* std::cout << sigc::compose(&sum, &square_root, &square_root)(9); // calls sum(square_root(9), square_root(9))
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::compose() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<float,float,float> some_signal;
|
||||
* some_signal.connect(sigc::compose(&square_root, &sum));
|
||||
* @endcode
|
||||
*
|
||||
* For a more powerful version of this functionality see the lambda
|
||||
* library adaptor sigc::group() which can bind, hide and reorder
|
||||
* arguments arbitrarily. Although sigc::group() is more flexible,
|
||||
* sigc::bind() provides a means of binding parameters when then total
|
||||
* number of parameters called is variable.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
|
||||
/** Adaptor that combines two functors.
|
||||
* Use the convenience function sigc::compose() to create an instance of sigc::compose1_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_setter Type of the setter functor to wrap.
|
||||
* - @e T_getter Type of the getter functor to wrap.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_setter, class T_getter>
|
||||
struct compose1_functor : public adapts<T_setter>
|
||||
{
|
||||
typedef typename adapts<T_setter>::adaptor_type adaptor_type;
|
||||
typedef T_setter setter_type;
|
||||
typedef T_getter getter_type;
|
||||
|
||||
template <LOOP(class T_arg%1 = void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename adaptor_type::template deduce_result_type<
|
||||
typename sigc::deduce_result_type<LIST(T_getter, LOOP(T_arg%1,CALL_SIZE))>::type
|
||||
>::type type; };
|
||||
typedef typename adaptor_type::result_type result_type;
|
||||
|
||||
result_type
|
||||
operator()();
|
||||
|
||||
FOR(1,CALL_SIZE, [[COMPOSE1_OPERATOR(%1)]])dnl
|
||||
|
||||
/** Constructs a compose1_functor object that combines the passed functors.
|
||||
* @param _A_setter Functor that receives the return values of the invokation of @e _A_getter1 and @e _A_getter2.
|
||||
* @param _A_getter1 Functor to invoke from operator()().
|
||||
* @param _A_getter2 Functor to invoke from operator()().
|
||||
*/
|
||||
compose1_functor(const T_setter& _A_setter, const T_getter& _A_getter)
|
||||
: adapts<T_setter>(_A_setter), get_(_A_getter)
|
||||
{}
|
||||
|
||||
getter_type get_; // public, so that visit_each() can access it
|
||||
};
|
||||
|
||||
template <class T_setter, class T_getter>
|
||||
typename compose1_functor<T_setter, T_getter>::result_type
|
||||
compose1_functor<T_setter, T_getter>::operator()()
|
||||
{ return this->functor_(get_()); }
|
||||
|
||||
/** Adaptor that combines three functors.
|
||||
* Use the convenience function sigc::compose() to create an instance of sigc::compose2_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_setter Type of the setter functor to wrap.
|
||||
* - @e T_getter1 Type of the first getter functor to wrap.
|
||||
* - @e T_getter2 Type of the second getter functor to wrap.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_setter, class T_getter1, class T_getter2>
|
||||
struct compose2_functor : public adapts<T_setter>
|
||||
{
|
||||
typedef typename adapts<T_setter>::adaptor_type adaptor_type;
|
||||
typedef T_setter setter_type;
|
||||
typedef T_getter1 getter1_type;
|
||||
typedef T_getter2 getter2_type;
|
||||
|
||||
template <LOOP(class T_arg%1=void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename adaptor_type::template deduce_result_type<
|
||||
typename sigc::deduce_result_type<LIST(T_getter1, LOOP(T_arg%1,CALL_SIZE))>::type,
|
||||
typename sigc::deduce_result_type<LIST(T_getter2, LOOP(T_arg%1,CALL_SIZE))>::type
|
||||
>::type result_type; };
|
||||
typedef typename adaptor_type::result_type result_type;
|
||||
|
||||
result_type
|
||||
operator()();
|
||||
|
||||
FOR(1,CALL_SIZE,[[COMPOSE2_OPERATOR(%1)]])dnl
|
||||
|
||||
/** Constructs a compose2_functor object that combines the passed functors.
|
||||
* @param _A_setter Functor that receives the return values of the invokation of @e _A_getter1 and @e _A_getter2.
|
||||
* @param _A_getter1 Functor to invoke from operator()().
|
||||
* @param _A_getter2 Functor to invoke from operator()().
|
||||
*/
|
||||
compose2_functor(const T_setter& _A_setter,
|
||||
const T_getter1& _A_getter1,
|
||||
const T_getter2& _A_getter2)
|
||||
: adapts<T_setter>(_A_setter), get1_(_A_getter1), get2_(_A_getter2)
|
||||
{}
|
||||
|
||||
getter1_type get1_; // public, so that visit_each() can access it
|
||||
getter2_type get2_; // public, so that visit_each() can access it
|
||||
};
|
||||
|
||||
template <class T_setter, class T_getter1, class T_getter2>
|
||||
typename compose2_functor<T_setter, T_getter1, T_getter2>::result_type
|
||||
compose2_functor<T_setter, T_getter1, T_getter2>::operator()()
|
||||
{ return this->functor_(get1_(), get2_()); }
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::compose1_functor performs a functor on the
|
||||
* functors stored in the sigc::compose1_functor object.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_action, class T_setter, class T_getter>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const compose1_functor<T_setter, T_getter>& _A_target)
|
||||
{
|
||||
typedef compose1_functor<T_setter, T_getter> type_functor;
|
||||
|
||||
//Note that the AIX compiler needs the actual template types of visit_each to be specified:
|
||||
typedef typename type_functor::setter_type type_functor1;
|
||||
visit_each<T_action, type_functor1>(_A_action, _A_target.functor_);
|
||||
|
||||
typedef typename type_functor::getter_type type_functor_getter;
|
||||
visit_each<T_action, type_functor_getter>(_A_action, _A_target.get_);
|
||||
}
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::compose2_functor performs a functor on the
|
||||
* functors stored in the sigc::compose2_functor object.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_action, class T_setter, class T_getter1, class T_getter2>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const compose2_functor<T_setter, T_getter1, T_getter2>& _A_target)
|
||||
{
|
||||
typedef compose2_functor<T_setter, T_getter1, T_getter2> type_functor;
|
||||
|
||||
//Note that the AIX compiler needs the actual template types of visit_each to be specified:
|
||||
typedef typename type_functor::setter_type type_functor1;
|
||||
visit_each<T_action, type_functor1>(_A_action, _A_target.functor_);
|
||||
|
||||
typedef typename type_functor::getter1_type type_functor_getter1;
|
||||
visit_each<T_action, type_functor_getter1>(_A_action, _A_target.get1_);
|
||||
|
||||
typedef typename type_functor::getter2_type type_functor_getter2;
|
||||
visit_each<T_action, type_functor_getter2>(_A_action, _A_target.get2_);
|
||||
}
|
||||
|
||||
|
||||
/** Creates an adaptor of type sigc::compose1_functor which combines two functors.
|
||||
*
|
||||
* @param _A_setter Functor that receives the return value of the invokation of @e _A_getter.
|
||||
* @param _A_getter Functor to invoke from operator()().
|
||||
* @return Adaptor that executes @e _A_setter with the value returned from invokation of @e _A_getter.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_setter, class T_getter>
|
||||
inline compose1_functor<T_setter, T_getter>
|
||||
compose(const T_setter& _A_setter, const T_getter& _A_getter)
|
||||
{ return compose1_functor<T_setter, T_getter>(_A_setter, _A_getter); }
|
||||
|
||||
/** Creates an adaptor of type sigc::compose2_functor which combines three functors.
|
||||
*
|
||||
* @param _A_setter Functor that receives the return values of the invokation of @e _A_getter1 and @e _A_getter2.
|
||||
* @param _A_getter1 Functor to invoke from operator()().
|
||||
* @param _A_getter2 Functor to invoke from operator()().
|
||||
* @return Adaptor that executes @e _A_setter with the values return from invokation of @e _A_getter1 and @e _A_getter2.
|
||||
*
|
||||
* @ingroup compose
|
||||
*/
|
||||
template <class T_setter, class T_getter1, class T_getter2>
|
||||
inline compose2_functor<T_setter, T_getter1, T_getter2>
|
||||
compose(const T_setter& _A_setter, const T_getter1& _A_getter1, const T_getter2& _A_getter2)
|
||||
{ return compose2_functor<T_setter, T_getter1, T_getter2>(_A_setter, _A_getter1, _A_getter2); }
|
||||
|
||||
} /* namespace sigc */
|
||||
100
libs/sigc++2/sigc++/adaptors/macros/deduce_result_type.h.m4
Normal file
100
libs/sigc++2/sigc++/adaptors/macros/deduce_result_type.h.m4
Normal file
@@ -0,0 +1,100 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
include(template.macros.m4)
|
||||
|
||||
define([DEDUCE_RESULT_TYPE_ADAPTOR],[dnl
|
||||
/** Deduce the return type of a functor.
|
||||
* This is the template specialization of the sigc::deduce_result_type template
|
||||
* for $1 arguments.
|
||||
*/
|
||||
template <LIST(class T_functor, LOOP(class T_arg%1, $1))>
|
||||
struct deduce_result_type<LIST(T_functor, LOOP(T_arg%1,$1), LOOP(void,eval($2-$1)), true)>
|
||||
{ typedef typename T_functor::template deduce_result_type<LOOP(T_arg%1,$1)>::type type; };
|
||||
|
||||
])
|
||||
dnl 01.11.2003: Completely removed support for typeof() since it is non-standard!
|
||||
dnl define([DEDUCE_RESULT_TYPE_TYPEOF],[dnl
|
||||
dnl template <LIST(class T_functor, LOOP(class T_arg%1, $1))>
|
||||
dnl struct deduce_result_type<LIST(T_functor, LOOP(T_arg%1,$1), LOOP(void,eval($2-$1)), false)>
|
||||
dnl {
|
||||
dnl typedef typeof(type_trait<T_functor>::instance().
|
||||
dnl T_functor::operator()(LOOP([
|
||||
dnl type_trait<T_arg%1>::instance()], $1))) type;
|
||||
dnl };
|
||||
dnl
|
||||
dnl ])
|
||||
|
||||
divert(0)dnl
|
||||
/*
|
||||
*/
|
||||
__FIREWALL__
|
||||
#include <sigc++/functors/functor_trait.h>
|
||||
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** A hint to the compiler.
|
||||
* Functors which have all methods based on templates
|
||||
* should publicly inherit from this hint and define
|
||||
* a nested template class @p deduce_result_type that
|
||||
* can be used to deduce the methods' return types.
|
||||
*
|
||||
* adaptor_base inherits from the functor_base hint so
|
||||
* derived types should also have a result_type defined.
|
||||
*
|
||||
* Adaptors don't inherit from this type directly. They use
|
||||
* use sigc::adapts as a base type instead. sigc::adaptors
|
||||
* wraps arbitrary functor types as well as function pointers
|
||||
* and class methods.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
struct adaptor_base : public functor_base {};
|
||||
|
||||
|
||||
/** Deduce the return type of a functor.
|
||||
* <tt>typename deduce_result_type<functor_type, [list of arg_types]>::type</tt>
|
||||
* deduces a functor's result type if @p functor_type inherits from
|
||||
* sigc::functor_base and defines @p result_type or if @p functor_type
|
||||
* is actually a (member) function type. Multi-type functors are not
|
||||
* supported.
|
||||
*
|
||||
* sigc++ adaptors use
|
||||
* <tt>typename deduce_result_type<functor_type, [list of arg_types]>::type</tt>
|
||||
* to determine the return type of their <tt>templated operator()</tt> overloads.
|
||||
*
|
||||
* Adaptors in turn define a nested template class @p deduce_result_type
|
||||
* that is used by template specializations of the global deduce_result_type
|
||||
* template to correctly deduce the return types of the adaptor's suitable
|
||||
* <tt>template operator()</tt> overload.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
template <class T_functor,
|
||||
LOOP(class T_arg%1=void, CALL_SIZE),
|
||||
bool I_derives_adaptor_base=is_base_and_derived<adaptor_base,T_functor>::value>
|
||||
struct deduce_result_type
|
||||
{ typedef typename functor_trait<T_functor>::result_type type; };
|
||||
|
||||
FOR(0,CALL_SIZE,[[DEDUCE_RESULT_TYPE_ADAPTOR(%1,CALL_SIZE)]])dnl
|
||||
|
||||
dnl #ifdef SIGC_CXX_TYPEOF
|
||||
dnl FOR(0,CALL_SIZE,[[DEDUCE_RESULT_TYPE_TYPEOF(%1,CALL_SIZE)]])
|
||||
dnl #endif
|
||||
dnl
|
||||
} /* namespace sigc */
|
||||
171
libs/sigc++2/sigc++/adaptors/macros/exception_catch.h.m4
Normal file
171
libs/sigc++2/sigc++/adaptors/macros/exception_catch.h.m4
Normal file
@@ -0,0 +1,171 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([EXCEPTION_CATCH_OPERATOR],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_a%1, $1));
|
||||
}
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/*
|
||||
functor adaptor: exception_catch(functor, catcher)
|
||||
|
||||
usage:
|
||||
|
||||
|
||||
Future directions:
|
||||
The catcher should be told what type of return it needs to
|
||||
return for multiple type functors, to do this the user
|
||||
will need to derive from catcher_base.
|
||||
*/
|
||||
/** @defgroup exception_catch exception_catch()
|
||||
* sigc::exception_catch() catches an exception thrown from within
|
||||
* the wrapped functor and directs it to a catcher functor.
|
||||
* This catcher can then rethrow the exception and catch it with the proper type.
|
||||
*
|
||||
* Note that the catcher is expected to return the same type
|
||||
* as the wrapped functor so that normal flow can continue.
|
||||
*
|
||||
* Catchers can be cascaded to catch multiple types because uncaught
|
||||
* rethrown exceptions proceed to the next catcher adaptor.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* struct my_catch
|
||||
* {
|
||||
* int operator()()
|
||||
* {
|
||||
* try { throw; }
|
||||
* catch (std::range_error e) // catch what types we know
|
||||
* { std::cerr << "caught " << e.what() << std::endl; }
|
||||
* return 1;
|
||||
* }
|
||||
* }
|
||||
* int foo(); // throws std::range_error
|
||||
* sigc::exception_catch(&foo, my_catch())();
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::execption_catch() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<int> some_signal;
|
||||
* some_signal.connect(sigc::exception_catch(&foo, my_catch));
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
|
||||
template <class T_functor, class T_catcher, class T_return = typename adapts<T_functor>::result_type>
|
||||
struct exception_catch_functor : public adapts<T_functor>
|
||||
{
|
||||
typedef typename adapts<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
template <LOOP(class T_arg%1=void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename adaptor_type::template deduce_result_type<LOOP(_P_(T_arg%1),CALL_SIZE)>::type type; };
|
||||
typedef T_return result_type;
|
||||
|
||||
result_type
|
||||
operator()();
|
||||
|
||||
FOR(1,CALL_SIZE,[[EXCEPTION_CATCH_OPERATOR(%1)]])dnl
|
||||
exception_catch_functor(const T_functor& _A_func,
|
||||
const T_catcher& _A_catcher)
|
||||
: adapts<T_functor>(_A_func), catcher_(_A_catcher)
|
||||
{}
|
||||
|
||||
T_catcher catcher_;
|
||||
};
|
||||
|
||||
template <class T_functor, class T_catcher, class T_return>
|
||||
typename exception_catch_functor<T_functor, T_catcher, T_return>::result_type
|
||||
exception_catch_functor<T_functor, T_catcher, T_return>::operator()()
|
||||
{
|
||||
try
|
||||
{ return this->functor_(); }
|
||||
catch (...)
|
||||
{ return catcher_(); }
|
||||
}
|
||||
|
||||
// void specialization
|
||||
template <class T_functor, class T_catcher>
|
||||
struct exception_catch_functor<T_functor, T_catcher, void> : public adapts<T_functor>
|
||||
{
|
||||
typedef void result_type;
|
||||
typedef typename adapts<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
void
|
||||
operator()();
|
||||
|
||||
FOR(1,CALL_SIZE,[[EXCEPTION_CATCH_OPERATOR(%1)]])dnl
|
||||
exception_catch_functor() {}
|
||||
exception_catch_functor(const T_functor& _A_func,
|
||||
const T_catcher& _A_catcher)
|
||||
: adapts<T_functor>(_A_func), catcher_(_A_catcher)
|
||||
{}
|
||||
~exception_catch_functor() {}
|
||||
|
||||
T_catcher catcher_;
|
||||
};
|
||||
|
||||
template <class T_functor, class T_catcher>
|
||||
void exception_catch_functor<T_functor, T_catcher, void>::operator()()
|
||||
{
|
||||
try
|
||||
{ this->functor_(); } // I don't understand why void return doesn't work here (Martin)
|
||||
catch (...)
|
||||
{ this->catcher_(); }
|
||||
}
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
template <class T_action, class T_functor, class T_catcher, class T_return>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const exception_catch_functor<T_functor, T_catcher, T_return>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
visit_each(_A_action, _A_target.catcher_);
|
||||
}
|
||||
|
||||
|
||||
template <class T_functor, class T_catcher>
|
||||
inline exception_catch_functor<T_functor, T_catcher>
|
||||
exception_catch(const T_functor& _A_func, const T_catcher& _A_catcher)
|
||||
{ return exception_catch_functor<T_functor, T_catcher>(_A_func, _A_catcher); }
|
||||
|
||||
} /* namespace sigc */
|
||||
231
libs/sigc++2/sigc++/adaptors/macros/hide.h.m4
Normal file
231
libs/sigc++2/sigc++/adaptors/macros/hide.h.m4
Normal file
@@ -0,0 +1,231 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([DEDUCE_RESULT_TYPE],[dnl
|
||||
template <LOOP(class T_arg%1=void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
ifelse($1,0,[dnl
|
||||
{ typedef typename adaptor_type::template deduce_result_type<LOOP(_P_(T_arg%1),eval($2-1))>::type type; };
|
||||
],[dnl
|
||||
{ typedef typename adaptor_type::template deduce_result_type<LIST(LOOP(_P_(T_arg%1),eval($1-1)), FOR(eval($1+1),$2,[_P_(T_arg%1),]))>::type type; };
|
||||
])dnl
|
||||
])
|
||||
define([HIDE_OPERATOR],[dnl
|
||||
ifelse($2,0,,[dnl
|
||||
ifelse($2,1,[dnl
|
||||
/** Invokes the wrapped functor ignoring the only argument.
|
||||
* @param _A_arg%1 Argument to be ignored.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
operator()(T_arg1)
|
||||
{ return this->functor_(); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
typename deduce_result_type<T_arg1>::type
|
||||
sun_forte_workaround(T_arg1 _A_a1)
|
||||
{ return this->functor_(); }
|
||||
#endif
|
||||
|
||||
],$1,0,[dnl
|
||||
/** Invokes the wrapped functor ignoring the last argument.dnl
|
||||
FOR(1, eval($2-1),[
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.])
|
||||
* @param _A_arg$2 Argument to be ignored.
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <LOOP([class T_arg%1], $2)>
|
||||
typename deduce_result_type<LOOP(T_arg%1, $2)>::type
|
||||
operator()(LOOP(T_arg%1 _A_a%1, eval($2-1)), T_arg$2)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($2-1),[_P_(T_arg%1),]))>
|
||||
(LIST(FOR(1,eval($2-1),[_A_a%1,]))); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP([class T_arg%1], $2)>
|
||||
typename deduce_result_type<LOOP(T_arg%1, $2)>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_a%1, eval($2-1)), T_arg$2)
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($2-1),[_P_(T_arg%1),]))>
|
||||
(LIST(FOR(1,eval($2-1),[_A_a%1,]))); }
|
||||
#endif
|
||||
|
||||
],[dnl
|
||||
/** Invokes the wrapped functor ignoring the $1[]th argument.dnl
|
||||
FOR(1, eval($1-1),[
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.])
|
||||
* @param _A_arg$1 Argument to be ignored.dnl
|
||||
FOR(eval($1+1), $2,[
|
||||
* @param _A_arg%1 Argument to be passed on to the functor.])
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
template <LOOP([class T_arg%1], $2)>
|
||||
typename deduce_result_type<LOOP(T_arg%1, $2)>::type
|
||||
operator()(LIST(FOR(1,eval($1-1),[T_arg%1 _A_a%1,]),T_arg$1,FOR(eval($1+1),$2,[T_arg%1 _A_a%1,])))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($1-1),[_P_(T_arg%1),]),FOR(eval($1+1), $2,[_P_(T_arg%1),]))>
|
||||
(LIST(FOR(1,eval($1-1),[_A_a%1,]),FOR(eval($1+1),$2,[_A_a%1,]))); }
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP([class T_arg%1], $2)>
|
||||
typename deduce_result_type<LOOP(T_arg%1, $2)>::type
|
||||
sun_forte_workaround(LIST(FOR(1,eval($1-1),[T_arg%1 _A_a%1,]),T_arg$1,FOR(eval($1+1),$2,[T_arg%1 _A_a%1,])))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($1-1),[_P_(T_arg%1),]),FOR(eval($1+1), $2,[_P_(T_arg%1),]))>
|
||||
(LIST(FOR(1,eval($1-1),[_A_a%1,]),FOR(eval($1+1),$2,[_A_a%1,]))); }
|
||||
#endif
|
||||
|
||||
])])dnl
|
||||
])
|
||||
define([HIDE_FUNCTOR],[dnl
|
||||
/** Adaptor that adds a dummy parameter to the wrapped functor.
|
||||
* This template specialization ignores the value of the ifelse($1,-1,[last],[$1[]th]) parameter in operator()().
|
||||
*
|
||||
* @ingroup hide
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct hide_functor <$1, T_functor> : public adapts<T_functor>
|
||||
{
|
||||
typedef typename adapts<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
DEDUCE_RESULT_TYPE(eval($1+1),CALL_SIZE)dnl
|
||||
typedef typename adaptor_type::result_type result_type;
|
||||
|
||||
FOR(eval($1+1),CALL_SIZE,[[HIDE_OPERATOR(eval($1+1),%1)]])dnl
|
||||
|
||||
/** Constructs a hide_functor object that adds a dummy parameter to the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
*/
|
||||
explicit hide_functor(const T_functor& _A_func)
|
||||
: adapts<T_functor>(_A_func)
|
||||
{}
|
||||
};
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup hide hide(), hide_return()
|
||||
* sigc::hide() alters an arbitrary functor in that it adds a parameter
|
||||
* whose value is ignored on invocation of the returned functor.
|
||||
* Thus you can discard one or more of the arguments of a signal.
|
||||
*
|
||||
* You may optionally specify the zero-based position of the parameter
|
||||
* to ignore as a template argument. The default is to ignore the last
|
||||
* parameter.
|
||||
* (A value of @p -1 adds a parameter at the end so sigc::hide<-1>() gives the same result as sigc::hide().)
|
||||
*
|
||||
* The type of the parameter can optionally be specified if not deduced.
|
||||
*
|
||||
* @par Examples:
|
||||
* @code
|
||||
* void foo(int, int);
|
||||
* // single argument hiding ...
|
||||
* sigc::hide(&foo)(1,2,3); // adds a dummy parameter at the back and calls foo(1,2)
|
||||
* sigc::hide<-1>(&foo)(1,2,3); // same as sigc::hide(&foo)(1,2,3) (calls foo(1,2))
|
||||
* sigc::hide<0>(&foo)(1,2,3); // adds a dummy parameter at the beginning and calls foo(2,3)
|
||||
* sigc::hide<1>(&foo)(1,2,3); // adds a dummy parameter in the middle and calls foo(1,3)
|
||||
* sigc::hide<2>(&foo)(1,2,3); // adds a dummy parameter at the back and calls foo(1,2)
|
||||
* // multiple argument hiding ...
|
||||
* sigc::hide(sigc::hide(&foo))(1,2,3,4); // adds two dummy parameters at the back and calls foo(1,2)
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::hide() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<void,int> some_signal;
|
||||
* void foo();
|
||||
* some_signal.connect(sigc::hide(&foo));
|
||||
* @endcode
|
||||
*
|
||||
* sigc::hide_return() alters an arbitrary functor by
|
||||
* dropping its return value, thus converting it to a void functor.
|
||||
*
|
||||
* For a more powerful version of this functionality see the lambda
|
||||
* library adaptor sigc::group() which can bind, hide and reorder
|
||||
* arguments arbitrarily. Although sigc::group() is more flexible,
|
||||
* sigc::hide() provides a means of hiding parameters when then total
|
||||
* number of parameters called is variable.
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
|
||||
/** Adaptor that adds a dummy parameter to the wrapped functor.
|
||||
* Use the convenience function sigc::hide() to create an instance of sigc::hide_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e I_location Zero-based position of the dummy parameter (@p -1 for the last parameter).
|
||||
* - @e T_type Type of the dummy parameter.
|
||||
* - @e T_functor Type of the functor to wrap.
|
||||
*
|
||||
* @ingroup hide
|
||||
*/
|
||||
template <int I_location, class T_functor>
|
||||
struct hide_functor;
|
||||
|
||||
FOR(-1,eval(CALL_SIZE-1),[[HIDE_FUNCTOR(%1)]])dnl
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::hide_functor performs a functor on the
|
||||
* functor stored in the sigc::hide_functor object.
|
||||
*
|
||||
* @ingroup hide
|
||||
*/
|
||||
template <class T_action, int I_location, class T_functor>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const hide_functor<I_location, T_functor>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
}
|
||||
|
||||
|
||||
/** Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor.
|
||||
* The optional template argument @e I_location specifies the zero-based
|
||||
* position of the dummy parameter in the returned functor (@p -1 stands for the last parameter).
|
||||
*
|
||||
* @param _A_func Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_func ignoring the value of the dummy parameter.
|
||||
*
|
||||
* @ingroup hide
|
||||
*/
|
||||
template <int I_location, class T_functor>
|
||||
inline hide_functor<I_location, T_functor>
|
||||
hide(const T_functor& _A_func)
|
||||
{ return hide_functor<I_location, T_functor>(_A_func); }
|
||||
|
||||
/** Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor.
|
||||
* This overload adds a dummy parameter at the back of the functor's parameter list.
|
||||
*
|
||||
* @param _A_func Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_func ignoring the value of the last parameter.
|
||||
*
|
||||
* @ingroup hide
|
||||
*/
|
||||
template <class T_functor>
|
||||
inline hide_functor<-1, T_functor>
|
||||
hide(const T_functor& _A_func)
|
||||
{ return hide_functor<-1, T_functor> (_A_func); }
|
||||
|
||||
} /* namespace sigc */
|
||||
204
libs/sigc++2/sigc++/adaptors/macros/retype.h.m4
Normal file
204
libs/sigc++2/sigc++/adaptors/macros/retype.h.m4
Normal file
@@ -0,0 +1,204 @@
|
||||
dnl Copyright 2003, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([RETYPE_OPERATOR],[dnl
|
||||
ifelse($1,0,[dnl
|
||||
result_type operator()();
|
||||
|
||||
],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename type_trait<T_type%1>::take, $1)>
|
||||
(LOOP([[static_cast<T_type%1>(_A_a%1)]], $1));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
typename deduce_result_type<LOOP(T_arg%1,$1)>::type
|
||||
sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename type_trait<T_type%1>::take, $1)>
|
||||
(LOOP([[static_cast<T_type%1>(_A_a%1)]], $1));
|
||||
}
|
||||
#endif
|
||||
|
||||
])dnl
|
||||
])
|
||||
define([RETYPE_POINTER_FUNCTOR],[dnl
|
||||
/** Creates an adaptor of type sigc::retype_functor which performs C-style casts on the parameters passed on to the functor.
|
||||
* This function template specialization works on sigc::pointer_functor.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_functor performing C-style casts on the paramters passed on.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return)>
|
||||
inline retype_functor<LIST(pointer_functor$1<LIST(LOOP(T_arg%1, $1), T_return)>, LOOP(T_arg%1, $1)) >
|
||||
retype(const pointer_functor$1<LIST(LOOP(T_arg%1, $1), T_return)>& _A_functor)
|
||||
{ return retype_functor<LIST(pointer_functor$1<LIST(LOOP(T_arg%1, $1), T_return)>, LOOP(T_arg%1, $1)) >
|
||||
(_A_functor); }
|
||||
|
||||
])
|
||||
define([RETYPE_MEM_FUNCTOR],[dnl
|
||||
/** Creates an adaptor of type sigc::retype_functor which performs C-style casts on the parameters passed on to the functor.
|
||||
* This function template specialization works on sigc::$2[]mem_functor.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_functor performing C-style casts on the paramters passed on.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <LIST(class T_return, class T_obj, LOOP(class T_arg%1, $1))>
|
||||
inline retype_functor<LIST($2[]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>, LOOP(T_arg%1, $1)) >
|
||||
retype(const $2[]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>& _A_functor)
|
||||
{ return retype_functor<LIST($2[]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>, LOOP(T_arg%1, $1)) >
|
||||
(_A_functor); }
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/functors/ptr_fun.h>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
#include <sigc++/functors/slot.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup retype retype(), retype_return()
|
||||
* sigc::retype() alters a sigc::pointer_functor, a sigc::mem_functor or a sigc::slot
|
||||
* in that it makes C-style casts to the functor's parameter types
|
||||
* of all parameters passed through operator()().
|
||||
*
|
||||
* Use this adaptor for inline conversion between numeric or other simple types.
|
||||
* @par Example:
|
||||
* @code
|
||||
* void foo(int);
|
||||
* sigc::retype(sigc::ptr_fun(&foo))(5.7F); // calls foo(5)
|
||||
* @endcode
|
||||
*
|
||||
* The functor sigc::retype() returns can be passed into
|
||||
* sigc::signal::connect() directly.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* sigc::signal<void,float> some_signal;
|
||||
* void foo(int);
|
||||
* some_signal.connect(sigc::retype(sigc::ptr_fun(&foo)));
|
||||
* @endcode
|
||||
*
|
||||
* This adaptor builds an exception in that it only works on sig::pointer_functor,
|
||||
* sigc::mem_functor and sigc::slot because it needs sophisticated information about
|
||||
* the parameter types that cannot be deduced from arbitrary functor types.
|
||||
*
|
||||
* sigc::retype_return() alters the return type of an arbitrary functor.
|
||||
* Like in sigc::retype() a C-style cast is preformed. Usage sigc::retype_return() is
|
||||
* not restricted to libsigc++ functor types but you need to
|
||||
* specify the new return type as a template parameter.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* float foo();
|
||||
* std::cout << sigc::retype_return<int>(&foo)(); // converts foo's return value to an integer
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup adaptors
|
||||
*/
|
||||
|
||||
/** Adaptor that performs C-style casts on the parameters passed on to the functor.
|
||||
* Use the convenience function sigc::retype() to create an instance of retype_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_functor Type of the functor to wrap.dnl
|
||||
FOR(1, CALL_SIZE,[
|
||||
* - @e T_type%1 Type of @e T_functor's %1th argument.])
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <LIST(class T_functor, LOOP(class T_type%1=nil, CALL_SIZE))>
|
||||
struct retype_functor
|
||||
: public adapts<T_functor>
|
||||
{
|
||||
typedef typename adapts<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
template <LOOP(class T_arg%1=void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef typename adaptor_type::template deduce_result_type<LOOP(_P_(T_arg%1),CALL_SIZE)>::type type; };
|
||||
typedef typename adapts<T_functor>::result_type result_type;
|
||||
|
||||
FOR(0,CALL_SIZE,[[RETYPE_OPERATOR(%1)]])dnl
|
||||
|
||||
/** Constructs a retype_functor object that performs C-style casts on the parameters passed on to the functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
*/
|
||||
explicit retype_functor(typename type_trait<T_functor>::take _A_functor)
|
||||
: adapts<T_functor>(_A_functor)
|
||||
{}
|
||||
};
|
||||
|
||||
template <LIST(class T_functor, LOOP(class T_type%1, CALL_SIZE))>
|
||||
typename retype_functor<LIST(T_functor, LOOP(T_type%1, CALL_SIZE))>::result_type
|
||||
retype_functor<LIST(T_functor, LOOP(T_type%1, CALL_SIZE))>::operator()()
|
||||
{ return this->functor_(); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::retype_functor performs a functor on the
|
||||
* functor stored in the sigc::retype_functor object.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <LIST(class T_action, class T_functor, LOOP(class T_type%1, CALL_SIZE))>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const retype_functor<LIST(T_functor, LOOP(T_type%1, CALL_SIZE))>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
}
|
||||
|
||||
|
||||
/** Creates an adaptor of type sigc::retype_functor which performs C-style casts on the parameters passed on to the functor.
|
||||
* This function template specialization works on sigc::slot.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_functor performing C-style casts on the paramters passed on.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <LIST(class T_return, LOOP(class T_arg%1, CALL_SIZE))>
|
||||
inline retype_functor<LIST(slot<LIST(T_return, LOOP(T_arg%1, CALL_SIZE))>, LOOP(T_arg%1, CALL_SIZE)) >
|
||||
retype(const slot<LIST(T_return, LOOP(T_arg%1, CALL_SIZE))>& _A_functor)
|
||||
{ return retype_functor<LIST(slot<LIST(T_return, LOOP(T_arg%1, CALL_SIZE))>, LOOP(T_arg%1, CALL_SIZE)) >
|
||||
(_A_functor); }
|
||||
|
||||
|
||||
FOR(0,CALL_SIZE,[[RETYPE_POINTER_FUNCTOR(%1)]])dnl
|
||||
|
||||
FOR(0,CALL_SIZE,[[RETYPE_MEM_FUNCTOR(%1,[])]])dnl
|
||||
FOR(0,CALL_SIZE,[[RETYPE_MEM_FUNCTOR(%1,[const_])]])dnl
|
||||
FOR(0,CALL_SIZE,[[RETYPE_MEM_FUNCTOR(%1,[volatile_])]])dnl
|
||||
FOR(0,CALL_SIZE,[[RETYPE_MEM_FUNCTOR(%1,[const_volatile_])]])dnl
|
||||
FOR(0,CALL_SIZE,[[RETYPE_MEM_FUNCTOR(%1,[bound_])]])dnl
|
||||
FOR(0,CALL_SIZE,[[RETYPE_MEM_FUNCTOR(%1,[bound_const_])]])dnl
|
||||
FOR(0,CALL_SIZE,[[RETYPE_MEM_FUNCTOR(%1,[bound_volatile_])]])dnl
|
||||
FOR(0,CALL_SIZE,[[RETYPE_MEM_FUNCTOR(%1,[bound_const_volatile_])]])dnl
|
||||
|
||||
} /* namespace sigc */
|
||||
165
libs/sigc++2/sigc++/adaptors/macros/retype_return.h.m4
Normal file
165
libs/sigc++2/sigc++/adaptors/macros/retype_return.h.m4
Normal file
@@ -0,0 +1,165 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([RETYPE_RETURN_OPERATOR],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline T_return operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_a%1, $1)));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline T_return sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_a%1, $1)));
|
||||
}
|
||||
#endif
|
||||
|
||||
])
|
||||
define([RETYPE_RETURN_VOID_OPERATOR],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline void operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_a%1, $1));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline void sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
|
||||
(LOOP(_A_a%1, $1));
|
||||
}
|
||||
#endif
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** Adaptor that perform a C-style cast on the return value of a functor.
|
||||
* Use the convenience function sigc::retype_return() to create an instance of retype_return_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_return Target type of the C-style cast.
|
||||
* - @e T_functor Type of the functor to wrap.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <class T_return, class T_functor>
|
||||
struct retype_return_functor : public adapts<T_functor>
|
||||
{
|
||||
template <LOOP(class T_arg%1=void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef T_return type; };
|
||||
typedef T_return result_type;
|
||||
|
||||
T_return operator()();
|
||||
|
||||
FOR(1,CALL_SIZE,[[RETYPE_RETURN_OPERATOR(%1)]])dnl
|
||||
retype_return_functor() {}
|
||||
|
||||
/** Constructs a retype_return_functor object that perform a C-style cast on the return value of the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
*/
|
||||
explicit retype_return_functor(_R_(T_functor) _A_functor)
|
||||
: adapts<T_functor>(_A_functor)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class T_return, class T_functor>
|
||||
T_return retype_return_functor<T_return, T_functor>::operator()()
|
||||
{ return T_return(this->functor_()); }
|
||||
|
||||
|
||||
/** Adaptor that perform a C-style cast on the return value of a functor.
|
||||
* This template specialization is for a void return. It drops the return value of the functor it invokes.
|
||||
* Use the convenience function sigc::hide_return() to create an instance of sigc::retype_return_functor<void>.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
/* The void specialization needed because of explicit cast to T_return.
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct retype_return_functor<void, T_functor> : public adapts<T_functor>
|
||||
{
|
||||
template <LOOP(class T_arg%1=void, CALL_SIZE)>
|
||||
struct deduce_result_type
|
||||
{ typedef void type; };
|
||||
typedef void result_type;
|
||||
|
||||
void operator()();
|
||||
|
||||
FOR(1,CALL_SIZE,[[RETYPE_RETURN_VOID_OPERATOR(%1)]])dnl
|
||||
retype_return_functor() {}
|
||||
retype_return_functor(_R_(T_functor) _A_functor)
|
||||
: adapts<T_functor>(_A_functor)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class T_functor>
|
||||
void retype_return_functor<void, T_functor>::operator()()
|
||||
{ this->functor_(); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::retype_return_functor performs a functor on the
|
||||
* functor stored in the sigc::retype_return_functor object.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <class T_action, class T_return, class T_functor>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const retype_return_functor<T_return, T_functor>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
}
|
||||
|
||||
|
||||
/** Creates an adaptor of type sigc::retype_return_functor which performs a C-style cast on the return value of the passed functor.
|
||||
* The template argument @e T_return specifies the target type of the cast.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_functor performing a C-style casts on the return value.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <class T_return, class T_functor>
|
||||
inline retype_return_functor<T_return, T_functor>
|
||||
retype_return(const T_functor& _A_functor)
|
||||
{ return retype_return_functor<T_return, T_functor>(_A_functor); }
|
||||
|
||||
/** Creates an adaptor of type sigc::retype_return_functor which drops the return value of the passed functor.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_functor dropping its return value.
|
||||
*
|
||||
* @ingroup hide
|
||||
*/
|
||||
template <class T_functor>
|
||||
inline retype_return_functor<void, T_functor>
|
||||
hide_return(const T_functor& _A_functor)
|
||||
{ return retype_return_functor<void, T_functor>(_A_functor); }
|
||||
|
||||
} /* namespace sigc */
|
||||
1248
libs/sigc++2/sigc++/adaptors/retype.h
Normal file
1248
libs/sigc++2/sigc++/adaptors/retype.h
Normal file
File diff suppressed because it is too large
Load Diff
309
libs/sigc++2/sigc++/adaptors/retype_return.h
Normal file
309
libs/sigc++2/sigc++/adaptors/retype_return.h
Normal file
@@ -0,0 +1,309 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#ifndef _SIGC_ADAPTORS_MACROS_RETYPE_RETURNHM4_
|
||||
#define _SIGC_ADAPTORS_MACROS_RETYPE_RETURNHM4_
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** Adaptor that perform a C-style cast on the return value of a functor.
|
||||
* Use the convenience function sigc::retype_return() to create an instance of retype_return_functor.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_return Target type of the C-style cast.
|
||||
* - @e T_functor Type of the functor to wrap.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <class T_return, class T_functor>
|
||||
struct retype_return_functor : public adapts<T_functor>
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef T_return type; };
|
||||
typedef T_return result_type;
|
||||
|
||||
T_return operator()();
|
||||
|
||||
template <class T_arg1>
|
||||
inline T_return operator()(T_arg1 _A_a1)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_a1));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
inline T_return sun_forte_workaround(T_arg1 _A_a1)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_a1));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
inline T_return operator()(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_a1,_A_a2));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
inline T_return sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_a1,_A_a2));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
inline T_return operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_a1,_A_a2,_A_a3));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
inline T_return sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_a1,_A_a2,_A_a3));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
inline T_return operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
inline T_return sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
inline T_return operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
inline T_return sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
inline T_return operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
inline T_return sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
inline T_return operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
inline T_return sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7));
|
||||
}
|
||||
#endif
|
||||
|
||||
retype_return_functor() {}
|
||||
|
||||
/** Constructs a retype_return_functor object that perform a C-style cast on the return value of the passed functor.
|
||||
* @param _A_functor Functor to invoke from operator()().
|
||||
*/
|
||||
explicit retype_return_functor(typename type_trait<T_functor>::take _A_functor)
|
||||
: adapts<T_functor>(_A_functor)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class T_return, class T_functor>
|
||||
T_return retype_return_functor<T_return, T_functor>::operator()()
|
||||
{ return T_return(this->functor_()); }
|
||||
|
||||
|
||||
/** Adaptor that perform a C-style cast on the return value of a functor.
|
||||
* This template specialization is for a void return. It drops the return value of the functor it invokes.
|
||||
* Use the convenience function sigc::hide_return() to create an instance of sigc::retype_return_functor<void>.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
/* The void specialization needed because of explicit cast to T_return.
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct retype_return_functor<void, T_functor> : public adapts<T_functor>
|
||||
{
|
||||
template <class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void>
|
||||
struct deduce_result_type
|
||||
{ typedef void type; };
|
||||
typedef void result_type;
|
||||
|
||||
void operator()();
|
||||
|
||||
template <class T_arg1>
|
||||
inline void operator()(T_arg1 _A_a1)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_a1);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1>
|
||||
inline void sun_forte_workaround(T_arg1 _A_a1)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass>
|
||||
(_A_a1);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2>
|
||||
inline void operator()(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_a1,_A_a2);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2>
|
||||
inline void sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass>
|
||||
(_A_a1,_A_a2);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
inline void operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_a1,_A_a2,_A_a3);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3>
|
||||
inline void sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass>
|
||||
(_A_a1,_A_a2,_A_a3);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
inline void operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
|
||||
inline void sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
inline void operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
|
||||
inline void sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
inline void operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
|
||||
inline void sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
inline void operator()(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
|
||||
inline void sun_forte_workaround(T_arg1 _A_a1,T_arg2 _A_a2,T_arg3 _A_a3,T_arg4 _A_a4,T_arg5 _A_a5,T_arg6 _A_a6,T_arg7 _A_a7)
|
||||
{ this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename type_trait<T_arg1>::pass,typename type_trait<T_arg2>::pass,typename type_trait<T_arg3>::pass,typename type_trait<T_arg4>::pass,typename type_trait<T_arg5>::pass,typename type_trait<T_arg6>::pass,typename type_trait<T_arg7>::pass>
|
||||
(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
|
||||
}
|
||||
#endif
|
||||
|
||||
retype_return_functor() {}
|
||||
retype_return_functor(typename type_trait<T_functor>::take _A_functor)
|
||||
: adapts<T_functor>(_A_functor)
|
||||
{}
|
||||
};
|
||||
|
||||
template <class T_functor>
|
||||
void retype_return_functor<void, T_functor>::operator()()
|
||||
{ this->functor_(); }
|
||||
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::retype_return_functor performs a functor on the
|
||||
* functor stored in the sigc::retype_return_functor object.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <class T_action, class T_return, class T_functor>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const retype_return_functor<T_return, T_functor>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.functor_);
|
||||
}
|
||||
|
||||
|
||||
/** Creates an adaptor of type sigc::retype_return_functor which performs a C-style cast on the return value of the passed functor.
|
||||
* The template argument @e T_return specifies the target type of the cast.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_functor performing a C-style casts on the return value.
|
||||
*
|
||||
* @ingroup retype
|
||||
*/
|
||||
template <class T_return, class T_functor>
|
||||
inline retype_return_functor<T_return, T_functor>
|
||||
retype_return(const T_functor& _A_functor)
|
||||
{ return retype_return_functor<T_return, T_functor>(_A_functor); }
|
||||
|
||||
/** Creates an adaptor of type sigc::retype_return_functor which drops the return value of the passed functor.
|
||||
*
|
||||
* @param _A_functor Functor that should be wrapped.
|
||||
* @return Adaptor that executes @e _A_functor dropping its return value.
|
||||
*
|
||||
* @ingroup hide
|
||||
*/
|
||||
template <class T_functor>
|
||||
inline retype_return_functor<void, T_functor>
|
||||
hide_return(const T_functor& _A_functor)
|
||||
{ return retype_return_functor<void, T_functor>(_A_functor); }
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_ADAPTORS_MACROS_RETYPE_RETURNHM4_ */
|
||||
24
libs/sigc++2/sigc++/bind.h
Normal file
24
libs/sigc++2/sigc++/bind.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_BIND_HPP_
|
||||
#define _SIGC_BIND_HPP_
|
||||
|
||||
#include <sigc++/adaptors/bind.h>
|
||||
|
||||
#endif /* _SIGC_BIND_HPP_ */
|
||||
25
libs/sigc++2/sigc++/bind_return.h
Normal file
25
libs/sigc++2/sigc++/bind_return.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_BIND_RETURN_HPP_
|
||||
#define _SIGC_BIND_RETURN_HPP_
|
||||
|
||||
#include <sigc++/adaptors/bind_return.h>
|
||||
|
||||
|
||||
#endif /* _SIGC_BIND_RETURN_HPP_ */
|
||||
11
libs/sigc++2/sigc++/class_slot.h
Normal file
11
libs/sigc++2/sigc++/class_slot.h
Normal file
@@ -0,0 +1,11 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
|
||||
|
||||
#ifndef _SIGC_MACROS_CLASS_SLOTHM4_
|
||||
#define _SIGC_MACROS_CLASS_SLOTHM4_
|
||||
|
||||
#include <sigc++/slot.h>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
|
||||
#endif /* _SIGC_MACROS_CLASS_SLOTHM4_ */
|
||||
111
libs/sigc++2/sigc++/connection.cc
Normal file
111
libs/sigc++2/sigc++/connection.cc
Normal file
@@ -0,0 +1,111 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sigc++/connection.h>
|
||||
using namespace std;
|
||||
|
||||
namespace sigc {
|
||||
|
||||
connection::connection()
|
||||
: slot_(0)
|
||||
{}
|
||||
|
||||
connection::connection(const connection& c)
|
||||
: slot_(c.slot_)
|
||||
{
|
||||
//Let the connection forget about the signal handler when the handler object dies:
|
||||
if (slot_)
|
||||
slot_->add_destroy_notify_callback(this, ¬ify);
|
||||
}
|
||||
|
||||
connection::connection(slot_base& sl)
|
||||
: slot_(&sl)
|
||||
{
|
||||
//Let the connection forget about the signal handler when the handler object dies:
|
||||
slot_->add_destroy_notify_callback(this, ¬ify);
|
||||
}
|
||||
|
||||
connection& connection::operator=(const connection& c)
|
||||
{
|
||||
set_slot(c.slot_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
connection::~connection()
|
||||
{
|
||||
if (slot_)
|
||||
slot_->remove_destroy_notify_callback(this);
|
||||
}
|
||||
|
||||
bool connection::empty() const
|
||||
{
|
||||
return (!slot_ || slot_->empty());
|
||||
}
|
||||
|
||||
bool connection::connected() const
|
||||
{
|
||||
return !empty();
|
||||
}
|
||||
|
||||
bool connection::blocked() const
|
||||
{
|
||||
return (slot_ ? slot_->blocked() : false);
|
||||
}
|
||||
|
||||
bool connection::block(bool should_block)
|
||||
{
|
||||
return (slot_ ? slot_->block(should_block) : false);
|
||||
}
|
||||
|
||||
bool connection::unblock()
|
||||
{
|
||||
return (slot_ ? slot_->unblock() : false);
|
||||
}
|
||||
|
||||
void connection::disconnect()
|
||||
{
|
||||
if (slot_)
|
||||
slot_->disconnect(); // This notifies slot_'s parent.
|
||||
}
|
||||
|
||||
connection::operator bool()
|
||||
{
|
||||
return !empty();
|
||||
}
|
||||
|
||||
void connection::set_slot(slot_base* sl)
|
||||
{
|
||||
if (slot_)
|
||||
slot_->remove_destroy_notify_callback(this);
|
||||
|
||||
slot_ = sl;
|
||||
|
||||
if (slot_)
|
||||
slot_->add_destroy_notify_callback(this, ¬ify);
|
||||
}
|
||||
|
||||
void* connection::notify(void* data)
|
||||
{
|
||||
connection* self = reinterpret_cast<connection*>(data);
|
||||
self->slot_ = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
} /* namespace sigc */
|
||||
129
libs/sigc++2/sigc++/connection.h
Normal file
129
libs/sigc++2/sigc++/connection.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_CONNECTION_HPP_
|
||||
#define _SIGC_CONNECTION_HPP_
|
||||
#include <sigc++config.h>
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** Convinience class for safe disconnection.
|
||||
* Iterators must not be used beyond the lifetime of the list
|
||||
* they work on. A connection object can be created from a
|
||||
* slot list iterator and may safely be used to disconnect
|
||||
* the referred slot at any time (disconnect()). If the slot
|
||||
* has already been destroyed, disconnect() does nothing. empty() or
|
||||
* operator bool() can be used to test whether the connection is
|
||||
* still active. The connection can be blocked (block(), unblock()).
|
||||
*
|
||||
* This is possible because the connection object gets notified
|
||||
* when the referred slot dies (notify()).
|
||||
*
|
||||
* @ingroup signal
|
||||
*/
|
||||
struct SIGC_API connection
|
||||
{
|
||||
/** Constructs an empty connection object. */
|
||||
connection();
|
||||
|
||||
/** Constructs a connection object copying an existing one.
|
||||
* @param c The connection object to make a copy from.
|
||||
*/
|
||||
connection(const connection& c);
|
||||
|
||||
/** Constructs a connection object from a slot list iterator.
|
||||
* @param it The slot list iterator to take the slot from.
|
||||
*/
|
||||
template <typename T_slot>
|
||||
connection(const slot_iterator<T_slot>& it) : slot_(&(*it))
|
||||
{ if (slot_) slot_->add_destroy_notify_callback(this, ¬ify); }
|
||||
|
||||
/** Constructs a connection object from a slot object.
|
||||
* This is only useful if you create your own slot list.
|
||||
* @param sl The slot to operate on.
|
||||
*/
|
||||
explicit connection(slot_base& sl);
|
||||
|
||||
/** Overrides this connection object copying another one.
|
||||
* @param c The connection object to make a copy from.
|
||||
*/
|
||||
connection& operator=(const connection& c);
|
||||
|
||||
/** Overrides this connection object with another slot list iterator.
|
||||
* @param it The new slot list iterator to take the slot from.
|
||||
*/
|
||||
template <typename T_slot>
|
||||
connection& operator=(const slot_iterator<T_slot>& it)
|
||||
{ set_slot(&(*it)); return *this; }
|
||||
|
||||
~connection();
|
||||
|
||||
/** Returns whether the connection is still active.
|
||||
* @return @p false if the connection is still active.
|
||||
*/
|
||||
bool empty() const;
|
||||
|
||||
/** Returns whether the connection is still active.
|
||||
* @return @p true if the connection is still active.
|
||||
*/
|
||||
bool connected() const;
|
||||
|
||||
/** Returns whether the connection is blocked.
|
||||
* @return @p true if the connection is blocked.
|
||||
*/
|
||||
bool blocked() const;
|
||||
|
||||
/** Sets or unsets the blocking state of this connection.
|
||||
* See slot_base::block() for details.
|
||||
* @param should_block Indicates whether the blocking state should be set or unset.
|
||||
* @return @p true if the connection has been in blocking state before.
|
||||
*/
|
||||
bool block(bool should_block = true);
|
||||
|
||||
/** Unsets the blocking state of this connection.
|
||||
* @return @p true if the connection has been in blocking state before.
|
||||
*/
|
||||
bool unblock();
|
||||
|
||||
/// Disconnects the referred slot.
|
||||
void disconnect();
|
||||
|
||||
/** Returns whether the connection is still active.
|
||||
* @return @p true if the connection is still active.
|
||||
*/
|
||||
operator bool();
|
||||
|
||||
/** Callback that is executed when the referred slot is destroyed.
|
||||
* @param d The connection object notified (@p this).
|
||||
*/
|
||||
static void* notify(void* data);
|
||||
|
||||
private:
|
||||
void set_slot(slot_base* sl);
|
||||
|
||||
/* Referred slot. Set to zero from notify().
|
||||
* A value of zero indicates an "empty" connection.
|
||||
*/
|
||||
slot_base* slot_;
|
||||
};
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
|
||||
#endif /* _SIGC_TRACKABLE_HPP_ */
|
||||
311
libs/sigc++2/sigc++/functors/functor_trait.h
Normal file
311
libs/sigc++2/sigc++/functors/functor_trait.h
Normal file
@@ -0,0 +1,311 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
/*
|
||||
Trait functor_trait<functor>:
|
||||
|
||||
This trait allows the user to specific what is the return type
|
||||
of any type. It has been overloaded to detect the return type and
|
||||
the functor version of function pointers and class methods as well.
|
||||
|
||||
To populate the return type of user defined and third party functors
|
||||
use the macro SIGC_FUNCTOR_TRAIT(T_functor,T_return) in
|
||||
namespace sigc. Multi-type functors are only partly supported.
|
||||
Try specifying the return type of the functor's operator()() overload.
|
||||
|
||||
Alternatively, you can derive your functors from functor_base and
|
||||
place "typedef T_return result_type;" in the class definition.
|
||||
|
||||
Use SIGC_FUNCTORS_HAVE_RESULT_TYPE if you want sigc++ to assume that
|
||||
result_type is defined in all user defined or 3rd-party functors
|
||||
(except those you specify a return type explicitly with SIGC_FUNCTOR_TRAIT()).
|
||||
|
||||
*/
|
||||
#ifndef _SIGC_FUNCTORS_MACROS_FUNCTOR_TRAITHM4_
|
||||
#define _SIGC_FUNCTORS_MACROS_FUNCTOR_TRAITHM4_
|
||||
#include <sigc++/type_traits.h>
|
||||
|
||||
#ifdef nil
|
||||
/* stupid OS X, defining nil */
|
||||
#undef nil
|
||||
#endif
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** nil struct type.
|
||||
* The nil struct type is used as default template argument in the
|
||||
* unnumbered sigc::signal and sigc::slot templates.
|
||||
*
|
||||
* @ingroup signal
|
||||
* @ingroup slot
|
||||
*/
|
||||
struct nil;
|
||||
|
||||
|
||||
/** @defgroup functors Functors
|
||||
* Functors are copyable types that define operator()().
|
||||
*
|
||||
* Types that define operator()() overloads with different return types are referred to
|
||||
* as multi-type functors. Multi-type functors are only partly supported in libsigc++.
|
||||
*
|
||||
* Closures are functors that store all information needed to invoke a callback from operator()().
|
||||
*
|
||||
* Adaptors are functors that alter the signature of a functor's operator()().
|
||||
*
|
||||
* libsigc++ defines numerous functors, closures and adaptors.
|
||||
* Since libsigc++ is a callback libaray, most functors are also closures.
|
||||
* The documentation doesn't distinguish between functors and closures.
|
||||
*
|
||||
* The basic functor types libsigc++ provides are created with ptr_fun() and mem_fun()
|
||||
* and can be converted into slots implicitly.
|
||||
* The set of adaptors that ships with libsigc++ is documented in the equally named module.
|
||||
*/
|
||||
|
||||
/** A hint to the compiler.
|
||||
* All functors which define @p result_type should publically inherit from this hint.
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
struct functor_base {};
|
||||
|
||||
|
||||
template <class T_functor, bool I_derives_functor_base=is_base_and_derived<functor_base,T_functor>::value>
|
||||
struct functor_trait
|
||||
{
|
||||
typedef void result_type;
|
||||
typedef T_functor functor_type;
|
||||
};
|
||||
|
||||
template <class T_functor>
|
||||
struct functor_trait<T_functor,true>
|
||||
{
|
||||
typedef typename T_functor::result_type result_type;
|
||||
typedef T_functor functor_type;
|
||||
};
|
||||
|
||||
/** If you want to mix functors from a different library with libsigc++ and
|
||||
* these functors define @p result_type simply use this macro inside namespace sigc like so:
|
||||
* @code
|
||||
* namespace sigc { SIGC_FUNCTORS_HAVE_RESULT_TYPE }
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
#define SIGC_FUNCTORS_HAVE_RESULT_TYPE \
|
||||
template <class T_functor> \
|
||||
struct functor_trait<T_functor,false> \
|
||||
{ \
|
||||
typedef typename T_functor::result_type result_type; \
|
||||
typedef T_functor functor_type; \
|
||||
};
|
||||
|
||||
/** If you want to mix functors from a different library with libsigc++ and
|
||||
* these functors don't define @p result_type use this macro inside namespace sigc
|
||||
* to expose the return type of the functors like so:
|
||||
* @code
|
||||
* namespace sigc {
|
||||
* SIGC_FUNCTOR_TRAIT(first_functor_type, return_type_of_first_functor_type)
|
||||
* SIGC_FUNCTOR_TRAIT(second_functor_type, return_type_of_second_functor_type)
|
||||
* ...
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
#define SIGC_FUNCTOR_TRAIT(T_functor,T_return) \
|
||||
template <> \
|
||||
struct functor_trait<T_functor,false> \
|
||||
{ \
|
||||
typedef T_return result_type; \
|
||||
typedef T_functor functor_type; \
|
||||
};
|
||||
|
||||
// detect the return type and the functor version of non-functor types.
|
||||
template <class T_return> class pointer_functor0;
|
||||
template <class T_return>
|
||||
struct functor_trait<T_return (*)(), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor0<T_return> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1, class T_return> class pointer_functor1;
|
||||
template <class T_arg1, class T_return>
|
||||
struct functor_trait<T_return (*)(T_arg1), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor1<T_arg1, T_return> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2, class T_return> class pointer_functor2;
|
||||
template <class T_arg1,class T_arg2, class T_return>
|
||||
struct functor_trait<T_return (*)(T_arg1,T_arg2), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor2<T_arg1,T_arg2, T_return> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return> class pointer_functor3;
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return>
|
||||
struct functor_trait<T_return (*)(T_arg1,T_arg2,T_arg3), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor3<T_arg1,T_arg2,T_arg3, T_return> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return> class pointer_functor4;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return>
|
||||
struct functor_trait<T_return (*)(T_arg1,T_arg2,T_arg3,T_arg4), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor4<T_arg1,T_arg2,T_arg3,T_arg4, T_return> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return> class pointer_functor5;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return>
|
||||
struct functor_trait<T_return (*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor5<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_return> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return> class pointer_functor6;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return>
|
||||
struct functor_trait<T_return (*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor6<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_return> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return> class pointer_functor7;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return>
|
||||
struct functor_trait<T_return (*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor7<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_return> functor_type;
|
||||
};
|
||||
|
||||
|
||||
template <class T_return, class T_obj> class mem_functor0;
|
||||
template <class T_return, class T_obj> class const_mem_functor0;
|
||||
template <class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor0<T_return, T_obj> functor_type;
|
||||
};
|
||||
template <class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)() const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor0<T_return, T_obj> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1, class T_return, class T_obj> class mem_functor1;
|
||||
template <class T_arg1, class T_return, class T_obj> class const_mem_functor1;
|
||||
template <class T_arg1, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor1<T_arg1, T_return, T_obj> functor_type;
|
||||
};
|
||||
template <class T_arg1, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1) const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor1<T_arg1, T_return, T_obj> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2, class T_return, class T_obj> class mem_functor2;
|
||||
template <class T_arg1,class T_arg2, class T_return, class T_obj> class const_mem_functor2;
|
||||
template <class T_arg1,class T_arg2, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor2<T_arg1,T_arg2, T_return, T_obj> functor_type;
|
||||
};
|
||||
template <class T_arg1,class T_arg2, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2) const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor2<T_arg1,T_arg2, T_return, T_obj> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return, class T_obj> class mem_functor3;
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return, class T_obj> class const_mem_functor3;
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor3<T_arg1,T_arg2,T_arg3, T_return, T_obj> functor_type;
|
||||
};
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3) const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor3<T_arg1,T_arg2,T_arg3, T_return, T_obj> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return, class T_obj> class mem_functor4;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return, class T_obj> class const_mem_functor4;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3,T_arg4), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor4<T_arg1,T_arg2,T_arg3,T_arg4, T_return, T_obj> functor_type;
|
||||
};
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3,T_arg4) const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor4<T_arg1,T_arg2,T_arg3,T_arg4, T_return, T_obj> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return, class T_obj> class mem_functor5;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return, class T_obj> class const_mem_functor5;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor5<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_return, T_obj> functor_type;
|
||||
};
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5) const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor5<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_return, T_obj> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return, class T_obj> class mem_functor6;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return, class T_obj> class const_mem_functor6;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor6<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_return, T_obj> functor_type;
|
||||
};
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6) const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor6<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_return, T_obj> functor_type;
|
||||
};
|
||||
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return, class T_obj> class mem_functor7;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return, class T_obj> class const_mem_functor7;
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor7<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_return, T_obj> functor_type;
|
||||
};
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return, class T_obj>
|
||||
struct functor_trait<T_return (T_obj::*)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7) const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor7<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_return, T_obj> functor_type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_FUNCTORS_MACROS_FUNCTOR_TRAITHM4_ */
|
||||
27
libs/sigc++2/sigc++/functors/functors.h
Normal file
27
libs/sigc++2/sigc++/functors/functors.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_FUNCTOR_HPP_
|
||||
#define _SIGC_FUNCTOR_HPP_
|
||||
|
||||
#include <sigc++/functors/slot.h>
|
||||
#include <sigc++/functors/ptr_fun.h>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
|
||||
#endif /* _SIGC_FUNCTOR_HPP_ */
|
||||
172
libs/sigc++2/sigc++/functors/macros/functor_trait.h.m4
Normal file
172
libs/sigc++2/sigc++/functors/macros/functor_trait.h.m4
Normal file
@@ -0,0 +1,172 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
include(template.macros.m4)
|
||||
|
||||
define([FUNCTOR_PTR_FUN],[dnl
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return)> class pointer_functor$1;
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return)>
|
||||
struct functor_trait<T_return (*)(LOOP(T_arg%1, $1)), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef pointer_functor$1<LIST(LOOP(T_arg%1, $1), T_return)> functor_type;
|
||||
};
|
||||
|
||||
])
|
||||
define([FUNCTOR_MEM_FUN],[dnl
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return, class T_obj)> class mem_functor$1;
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return, class T_obj)> class const_mem_functor$1;
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return, class T_obj)>
|
||||
struct functor_trait<T_return (T_obj::*)(LOOP(T_arg%1, $1)), false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef mem_functor$1<LIST(LOOP(T_arg%1, $1), T_return, T_obj)> functor_type;
|
||||
};
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return, class T_obj)>
|
||||
struct functor_trait<T_return (T_obj::*)(LOOP(T_arg%1, $1)) const, false>
|
||||
{
|
||||
typedef T_return result_type;
|
||||
typedef const_mem_functor$1<LIST(LOOP(T_arg%1, $1), T_return, T_obj)> functor_type;
|
||||
};
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
/*
|
||||
Trait functor_trait<functor>:
|
||||
|
||||
This trait allows the user to specific what is the return type
|
||||
of any type. It has been overloaded to detect the return type and
|
||||
the functor version of function pointers and class methods as well.
|
||||
|
||||
To populate the return type of user defined and third party functors
|
||||
use the macro SIGC_FUNCTOR_TRAIT(T_functor,T_return) in
|
||||
namespace sigc. Multi-type functors are only partly supported.
|
||||
Try specifying the return type of the functor's operator()() overload.
|
||||
|
||||
Alternatively, you can derive your functors from functor_base and
|
||||
place "typedef T_return result_type;" in the class definition.
|
||||
|
||||
Use SIGC_FUNCTORS_HAVE_RESULT_TYPE if you want sigc++ to assume that
|
||||
result_type is defined in all user defined or 3rd-party functors
|
||||
(except those you specify a return type explicitly with SIGC_FUNCTOR_TRAIT()).
|
||||
|
||||
dnl 01.11.2003: Completely removed support for typeof() since it is non-standard!
|
||||
dnl You might get away without these conventions if your compiler supports
|
||||
dnl typeof() and if you don't happen to use the operator()() overload of
|
||||
dnl sigc++'s adaptors in your program.
|
||||
dnl
|
||||
*/
|
||||
__FIREWALL__
|
||||
#include <sigc++/type_traits.h>
|
||||
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** nil struct type.
|
||||
* The nil struct type is used as default template argument in the
|
||||
* unnumbered sigc::signal and sigc::slot templates.
|
||||
*
|
||||
* @ingroup signal
|
||||
* @ingroup slot
|
||||
*/
|
||||
struct nil;
|
||||
|
||||
|
||||
/** @defgroup functors Functors
|
||||
* Functors are copyable types that define operator()().
|
||||
*
|
||||
* Types that define operator()() overloads with different return types are referred to
|
||||
* as multi-type functors. Multi-type functors are only partly supported in libsigc++.
|
||||
*
|
||||
* Closures are functors that store all information needed to invoke a callback from operator()().
|
||||
*
|
||||
* Adaptors are functors that alter the signature of a functor's operator()().
|
||||
*
|
||||
* libsigc++ defines numerous functors, closures and adaptors.
|
||||
* Since libsigc++ is a callback libaray, most functors are also closures.
|
||||
* The documentation doesn't distinguish between functors and closures.
|
||||
*
|
||||
* The basic functor types libsigc++ provides are created with ptr_fun() and mem_fun()
|
||||
* and can be converted into slots implicitly.
|
||||
* The set of adaptors that ships with libsigc++ is documented in the equally named module.
|
||||
*/
|
||||
|
||||
/** A hint to the compiler.
|
||||
* All functors which define @p result_type should publically inherit from this hint.
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
struct functor_base {};
|
||||
|
||||
|
||||
template <class T_functor, bool I_derives_functor_base=is_base_and_derived<functor_base,T_functor>::value>
|
||||
struct functor_trait
|
||||
{
|
||||
typedef void result_type;
|
||||
typedef T_functor functor_type;
|
||||
};
|
||||
|
||||
template <class T_functor>
|
||||
struct functor_trait<T_functor,true>
|
||||
{
|
||||
typedef typename T_functor::result_type result_type;
|
||||
typedef T_functor functor_type;
|
||||
};
|
||||
|
||||
/** If you want to mix functors from a different library with libsigc++ and
|
||||
* these functors define @p result_type simply use this macro inside namespace sigc like so:
|
||||
* @code
|
||||
* namespace sigc { SIGC_FUNCTORS_HAVE_RESULT_TYPE }
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
#define SIGC_FUNCTORS_HAVE_RESULT_TYPE \
|
||||
template <class T_functor> \
|
||||
struct functor_trait<T_functor,false> \
|
||||
{ \
|
||||
typedef typename T_functor::result_type result_type; \
|
||||
typedef T_functor functor_type; \
|
||||
};
|
||||
|
||||
/** If you want to mix functors from a different library with libsigc++ and
|
||||
* these functors don't define @p result_type use this macro inside namespace sigc
|
||||
* to expose the return type of the functors like so:
|
||||
* @code
|
||||
* namespace sigc {
|
||||
* SIGC_FUNCTOR_TRAIT(first_functor_type, return_type_of_first_functor_type)
|
||||
* SIGC_FUNCTOR_TRAIT(second_functor_type, return_type_of_second_functor_type)
|
||||
* ...
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
#define SIGC_FUNCTOR_TRAIT(T_functor,T_return) \
|
||||
template <> \
|
||||
struct functor_trait<T_functor,false> \
|
||||
{ \
|
||||
typedef T_return result_type; \
|
||||
typedef T_functor functor_type; \
|
||||
};
|
||||
|
||||
// detect the return type and the functor version of non-functor types.
|
||||
FOR(0,CALL_SIZE,[[FUNCTOR_PTR_FUN(%1)]])
|
||||
FOR(0,CALL_SIZE,[[FUNCTOR_MEM_FUN(%1)]])
|
||||
|
||||
} /* namespace sigc */
|
||||
272
libs/sigc++2/sigc++/functors/macros/mem_fun.h.m4
Normal file
272
libs/sigc++2/sigc++/functors/macros/mem_fun.h.m4
Normal file
@@ -0,0 +1,272 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([MEMBER_FUNCTOR],[dnl
|
||||
/** [$2]mem_functor$1 wraps $4 methods with $1 argument(s).
|
||||
* Use the convenience function mem_fun() to create an instance of [$2]mem_functor$1.
|
||||
*
|
||||
* The following template arguments are used:dnl
|
||||
FOR(1,$1,[
|
||||
* - @e T_arg%1 Argument type used in the definition of operator()().])
|
||||
* - @e T_return The return type of operator()().
|
||||
* - @e T_obj The object type.
|
||||
*
|
||||
* @ingroup mem_fun
|
||||
*/
|
||||
template <LIST(class T_return, class T_obj, LOOP(class T_arg%1, $1))>
|
||||
class [$2]mem_functor$1 : public functor_base
|
||||
{
|
||||
public:
|
||||
typedef T_return (T_obj::*function_type)(LOOP(T_arg%1, $1)) $4;
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
[$2]mem_functor$1() : func_ptr_(0) {}
|
||||
|
||||
/** Constructs a [$2]mem_functor$1 object that wraps the passed method.
|
||||
* @param _A_func Pointer to method will be invoked from operator()().
|
||||
*/
|
||||
explicit [$2]mem_functor$1(function_type _A_func) : func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped method operating on the passed instance.
|
||||
* @param _A_obj Pointer to instance the method should operate on.dnl
|
||||
FOR(1, $1,[
|
||||
* @param _A_a%1 Argument to be passed on to the method.])
|
||||
* @return The return value of the method invocation.
|
||||
*/
|
||||
T_return operator()(LIST($3 T_obj* _A_obj, LOOP(typename type_trait<T_arg%1>::take _A_a%1, $1))) const
|
||||
{ return (_A_obj->*(this->func_ptr_))(LOOP(_A_a%1, $1)); }
|
||||
|
||||
/** Execute the wrapped method operating on the passed instance.
|
||||
* @param _A_obj Reference to instance the method should operate on.dnl
|
||||
FOR(1, $1,[
|
||||
* @param _A_a%1 Argument to be passed on to the method.])
|
||||
* @return The return value of the method invocation.
|
||||
*/
|
||||
T_return operator()(LIST($3 T_obj& _A_obj, LOOP(typename type_trait<T_arg%1>::take _A_a%1, $1))) const
|
||||
{ return (_A_obj.*func_ptr_)(LOOP(_A_a%1, $1)); }
|
||||
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
};
|
||||
|
||||
])
|
||||
define([BOUND_MEMBER_FUNCTOR],[dnl
|
||||
|
||||
/** bound_[$2]mem_functor$1 encapsulates a $4 method with $1 arguments and an object instance.
|
||||
* Use the convenience function mem_fun() to create an instance of bound_[$2]mem_functor$1.
|
||||
*
|
||||
* The following template arguments are used:dnl
|
||||
FOR(1,$1,[
|
||||
* - @e T_arg%1 Argument type used in the definition of operator()().])
|
||||
* - @e T_return The return type of operator()().
|
||||
* - @e T_obj The object type.
|
||||
*
|
||||
* @ingroup mem_fun
|
||||
*/
|
||||
template <LIST(class T_return, class T_obj, LOOP(class T_arg%1, $1))>
|
||||
class bound_[$2]mem_functor$1
|
||||
: public [$2]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>
|
||||
{
|
||||
typedef [$2]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))> base_type_;
|
||||
public:
|
||||
typedef typename base_type_::function_type function_type;
|
||||
|
||||
/** Constructs a bound_[$2]mem_functor$1 object that wraps the passed method.
|
||||
* @param _A_obj Pointer to instance the method will operate on.
|
||||
* @param _A_func Pointer to method will be invoked from operator()().
|
||||
*/
|
||||
bound_[$2]mem_functor$1($3 T_obj* _A_obj, function_type _A_func)
|
||||
: base_type_(_A_func),
|
||||
obj_(*_A_obj)
|
||||
{}
|
||||
|
||||
/** Constructs a bound_[$2]mem_functor$1 object that wraps the passed method.
|
||||
* @param _A_obj Reference to instance the method will operate on.
|
||||
* @param _A_func Pointer to method will be invoked from operator()().
|
||||
*/
|
||||
bound_[$2]mem_functor$1($3 T_obj& _A_obj, function_type _A_func)
|
||||
: base_type_(_A_func),
|
||||
obj_(_A_obj)
|
||||
{}
|
||||
|
||||
/** Execute the wrapped method operating on the stored instance.dnl
|
||||
FOR(1, $1,[
|
||||
* @param _A_a%1 Argument to be passed on to the method.])
|
||||
* @return The return value of the method invocation.
|
||||
*/
|
||||
T_return operator()(LOOP(typename type_trait<T_arg%1>::take _A_a%1, $1)) const
|
||||
{ return (obj_.invoke().*(this->func_ptr_))(LOOP(_A_a%1, $1)); }
|
||||
|
||||
//protected:
|
||||
// Reference to stored object instance.
|
||||
// This is the handler object, such as TheObject in void TheObject::signal_handler().
|
||||
[$2]limit_reference<T_obj> obj_;
|
||||
};
|
||||
|
||||
//template specialization of visit_each<>(action, functor):
|
||||
/** Performs a functor on each of the targets of a functor.
|
||||
* The function overload for sigc::bound_[$2]mem_functor performs a functor
|
||||
* on the object instance stored in the sigc::bound_[$2]mem_functor object.
|
||||
*
|
||||
* @ingroup mem_fun
|
||||
*/
|
||||
template <LIST(class T_action, class T_return, class T_obj, LOOP(class T_arg%1, $1))>
|
||||
void visit_each(const T_action& _A_action,
|
||||
const bound_[$2]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>& _A_target)
|
||||
{
|
||||
sigc::visit_each(_A_action, _A_target.obj_);
|
||||
}
|
||||
|
||||
])
|
||||
|
||||
define([MEM_FUN],[dnl
|
||||
/** Creates a functor of type sigc::[$3]mem_functor$1 which wraps a $5 method.
|
||||
* @param _A_func Pointer to method that should be wrapped.
|
||||
* @return Functor that executes _A_func on invokation.
|
||||
*
|
||||
* @ingroup mem_fun
|
||||
*/
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return, class T_obj)>
|
||||
inline [$3]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>
|
||||
mem_fun[]ifelse($2,, $1)(T_return (T_obj::*_A_func)(LOOP(T_arg%1,$1)) $5)
|
||||
{ return [$3]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>(_A_func); }
|
||||
|
||||
])
|
||||
define([BOUND_MEM_FUN],[dnl
|
||||
/** Creates a functor of type sigc::bound_[$3]mem_functor$1 which encapsulates a method and an object instance.
|
||||
* @param _A_obj Pointer to object instance the functor should operate on.
|
||||
* @param _A_func Pointer to method that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup mem_fun
|
||||
*/
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return, class T_obj, class T_obj2)>
|
||||
inline bound_[$3]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>
|
||||
mem_fun[]ifelse($2,, $1)(/*$4*/ T_obj* _A_obj, T_return (T_obj2::*_A_func)(LOOP(T_arg%1,$1)) $5)
|
||||
{ return bound_[$3]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>(_A_obj, _A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::bound_[$3]mem_functor$1 which encapsulates a method and an object instance.
|
||||
* @param _A_obj Reference to object instance the functor should operate on.
|
||||
* @param _A_func Pointer to method that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup mem_fun
|
||||
*/
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return, class T_obj, class T_obj2)>
|
||||
inline bound_[$3]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>
|
||||
mem_fun[]ifelse($2,, $1)(/*$4*/ T_obj& _A_obj, T_return (T_obj2::*_A_func)(LOOP(T_arg%1,$1)) $5)
|
||||
{ return bound_[$3]mem_functor$1<LIST(T_return, T_obj, LOOP(T_arg%1, $1))>(_A_obj, _A_func); }
|
||||
|
||||
])
|
||||
|
||||
divert(0)
|
||||
|
||||
// implementation notes:
|
||||
// - we do not use bind here, because it would introduce
|
||||
// an extra copy and complicate the header include order if bind is
|
||||
// to have automatic conversion for member pointers.
|
||||
__FIREWALL__
|
||||
#include <sigc++/type_traits.h>
|
||||
#include <sigc++/functors/functor_trait.h>
|
||||
#include <sigc++/limit_reference.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup mem_fun mem_fun()
|
||||
* mem_fun() is used to convert a pointer to a method to a functor.
|
||||
*
|
||||
* Optionally a reference or pointer to an object can be bound to the functor.
|
||||
* Note that only if the object type inherits from sigc::trackable
|
||||
* the slot is cleared automatically when the object goes out of scope!
|
||||
*
|
||||
* If the member function pointer is to an overloaded type, you must specify
|
||||
* the types using template arguments starting with the first argument.
|
||||
* It is not necessary to supply the return type.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct foo : public sigc::trackable
|
||||
* {
|
||||
* void bar(int) {}
|
||||
* };
|
||||
* foo my_foo;
|
||||
* sigc::slot<void, int> sl = sigc::mem_fun(my_foo, &foo::bar);
|
||||
* @endcode
|
||||
*
|
||||
* For const methods mem_fun() takes a const reference or pointer to an object.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct foo : public sigc::trackable
|
||||
* {
|
||||
* void bar(int) const {}
|
||||
* };
|
||||
* const foo my_foo;
|
||||
* sigc::slot<void, int> sl = sigc::mem_fun(my_foo, &foo::bar);
|
||||
* @endcode
|
||||
*
|
||||
* Use mem_fun#() if there is an abiguity as to the number of arguments.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct foo : public sigc::trackable
|
||||
* {
|
||||
* void bar(int) {}
|
||||
* void bar(float) {}
|
||||
* void bar(int, int) {}
|
||||
* };
|
||||
* foo my_foo;
|
||||
* sigc::slot<void, int> sl = sigc::mem_fun1<int>(my_foo, &foo::bar);
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
|
||||
FOR(0,CALL_SIZE,[[MEMBER_FUNCTOR(%1,[],[],[])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEMBER_FUNCTOR(%1,[const_],[const],[const])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEMBER_FUNCTOR(%1,[volatile_],[],[volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEMBER_FUNCTOR(%1,[const_volatile_],[const],[const volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEMBER_FUNCTOR(%1,[],[],[])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEMBER_FUNCTOR(%1,[const_],[const],[const])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEMBER_FUNCTOR(%1,[volatile_],[],[volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEMBER_FUNCTOR(%1,[const_volatile_],[const],[const volatile])]])dnl
|
||||
|
||||
// numbered
|
||||
FOR(0,CALL_SIZE,[[MEM_FUN(%1,,[],[],[])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEM_FUN(%1,,[const_],[const],[const])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEM_FUN(%1,,[volatile_],[],[volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEM_FUN(%1,,[const_volatile_],[const],[const volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEM_FUN(%1,,[],[],[])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEM_FUN(%1,,[const_],[const],[const])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEM_FUN(%1,,[volatile_],[],[volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEM_FUN(%1,,[const_volatile_],[const],[const volatile])]])dnl
|
||||
|
||||
// unnumbered
|
||||
FOR(0,CALL_SIZE,[[MEM_FUN(%1,1,[],[],[])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEM_FUN(%1,1,[const_],[const],[const])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEM_FUN(%1,1,[volatile_],[],[volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[MEM_FUN(%1,1,[const_volatile_],[const],[const volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEM_FUN(%1,1,[],[],[])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEM_FUN(%1,1,[const_],[const],[const])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEM_FUN(%1,1,[volatile_],[],[volatile])]])dnl
|
||||
FOR(0,CALL_SIZE,[[BOUND_MEM_FUN(%1,1,[const_volatile_],[const],[const volatile])]])dnl
|
||||
|
||||
} /* namespace sigc */
|
||||
126
libs/sigc++2/sigc++/functors/macros/ptr_fun.h.m4
Normal file
126
libs/sigc++2/sigc++/functors/macros/ptr_fun.h.m4
Normal file
@@ -0,0 +1,126 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([POINTER_FUNCTOR],[dnl
|
||||
/** pointer_functor$1 wraps existing non-member functions with $1 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor$1.
|
||||
*
|
||||
* The following template arguments are used:dnl
|
||||
FOR(1,$1,[
|
||||
* - @e T_arg%1 Argument type used in the definition of operator()().])
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return)>
|
||||
class pointer_functor$1 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)(LOOP(T_arg%1, $1));
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor$1() {}
|
||||
|
||||
/** Constructs a pointer_functor$1 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor$1(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.dnl
|
||||
FOR(1, $1,[
|
||||
* @param _A_a%1 Argument to be passed on to the function.])
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()(LOOP(typename type_trait<T_arg%1>::take _A_a%1, $1)) const
|
||||
{ return func_ptr_(LOOP(_A_a%1, $1)); }
|
||||
};
|
||||
|
||||
])
|
||||
|
||||
define([PTR_FUN],[dnl
|
||||
/** Creates a functor of type sigc::pointer_functor$1 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <LIST(LOOP(class T_arg%1, $1), class T_return)>
|
||||
inline pointer_functor$1<LIST(LOOP(T_arg%1, $1), T_return)>
|
||||
ptr_fun[]ifelse($2,, $1)(T_return (*_A_func)(LOOP(T_arg%1,$1)))
|
||||
{ return pointer_functor$1<LIST(LOOP(T_arg%1, $1), T_return)>(_A_func); }
|
||||
|
||||
])
|
||||
|
||||
divert(0)
|
||||
__FIREWALL__
|
||||
#include <sigc++/type_traits.h>
|
||||
#include <sigc++/functors/functor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup ptr_fun ptr_fun()
|
||||
* ptr_fun() is used to convert a pointer to a function to a functor.
|
||||
* If the function pointer is to an overloaded type, you must specify
|
||||
* the types using template arguments starting with the first argument.
|
||||
* It is not necessary to supply the return type.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* void foo(int) {}
|
||||
* sigc::slot<void, int> sl = sigc::ptr_fun(&foo);
|
||||
* @endcode
|
||||
*
|
||||
* Use ptr_fun#() if there is an abiguity as to the number of arguments.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* void foo(int) {} // choose this one
|
||||
* void foo(float) {}
|
||||
* void foo(int, int) {}
|
||||
* sigc::slot<void, long> sl = sigc::ptr_fun1<int>(&foo);
|
||||
* @endcode
|
||||
*
|
||||
* ptr_fun() can also be used to convert a pointer to a static member
|
||||
* function to a functor, like so:
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct foo
|
||||
* {
|
||||
* static void bar(int) {}
|
||||
* };
|
||||
* sigc::slot<void, int> sl = sigc::ptr_fun(&foo::bar);
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
|
||||
FOR(0,CALL_SIZE,[[POINTER_FUNCTOR(%1)]])dnl
|
||||
|
||||
// numbered ptr_fun
|
||||
FOR(0,CALL_SIZE,[[PTR_FUN(%1)]])dnl
|
||||
|
||||
// unnumbered ptr_fun
|
||||
FOR(0,CALL_SIZE,[[PTR_FUN(%1,1)]])dnl
|
||||
|
||||
} /* namespace sigc */
|
||||
289
libs/sigc++2/sigc++/functors/macros/slot.h.m4
Normal file
289
libs/sigc++2/sigc++/functors/macros/slot.h.m4
Normal file
@@ -0,0 +1,289 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([SLOT_N],[dnl
|
||||
/** Converts an arbitrary functor to a unified type which is opaque.
|
||||
* sigc::slot itself is a functor or to be more precise a closure. It contains
|
||||
* a single, arbitrary functor (or closure) that is executed in operator()().
|
||||
*
|
||||
* The template arguments determine the function signature of operator()():
|
||||
* - @e T_return The return type of operator()().dnl
|
||||
FOR(1,$1,[
|
||||
* - @e T_arg%1 Argument type used in the definition of operator()(). The default @p nil means no argument.])
|
||||
*
|
||||
* To use simply assign the slot to the desired functor. If the functor
|
||||
* is not compatible with the parameter list defined with the template
|
||||
* arguments compiler errors are triggered. When called the slot
|
||||
* will invoke the functor with minimal copies.
|
||||
* block() and unblock() can be used to block the functor's invocation
|
||||
* from operator()() temporarily.
|
||||
*
|
||||
* You should use the more convenient unnumbered sigc::slot template.
|
||||
*
|
||||
* @ingroup slot
|
||||
*/
|
||||
/* TODO: Where put the following bit of information? I can't make any
|
||||
* sense of the "because", by the way!
|
||||
*
|
||||
* Because slot is opaque, visit_each() will not visit its internal members.
|
||||
*/
|
||||
template <LIST(class T_return, LOOP(class T_arg%1, $1))>
|
||||
class slot$1
|
||||
: public slot_base
|
||||
{
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
FOR(1, $1,[ typedef _R_(T_arg%1) arg%1_type_;
|
||||
])
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
private:
|
||||
typedef internal::slot_rep rep_type;
|
||||
public:
|
||||
typedef T_return (*call_type)(LIST(rep_type*, LOOP(arg%1_type_, $1)));
|
||||
#endif
|
||||
|
||||
/** Invoke the contained functor unless slot is in blocking state.dnl
|
||||
FOR(1, $1,[
|
||||
* @param _A_a%1 Argument to be passed on to the functor.])
|
||||
* @return The return value of the functor invocation.
|
||||
*/
|
||||
inline T_return operator()(LOOP(arg%1_type_ _A_a%1, $1)) const
|
||||
{
|
||||
if (!empty() && !blocked())
|
||||
return (reinterpret_cast<call_type>(slot_base::rep_->call_))(LIST(slot_base::rep_, LOOP(_A_a%1, $1)));
|
||||
return T_return();
|
||||
}
|
||||
|
||||
inline slot$1() {}
|
||||
|
||||
/** Constructs a slot from an arbitrary functor.
|
||||
* @param _A_func The desirer functor the new slot should be assigned to.
|
||||
*/
|
||||
template <class T_functor>
|
||||
slot$1(const T_functor& _A_func)
|
||||
: slot_base(new internal::typed_slot_rep<T_functor>(_A_func))
|
||||
{
|
||||
//The slot_base:: is necessary to stop the HP-UX aCC compiler from being confused. murrayc.
|
||||
slot_base::rep_->call_ = internal::slot_call$1<LIST(T_functor, T_return, LOOP(T_arg%1, $1))>::address();
|
||||
}
|
||||
|
||||
slot$1(const slot$1& src)
|
||||
: slot_base(src) {}
|
||||
|
||||
/** Overrides this slot making a copy from another slot.
|
||||
* @param src The slot from which to make a copy.
|
||||
* @return @p this.
|
||||
*/
|
||||
slot$1& operator=(const slot$1& src)
|
||||
{ slot_base::operator=(src); return *this; }
|
||||
};
|
||||
|
||||
])
|
||||
define([SLOT],[dnl
|
||||
ifelse($1, $2,[dnl
|
||||
/** Convenience wrapper for the numbered sigc::slot# templates.
|
||||
* Slots convert arbitrary functors to unified types which are opaque.
|
||||
* sigc::slot itself is a functor or to be more precise a closure. It contains
|
||||
* a single, arbitrary functor (or closure) that is executed in operator()().
|
||||
*
|
||||
* The template arguments determine the function signature of operator()():
|
||||
* - @e T_return The return type of operator()().dnl
|
||||
FOR(1,$1,[
|
||||
* - @e T_arg%1 Argument type used in the definition of operator()(). The default @p nil means no argument.])
|
||||
*
|
||||
* To use simply assign the slot to the desired functor. If the functor
|
||||
* is not compatible with the parameter list defined with the template
|
||||
* arguments compiler errors are triggered. When called the slot
|
||||
* will invoke the functor with minimal copies.
|
||||
* block() and unblock() can be used to block the functor's invocation
|
||||
* from operator()() temporarily.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* void foo(int) {}
|
||||
* sigc::slot<void, long> s = sigc::ptr_fun(&foo);
|
||||
* s(19);
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup slot
|
||||
*/
|
||||
template <LIST(class T_return, LOOP(class T_arg%1 = nil, $1))>],[dnl
|
||||
|
||||
/** Convenience wrapper for the numbered sigc::slot$1 template.
|
||||
* See the base class for useful methods.
|
||||
* This is the template specialization of the unnumbered sigc::slot
|
||||
* template for $1 argument(s), specialized for different numbers of arguments
|
||||
* This is possible because the template has default (nil) template types.
|
||||
dnl *
|
||||
dnl * @ingroup slot
|
||||
*/
|
||||
template <LIST(class T_return, LOOP(class T_arg%1, $1))>])
|
||||
class slot ifelse($1, $2,,[<LIST(T_return, LIST(LOOP(T_arg%1, $1), LOOP(nil, CALL_SIZE - $1)))>])
|
||||
: public slot$1<LIST(T_return, LOOP(T_arg%1, $1))>
|
||||
{
|
||||
public:
|
||||
typedef slot$1<LIST(T_return, LOOP(T_arg%1, $1))> parent_type;
|
||||
|
||||
inline slot() {}
|
||||
|
||||
/** Constructs a slot from an arbitrary functor.
|
||||
* @param _A_func The desirer functor the new slot should be assigned to.
|
||||
*/
|
||||
template <class T_functor>
|
||||
slot(const T_functor& _A_func)
|
||||
: parent_type(_A_func) {}
|
||||
|
||||
slot(const slot& src)
|
||||
: parent_type(reinterpret_cast<const parent_type&>(src)) {}
|
||||
};
|
||||
|
||||
])
|
||||
define([SLOT_CALL],[dnl
|
||||
/** Abstracts functor execution.
|
||||
* call_it() invokes a functor of type @e T_functor with a list of
|
||||
* parameters whose types are given by the template arguments.
|
||||
* address() forms a function pointer from call_it().
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_functor The functor type.
|
||||
* - @e T_return The return type of call_it().dnl
|
||||
FOR(1,$1,[
|
||||
* - @e T_arg%1 Argument type used in the definition of call_it().])
|
||||
*
|
||||
*/
|
||||
template<LIST(class T_functor, class T_return, LOOP(class T_arg%1, $1))>
|
||||
struct slot_call$1
|
||||
{
|
||||
/** Invokes a functor of type @p T_functor.
|
||||
* @param rep slot_rep object that holds a functor of type @p T_functor.dnl
|
||||
FOR(1, $1,[
|
||||
* @param _A_a%1 Argument to be passed on to the functor.])
|
||||
* @return The return values of the functor invocation.
|
||||
*/
|
||||
static T_return call_it(LIST(slot_rep* rep, LOOP(_R_(T_arg%1) a_%1, $1)))
|
||||
{
|
||||
typedef typed_slot_rep<T_functor> typed_slot;
|
||||
typed_slot *typed_rep = static_cast<typed_slot*>(rep);dnl
|
||||
ifelse($1,0,[
|
||||
return (typed_rep->functor_)();
|
||||
],[
|
||||
return (typed_rep->functor_).SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP([_R_(T_arg%1)],$1)>
|
||||
(LOOP(a_%1, $1));
|
||||
])dnl
|
||||
}
|
||||
|
||||
/** Forms a function pointer from call_it().
|
||||
* @return A function pointer formed from call_it().
|
||||
*/
|
||||
static hook address()
|
||||
{ return reinterpret_cast<hook>(&call_it); }
|
||||
};
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/trackable.h>
|
||||
#include <sigc++/visit_each.h>
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/functors/slot_base.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
namespace internal {
|
||||
|
||||
/** A typed slot_rep.
|
||||
* A typed slot_rep holds a functor that can be invoked from
|
||||
* slot::operator()(). visit_each() is used to visit the functor's
|
||||
* targets that inherit trackable recursively and register the
|
||||
* notification callback. Consequently the slot_rep object will be
|
||||
* notified when some referred object is destroyed or overwritten.
|
||||
*/
|
||||
template <class T_functor>
|
||||
struct typed_slot_rep : public slot_rep
|
||||
{
|
||||
typedef typed_slot_rep<T_functor> self;
|
||||
|
||||
/* Use an adaptor type so that arguments can be passed as const references
|
||||
* through explicit template instantiation from slot_call#::call_it() */
|
||||
typedef typename adaptor_trait<T_functor>::adaptor_type adaptor_type;
|
||||
|
||||
/** The functor contained by this slot_rep object. */
|
||||
adaptor_type functor_;
|
||||
|
||||
/** Constructs an invalid typed slot_rep object.
|
||||
* The notification callback is registered using visit_each().
|
||||
* @param functor The functor contained by the new slot_rep object.
|
||||
*/
|
||||
inline typed_slot_rep(const T_functor& functor)
|
||||
: slot_rep(0, &destroy, &dup), functor_(functor)
|
||||
{ visit_each_type<trackable*>(slot_do_bind(this), functor_); }
|
||||
|
||||
inline typed_slot_rep(const typed_slot_rep& cl)
|
||||
: slot_rep(cl.call_, &destroy, &dup), functor_(cl.functor_)
|
||||
{ visit_each_type<trackable*>(slot_do_bind(this), functor_); }
|
||||
|
||||
inline ~typed_slot_rep()
|
||||
{
|
||||
call_ = 0;
|
||||
destroy_ = 0;
|
||||
visit_each_type<trackable*>(slot_do_unbind(this), functor_);
|
||||
}
|
||||
|
||||
/** Detaches the stored functor from the other referred trackables and destroys it.
|
||||
* This does not destroy the base slot_rep object.
|
||||
*/
|
||||
static void* destroy(void* data)
|
||||
{
|
||||
self* self_ = static_cast<self*>(reinterpret_cast<slot_rep*>(data));
|
||||
self_->call_ = 0;
|
||||
self_->destroy_ = 0;
|
||||
visit_each_type<trackable*>(slot_do_unbind(self_), self_->functor_);
|
||||
self_->functor_.~adaptor_type();
|
||||
/* don't call disconnect() here: destroy() is either called
|
||||
* a) from the parent itself (in which case disconnect() leads to a segfault) or
|
||||
* b) from a parentless slot (in which case disconnect() does nothing)
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Makes a deep copy of the slot_rep object.
|
||||
* Deep copy means that the notification callback of the new
|
||||
* slot_rep object is registered in the referred trackables.
|
||||
* @return A deep copy of the slot_rep object.
|
||||
*/
|
||||
static void* dup(void* data)
|
||||
{
|
||||
slot_rep* a_rep = reinterpret_cast<slot_rep*>(data);
|
||||
return static_cast<slot_rep*>(new self(*static_cast<self*>(a_rep)));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
FOR(0,CALL_SIZE,[[SLOT_CALL(%1)]])dnl
|
||||
} /* namespace internal */
|
||||
|
||||
|
||||
FOR(0,CALL_SIZE,[[SLOT_N(%1,CALL_SIZE)]])
|
||||
SLOT(CALL_SIZE,CALL_SIZE)
|
||||
FOR(0,eval(CALL_SIZE-1),[[SLOT(%1,CALL_SIZE)]])
|
||||
|
||||
} /* namespace sigc */
|
||||
6201
libs/sigc++2/sigc++/functors/mem_fun.h
Normal file
6201
libs/sigc++2/sigc++/functors/mem_fun.h
Normal file
File diff suppressed because it is too large
Load Diff
542
libs/sigc++2/sigc++/functors/ptr_fun.h
Normal file
542
libs/sigc++2/sigc++/functors/ptr_fun.h
Normal file
@@ -0,0 +1,542 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
|
||||
#ifndef _SIGC_FUNCTORS_MACROS_PTR_FUNHM4_
|
||||
#define _SIGC_FUNCTORS_MACROS_PTR_FUNHM4_
|
||||
#include <sigc++/type_traits.h>
|
||||
#include <sigc++/functors/functor_trait.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** @defgroup ptr_fun ptr_fun()
|
||||
* ptr_fun() is used to convert a pointer to a function to a functor.
|
||||
* If the function pointer is to an overloaded type, you must specify
|
||||
* the types using template arguments starting with the first argument.
|
||||
* It is not necessary to supply the return type.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* void foo(int) {}
|
||||
* sigc::slot<void, int> sl = sigc::ptr_fun(&foo);
|
||||
* @endcode
|
||||
*
|
||||
* Use ptr_fun#() if there is an abiguity as to the number of arguments.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* void foo(int) {} // choose this one
|
||||
* void foo(float) {}
|
||||
* void foo(int, int) {}
|
||||
* sigc::slot<void, long> sl = sigc::ptr_fun1<int>(&foo);
|
||||
* @endcode
|
||||
*
|
||||
* ptr_fun() can also be used to convert a pointer to a static member
|
||||
* function to a functor, like so:
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct foo
|
||||
* {
|
||||
* static void bar(int) {}
|
||||
* };
|
||||
* sigc::slot<void, int> sl = sigc::ptr_fun(&foo::bar);
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
|
||||
/** pointer_functor0 wraps existing non-member functions with 0 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor0.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_return>
|
||||
class pointer_functor0 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)();
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor0() {}
|
||||
|
||||
/** Constructs a pointer_functor0 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor0(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()() const
|
||||
{ return func_ptr_(); }
|
||||
};
|
||||
|
||||
/** pointer_functor1 wraps existing non-member functions with 1 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor1.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_arg1 Argument type used in the definition of operator()().
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1, class T_return>
|
||||
class pointer_functor1 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)(T_arg1);
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor1() {}
|
||||
|
||||
/** Constructs a pointer_functor1 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor1(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.
|
||||
* @param _A_a1 Argument to be passed on to the function.
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()(typename type_trait<T_arg1>::take _A_a1) const
|
||||
{ return func_ptr_(_A_a1); }
|
||||
};
|
||||
|
||||
/** pointer_functor2 wraps existing non-member functions with 2 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor2.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_arg1 Argument type used in the definition of operator()().
|
||||
* - @e T_arg2 Argument type used in the definition of operator()().
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2, class T_return>
|
||||
class pointer_functor2 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)(T_arg1,T_arg2);
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor2() {}
|
||||
|
||||
/** Constructs a pointer_functor2 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor2(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.
|
||||
* @param _A_a1 Argument to be passed on to the function.
|
||||
* @param _A_a2 Argument to be passed on to the function.
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2) const
|
||||
{ return func_ptr_(_A_a1,_A_a2); }
|
||||
};
|
||||
|
||||
/** pointer_functor3 wraps existing non-member functions with 3 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor3.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_arg1 Argument type used in the definition of operator()().
|
||||
* - @e T_arg2 Argument type used in the definition of operator()().
|
||||
* - @e T_arg3 Argument type used in the definition of operator()().
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return>
|
||||
class pointer_functor3 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)(T_arg1,T_arg2,T_arg3);
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor3() {}
|
||||
|
||||
/** Constructs a pointer_functor3 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor3(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.
|
||||
* @param _A_a1 Argument to be passed on to the function.
|
||||
* @param _A_a2 Argument to be passed on to the function.
|
||||
* @param _A_a3 Argument to be passed on to the function.
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3) const
|
||||
{ return func_ptr_(_A_a1,_A_a2,_A_a3); }
|
||||
};
|
||||
|
||||
/** pointer_functor4 wraps existing non-member functions with 4 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor4.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_arg1 Argument type used in the definition of operator()().
|
||||
* - @e T_arg2 Argument type used in the definition of operator()().
|
||||
* - @e T_arg3 Argument type used in the definition of operator()().
|
||||
* - @e T_arg4 Argument type used in the definition of operator()().
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return>
|
||||
class pointer_functor4 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)(T_arg1,T_arg2,T_arg3,T_arg4);
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor4() {}
|
||||
|
||||
/** Constructs a pointer_functor4 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor4(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.
|
||||
* @param _A_a1 Argument to be passed on to the function.
|
||||
* @param _A_a2 Argument to be passed on to the function.
|
||||
* @param _A_a3 Argument to be passed on to the function.
|
||||
* @param _A_a4 Argument to be passed on to the function.
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4) const
|
||||
{ return func_ptr_(_A_a1,_A_a2,_A_a3,_A_a4); }
|
||||
};
|
||||
|
||||
/** pointer_functor5 wraps existing non-member functions with 5 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor5.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_arg1 Argument type used in the definition of operator()().
|
||||
* - @e T_arg2 Argument type used in the definition of operator()().
|
||||
* - @e T_arg3 Argument type used in the definition of operator()().
|
||||
* - @e T_arg4 Argument type used in the definition of operator()().
|
||||
* - @e T_arg5 Argument type used in the definition of operator()().
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return>
|
||||
class pointer_functor5 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5);
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor5() {}
|
||||
|
||||
/** Constructs a pointer_functor5 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor5(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.
|
||||
* @param _A_a1 Argument to be passed on to the function.
|
||||
* @param _A_a2 Argument to be passed on to the function.
|
||||
* @param _A_a3 Argument to be passed on to the function.
|
||||
* @param _A_a4 Argument to be passed on to the function.
|
||||
* @param _A_a5 Argument to be passed on to the function.
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5) const
|
||||
{ return func_ptr_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
|
||||
};
|
||||
|
||||
/** pointer_functor6 wraps existing non-member functions with 6 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor6.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_arg1 Argument type used in the definition of operator()().
|
||||
* - @e T_arg2 Argument type used in the definition of operator()().
|
||||
* - @e T_arg3 Argument type used in the definition of operator()().
|
||||
* - @e T_arg4 Argument type used in the definition of operator()().
|
||||
* - @e T_arg5 Argument type used in the definition of operator()().
|
||||
* - @e T_arg6 Argument type used in the definition of operator()().
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return>
|
||||
class pointer_functor6 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6);
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor6() {}
|
||||
|
||||
/** Constructs a pointer_functor6 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor6(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.
|
||||
* @param _A_a1 Argument to be passed on to the function.
|
||||
* @param _A_a2 Argument to be passed on to the function.
|
||||
* @param _A_a3 Argument to be passed on to the function.
|
||||
* @param _A_a4 Argument to be passed on to the function.
|
||||
* @param _A_a5 Argument to be passed on to the function.
|
||||
* @param _A_a6 Argument to be passed on to the function.
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6) const
|
||||
{ return func_ptr_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
|
||||
};
|
||||
|
||||
/** pointer_functor7 wraps existing non-member functions with 7 argument(s).
|
||||
* Use the convenience function ptr_fun() to create an instance of pointer_functor7.
|
||||
*
|
||||
* The following template arguments are used:
|
||||
* - @e T_arg1 Argument type used in the definition of operator()().
|
||||
* - @e T_arg2 Argument type used in the definition of operator()().
|
||||
* - @e T_arg3 Argument type used in the definition of operator()().
|
||||
* - @e T_arg4 Argument type used in the definition of operator()().
|
||||
* - @e T_arg5 Argument type used in the definition of operator()().
|
||||
* - @e T_arg6 Argument type used in the definition of operator()().
|
||||
* - @e T_arg7 Argument type used in the definition of operator()().
|
||||
* - @e T_return The return type of operator()().
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return>
|
||||
class pointer_functor7 : public functor_base
|
||||
{
|
||||
typedef T_return (*function_type)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7);
|
||||
protected:
|
||||
function_type func_ptr_;
|
||||
public:
|
||||
typedef T_return result_type;
|
||||
|
||||
/// Constructs an invalid functor.
|
||||
pointer_functor7() {}
|
||||
|
||||
/** Constructs a pointer_functor7 object that wraps an existing function.
|
||||
* @param _A_func Pointer to function that will be invoked from operator()().
|
||||
*/
|
||||
explicit pointer_functor7(function_type _A_func): func_ptr_(_A_func) {}
|
||||
|
||||
/** Execute the wrapped function.
|
||||
* @param _A_a1 Argument to be passed on to the function.
|
||||
* @param _A_a2 Argument to be passed on to the function.
|
||||
* @param _A_a3 Argument to be passed on to the function.
|
||||
* @param _A_a4 Argument to be passed on to the function.
|
||||
* @param _A_a5 Argument to be passed on to the function.
|
||||
* @param _A_a6 Argument to be passed on to the function.
|
||||
* @param _A_a7 Argument to be passed on to the function.
|
||||
* @return The return value of the function invocation.
|
||||
*/
|
||||
T_return operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7) const
|
||||
{ return func_ptr_(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
|
||||
};
|
||||
|
||||
|
||||
// numbered ptr_fun
|
||||
/** Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_return>
|
||||
inline pointer_functor0<T_return>
|
||||
ptr_fun0(T_return (*_A_func)())
|
||||
{ return pointer_functor0<T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1, class T_return>
|
||||
inline pointer_functor1<T_arg1, T_return>
|
||||
ptr_fun1(T_return (*_A_func)(T_arg1))
|
||||
{ return pointer_functor1<T_arg1, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2, class T_return>
|
||||
inline pointer_functor2<T_arg1,T_arg2, T_return>
|
||||
ptr_fun2(T_return (*_A_func)(T_arg1,T_arg2))
|
||||
{ return pointer_functor2<T_arg1,T_arg2, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return>
|
||||
inline pointer_functor3<T_arg1,T_arg2,T_arg3, T_return>
|
||||
ptr_fun3(T_return (*_A_func)(T_arg1,T_arg2,T_arg3))
|
||||
{ return pointer_functor3<T_arg1,T_arg2,T_arg3, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return>
|
||||
inline pointer_functor4<T_arg1,T_arg2,T_arg3,T_arg4, T_return>
|
||||
ptr_fun4(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4))
|
||||
{ return pointer_functor4<T_arg1,T_arg2,T_arg3,T_arg4, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return>
|
||||
inline pointer_functor5<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_return>
|
||||
ptr_fun5(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5))
|
||||
{ return pointer_functor5<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return>
|
||||
inline pointer_functor6<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_return>
|
||||
ptr_fun6(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6))
|
||||
{ return pointer_functor6<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return>
|
||||
inline pointer_functor7<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_return>
|
||||
ptr_fun7(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7))
|
||||
{ return pointer_functor7<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_return>(_A_func); }
|
||||
|
||||
|
||||
// unnumbered ptr_fun
|
||||
/** Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_return>
|
||||
inline pointer_functor0<T_return>
|
||||
ptr_fun(T_return (*_A_func)())
|
||||
{ return pointer_functor0<T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1, class T_return>
|
||||
inline pointer_functor1<T_arg1, T_return>
|
||||
ptr_fun(T_return (*_A_func)(T_arg1))
|
||||
{ return pointer_functor1<T_arg1, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2, class T_return>
|
||||
inline pointer_functor2<T_arg1,T_arg2, T_return>
|
||||
ptr_fun(T_return (*_A_func)(T_arg1,T_arg2))
|
||||
{ return pointer_functor2<T_arg1,T_arg2, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3, class T_return>
|
||||
inline pointer_functor3<T_arg1,T_arg2,T_arg3, T_return>
|
||||
ptr_fun(T_return (*_A_func)(T_arg1,T_arg2,T_arg3))
|
||||
{ return pointer_functor3<T_arg1,T_arg2,T_arg3, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_return>
|
||||
inline pointer_functor4<T_arg1,T_arg2,T_arg3,T_arg4, T_return>
|
||||
ptr_fun(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4))
|
||||
{ return pointer_functor4<T_arg1,T_arg2,T_arg3,T_arg4, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_return>
|
||||
inline pointer_functor5<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_return>
|
||||
ptr_fun(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5))
|
||||
{ return pointer_functor5<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_return>
|
||||
inline pointer_functor6<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_return>
|
||||
ptr_fun(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6))
|
||||
{ return pointer_functor6<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_return>(_A_func); }
|
||||
|
||||
/** Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function.
|
||||
* @param _A_func Pointer to function that should be wrapped.
|
||||
* @return Functor that executes @e _A_func on invokation.
|
||||
*
|
||||
* @ingroup ptr_fun
|
||||
*/
|
||||
template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_return>
|
||||
inline pointer_functor7<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_return>
|
||||
ptr_fun(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7))
|
||||
{ return pointer_functor7<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_return>(_A_func); }
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif /* _SIGC_FUNCTORS_MACROS_PTR_FUNHM4_ */
|
||||
25
libs/sigc++2/sigc++/functors/slot.cc
Normal file
25
libs/sigc++2/sigc++/functors/slot.cc
Normal file
@@ -0,0 +1,25 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#include <sigc++/functors/slot.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
1301
libs/sigc++2/sigc++/functors/slot.h
Normal file
1301
libs/sigc++2/sigc++/functors/slot.h
Normal file
File diff suppressed because it is too large
Load Diff
179
libs/sigc++2/sigc++/functors/slot_base.cc
Normal file
179
libs/sigc++2/sigc++/functors/slot_base.cc
Normal file
@@ -0,0 +1,179 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2003, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sigc++/functors/slot_base.h>
|
||||
|
||||
namespace sigc
|
||||
{
|
||||
|
||||
namespace internal {
|
||||
|
||||
// only MSVC needs this to guarantee that all new/delete are executed from the DLL module
|
||||
#ifdef SIGC_NEW_DELETE_IN_LIBRARY_ONLY
|
||||
void* slot_rep::operator new(size_t size_)
|
||||
{
|
||||
return malloc(size_);
|
||||
}
|
||||
|
||||
void slot_rep::operator delete(void* p)
|
||||
{
|
||||
free(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
void slot_rep::disconnect()
|
||||
{
|
||||
if (parent_)
|
||||
{
|
||||
call_ = 0; // Invalidate the slot.
|
||||
// _Must_ be done here because parent_ might defer the actual
|
||||
// destruction of the slot_rep and try to invoke it before that point.
|
||||
void* data_ = parent_;
|
||||
parent_ = 0; // Just a precaution.
|
||||
(cleanup_)(data_); // Notify the parent (might lead to destruction of this!).
|
||||
}
|
||||
else
|
||||
call_ = 0;
|
||||
}
|
||||
|
||||
//static
|
||||
void* slot_rep::notify(void* data)
|
||||
{
|
||||
slot_rep* self_ = reinterpret_cast<slot_rep*>(data);
|
||||
|
||||
self_->call_ = 0; // Invalidate the slot.
|
||||
self_->destroy(); // Detach the stored functor from the other referred trackables and destroy it.
|
||||
self_->disconnect(); // Disconnect the slot (might lead to deletion of self_!).
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
slot_base::slot_base()
|
||||
: rep_(0),
|
||||
blocked_(false)
|
||||
{}
|
||||
|
||||
slot_base::slot_base(rep_type* rep)
|
||||
: rep_(rep),
|
||||
blocked_(false)
|
||||
{}
|
||||
|
||||
slot_base::slot_base(const slot_base& src)
|
||||
: rep_(0),
|
||||
blocked_(src.blocked_)
|
||||
{
|
||||
if (src.rep_)
|
||||
{
|
||||
//Check call_ so we can ignore invalidated slots.
|
||||
//Otherwise, destroyed bound reference parameters (whose destruction caused the slot's invalidation) may be used during dup().
|
||||
//Note: I'd prefer to check somewhere during dup(). murrayc.
|
||||
if (src.rep_->call_)
|
||||
rep_ = src.rep_->dup();
|
||||
else
|
||||
{
|
||||
*this = slot_base(); //Return the default invalid slot.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
slot_base::~slot_base()
|
||||
{
|
||||
if (rep_)
|
||||
delete rep_;
|
||||
}
|
||||
|
||||
slot_base::operator bool() const
|
||||
{
|
||||
return rep_ != 0;
|
||||
}
|
||||
|
||||
slot_base& slot_base::operator=(const slot_base& src)
|
||||
{
|
||||
if (src.rep_ == rep_) return *this;
|
||||
|
||||
if (src.empty())
|
||||
{
|
||||
disconnect();
|
||||
return *this;
|
||||
}
|
||||
|
||||
internal::slot_rep* new_rep_ = src.rep_->dup();
|
||||
|
||||
if (rep_) // Silently exchange the slot_rep.
|
||||
{
|
||||
new_rep_->set_parent(rep_->parent_, rep_->cleanup_);
|
||||
delete rep_;
|
||||
}
|
||||
|
||||
rep_ = new_rep_;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void slot_base::set_parent(void* parent, void* (*cleanup)(void*)) const
|
||||
{
|
||||
if (rep_)
|
||||
rep_->set_parent(parent, cleanup);
|
||||
}
|
||||
|
||||
void slot_base::add_destroy_notify_callback(void* data, func_destroy_notify func) const
|
||||
{
|
||||
if (rep_)
|
||||
rep_->add_destroy_notify_callback(data, func);
|
||||
}
|
||||
|
||||
void slot_base::remove_destroy_notify_callback(void* data) const
|
||||
{
|
||||
if (rep_)
|
||||
rep_->remove_destroy_notify_callback(data);
|
||||
}
|
||||
|
||||
bool slot_base::block(bool should_block)
|
||||
{
|
||||
bool old = blocked_;
|
||||
blocked_ = should_block;
|
||||
return old;
|
||||
}
|
||||
|
||||
bool slot_base::unblock()
|
||||
{
|
||||
return block(false);
|
||||
}
|
||||
|
||||
void slot_base::disconnect()
|
||||
{
|
||||
if (rep_)
|
||||
rep_->disconnect();
|
||||
}
|
||||
|
||||
|
||||
/*bool slot_base::empty() const // having this function not inline is killing performance !!!
|
||||
{
|
||||
if (rep_ && !rep_->call_)
|
||||
{
|
||||
delete rep_; // This is not strictly necessary here. I'm convinced that it is
|
||||
rep_ = 0; // safe to wait for the destructor to delete the slot_rep. Martin.
|
||||
}
|
||||
return (rep_ == 0);
|
||||
}*/
|
||||
|
||||
} //namespace sigc
|
||||
321
libs/sigc++2/sigc++/functors/slot_base.h
Normal file
321
libs/sigc++2/sigc++/functors/slot_base.h
Normal file
@@ -0,0 +1,321 @@
|
||||
/*
|
||||
* Copyright 2003, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_SLOT_BASE_HPP_
|
||||
#define _SIGC_SLOT_BASE_HPP_
|
||||
|
||||
#include <sigc++config.h>
|
||||
#include <sigc++/trackable.h>
|
||||
#include <sigc++/functors/functor_trait.h>
|
||||
|
||||
namespace sigc
|
||||
{
|
||||
|
||||
namespace internal {
|
||||
|
||||
typedef void* (*hook)(void*);
|
||||
|
||||
/** Internal representation of a slot.
|
||||
* Derivations of this class can be considered as a link
|
||||
* between a slot and the functor that the slot should
|
||||
* execute in operator(). This link is needed because in
|
||||
* libsigc++2 the slot doesn't necessarily have exactly the
|
||||
* same function signature as the functor thus allowing for
|
||||
* implicit conversions.
|
||||
* The base class slot_rep serves the purpose to
|
||||
* - form a common pointer type (slot_rep*),
|
||||
* - offer the possibility to create duplicates (dup()),
|
||||
* - offer a notification callback (notify()),
|
||||
* - implement some of slot_base's interface that depends
|
||||
* on the notification callback, i.e.
|
||||
* -# the possibility to set a single parent with a callback
|
||||
* (set_parent()) that is executed from notify(),
|
||||
* -# a generic function pointer, call_, that is simply
|
||||
* set to zero in notify() to invalidate the slot.
|
||||
* slot_rep inherits trackable so that connection objects can
|
||||
* refer to the slot and are notified when the slot is destroyed.
|
||||
*/
|
||||
struct SIGC_API slot_rep : public trackable
|
||||
{
|
||||
/* NB: Instead of slot_rep we could inherit slot_base from trackable.
|
||||
* However, a simple benchmark seems to indicate that this slows
|
||||
* down dereferencing of slot list iterators. Martin. */
|
||||
|
||||
/// Callback that invokes the contained functor.
|
||||
/* This can't be a virtual function since number of arguments
|
||||
* must be flexible. We use function pointers to slot_call::call_it()
|
||||
* instead. call_ is set to zero to indicate that the slot is invalid.
|
||||
*/
|
||||
hook call_;
|
||||
|
||||
/// Callback that detaches the slot_rep object from referred trackables and destroys it.
|
||||
/* This could be a replaced by a virtual dtor. However since this struct is
|
||||
* crucual for the efficiency of the whole library we want to avoid this.
|
||||
*/
|
||||
hook destroy_;
|
||||
|
||||
/** Callback that makes a deep copy of the slot_rep object.
|
||||
* @return A deep copy of the slot_rep object.
|
||||
*/
|
||||
hook dup_;
|
||||
|
||||
/** Callback of parent_. */
|
||||
hook cleanup_;
|
||||
|
||||
/** Parent object whose callback cleanup_ is executed on notification. */
|
||||
void* parent_;
|
||||
|
||||
inline slot_rep(hook call__, hook destroy__, hook dup__)
|
||||
: call_(call__), destroy_(destroy__), dup_(dup__), cleanup_(0), parent_(0) {}
|
||||
|
||||
inline ~slot_rep()
|
||||
{ destroy(); }
|
||||
|
||||
// only MSVC needs this to guarantee that all new/delete are executed from the DLL module
|
||||
#ifdef SIGC_NEW_DELETE_IN_LIBRARY_ONLY
|
||||
void* operator new(size_t size_);
|
||||
void operator delete(void* p);
|
||||
#endif
|
||||
|
||||
/** Destroys the slot_rep object (but doesn't delete it).
|
||||
*/
|
||||
inline void destroy()
|
||||
{ if (destroy_) (*destroy_)(this); }
|
||||
|
||||
/** Makes a deep copy of the slot_rep object.
|
||||
* @return A deep copy of the slot_rep object.
|
||||
*/
|
||||
inline slot_rep* dup() const
|
||||
{ return reinterpret_cast<slot_rep*>((*dup_)(const_cast<slot_rep*>(this))); }
|
||||
|
||||
/** Set the parent with a callback.
|
||||
* slots have one parent exclusively.
|
||||
* @param parent The new parent.
|
||||
* @param cleanup The callback to execute from notify().
|
||||
*/
|
||||
inline void set_parent(void* parent, hook cleanup)
|
||||
{
|
||||
parent_ = parent;
|
||||
cleanup_ = cleanup;
|
||||
}
|
||||
|
||||
/// Invalidates the slot and executes the parent's cleanup callback.
|
||||
void disconnect();
|
||||
|
||||
/** Callback that invalidates the slot.
|
||||
* This callback is registered in every object of a trackable
|
||||
* inherited type that is referred by this slot_rep object.
|
||||
* It is executed when the slot becomes invalid because of some
|
||||
* referred object dying.
|
||||
* @param data The slot_rep object that is becoming invalid (@p this).
|
||||
*/
|
||||
static void* notify(void* data);
|
||||
};
|
||||
|
||||
/** Functor used to add a dependency to a trackable.
|
||||
* Consequently slot_rep::notify() gets executed when the
|
||||
* trackable is destroyed or overwritten.
|
||||
*/
|
||||
struct SIGC_API slot_do_bind
|
||||
{
|
||||
/** The slot_rep object trackables should notify on destruction. */
|
||||
slot_rep* rep_;
|
||||
|
||||
/** Construct a slot_do_bind functor.
|
||||
* @param rep The slot_rep object trackables should notify on destruction.
|
||||
*/
|
||||
inline slot_do_bind(slot_rep* rep) : rep_(rep) {}
|
||||
|
||||
/** Adds a dependency to @p t.
|
||||
* @param t The trackable object to add a callback to.
|
||||
*/
|
||||
inline void operator()(const trackable* t) const
|
||||
{ t->add_destroy_notify_callback(rep_, &slot_rep::notify); }
|
||||
};
|
||||
|
||||
/// Functor used to remove a dependency from a trackable.
|
||||
struct SIGC_API slot_do_unbind
|
||||
{
|
||||
/** The slot_rep object trackables don't need to notify on destruction any more. */
|
||||
slot_rep* rep_;
|
||||
|
||||
/** Construct a slot_do_unbind functor.
|
||||
* @param rep The slot_rep object trackables don't need to notify on destruction any more.
|
||||
*/
|
||||
inline slot_do_unbind(slot_rep* rep) : rep_(rep) {}
|
||||
|
||||
/** Removes a dependency from @p t.
|
||||
* @param t The trackable object to remove the callback from.
|
||||
*/
|
||||
inline void operator()(const trackable* t) const
|
||||
{ t->remove_destroy_notify_callback(rep_); }
|
||||
};
|
||||
|
||||
} //namespace internal
|
||||
|
||||
|
||||
/** @defgroup slot Slots
|
||||
* Slots are type-safe representations of callback methods and functions.
|
||||
* A Slot can be constructed from any function, regardless of whether it is a global function,
|
||||
* a member method, static, or virtual.
|
||||
*
|
||||
* Use the sigc::mem_fun() and sigc::ptr_fun() template functions to get a sigc::slot, like so:
|
||||
*
|
||||
* @code
|
||||
* sigc::slot<void, int> sl = sigc::mem_fun(someobj,& SomeClass::somemethod);
|
||||
* @endcode
|
||||
*
|
||||
* or
|
||||
*
|
||||
* @code
|
||||
* sigc::slot<void, int> sl = sigc::ptr_fun(&somefunction);
|
||||
* @endcode
|
||||
*
|
||||
* or
|
||||
*
|
||||
* @code
|
||||
* m_Button.signal_clicked().connect( sigc::mem_fun(*this, &MyWindow::on_button_clicked) );
|
||||
* @endcode
|
||||
*
|
||||
* The compiler will complain if SomeClass::somemethod, etc. have the wrong signature.
|
||||
*
|
||||
* You can also pass slots as method parameters where you might normally pass a function pointer.
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
|
||||
/** Base type for slots.
|
||||
* slot_base integrates most of the interface of the derived
|
||||
* sigc::slot templates. slots
|
||||
* can be connected to signals, be disconnected at some later point
|
||||
* (disconnect()) and temporarily be blocked (block(), unblock()).
|
||||
* The validity of a slot can be tested with empty().
|
||||
*
|
||||
* The internal representation of a sigc::internal::slot_rep derived
|
||||
* type is built from slot_base's derivations. set_parent() is used to
|
||||
* register a notification callback that is executed when the slot gets
|
||||
* invalid. add_destroy_notify_callback() is used by connection objects
|
||||
* to add a notification callback that is executed on destruction.
|
||||
*
|
||||
* @ingroup slot
|
||||
*/
|
||||
class SIGC_API slot_base : public functor_base
|
||||
{
|
||||
typedef internal::slot_rep rep_type;
|
||||
|
||||
public:
|
||||
/// Constructs an empty slot.
|
||||
slot_base();
|
||||
|
||||
/** Constructs a slot from an existing slot_rep object.
|
||||
* @param rep The slot_rep object this slot should contain.
|
||||
*/
|
||||
explicit slot_base(rep_type* rep);
|
||||
|
||||
/** Constructs a slot, copying an existing one.
|
||||
* @param src The existing slot to copy.
|
||||
*/
|
||||
slot_base(const slot_base& src);
|
||||
|
||||
~slot_base();
|
||||
|
||||
/** Tests whether a slot is null, because the default constructor was used.
|
||||
* Test a slot for null like so:
|
||||
* @code
|
||||
* if(slot)
|
||||
* do_something()
|
||||
* @endcode
|
||||
*/
|
||||
operator bool() const;
|
||||
|
||||
/** Sets the parent of this slot.
|
||||
* This function is used by signals to register a notification callback.
|
||||
* This notification callback is executed when the slot becomes invalid
|
||||
* because of some referred object dying.
|
||||
* @param parent The new parent.
|
||||
* @param cleanup The notification callback.
|
||||
*/
|
||||
void set_parent(void* parent, void* (*cleanup)(void*)) const;
|
||||
|
||||
typedef trackable::func_destroy_notify func_destroy_notify;
|
||||
/** Add a callback that is executed (notified) when the slot is detroyed.
|
||||
* This function is used internally by connection objects.
|
||||
* @param data Passed into func upon notification.
|
||||
* @param func Callback executed upon destruction of the object.
|
||||
*/
|
||||
void add_destroy_notify_callback(void* data, func_destroy_notify func) const;
|
||||
|
||||
/** Remove a callback previously installed with add_destroy_notify_callback().
|
||||
* The callback is not executed.
|
||||
* @param data Parameter passed into previous call to add_destroy_notify_callback().
|
||||
*/
|
||||
void remove_destroy_notify_callback(void* data) const;
|
||||
|
||||
/** Returns whether the slot is invalid.
|
||||
* @return @p true if the slot is invalid (empty).
|
||||
*/
|
||||
inline bool empty() const
|
||||
{ return (!rep_ || !rep_->call_); }
|
||||
|
||||
/** Returns whether the slot is blocked.
|
||||
* @return @p true if the slot is blocked.
|
||||
*/
|
||||
inline bool blocked() const
|
||||
{ return blocked_; }
|
||||
|
||||
/** Sets the blocking state.
|
||||
* If @e should_block is @p true then the blocking state is set.
|
||||
* Subsequent calls to slot::operator()() don't invoke the functor
|
||||
* contained by this slot until unblock() or block() with
|
||||
* @e should_block = @p false is called.
|
||||
* @param should_block Indicates whether the blocking state should be set or unset.
|
||||
* @return @p true if the slot was in blocking state before.
|
||||
*/
|
||||
bool block(bool should_block = true);
|
||||
|
||||
/** Unsets the blocking state.
|
||||
* @return @p true if the slot was in blocking state before.
|
||||
*/
|
||||
bool unblock();
|
||||
|
||||
/** Disconnects the slot.
|
||||
* Invalidates the slot and notifies the parent.
|
||||
*/
|
||||
void disconnect();
|
||||
|
||||
//The Tru64 and Solaris Forte 5.5 compilers needs this operator=() to be public. I'm not sure why, or why it needs to be protected usually. murrayc.
|
||||
//See bug #168265.
|
||||
//protected:
|
||||
/** Overrides this slot making a copy from another slot.
|
||||
* @param src The slot from which to make a copy.
|
||||
* @return @p this.
|
||||
*/
|
||||
slot_base& operator=(const slot_base& src);
|
||||
|
||||
public: // public to avoid template friend declarations
|
||||
/** Typed slot_rep object that contains a functor. */
|
||||
mutable rep_type *rep_;
|
||||
|
||||
/** Indicates whether the slot is blocked. */
|
||||
bool blocked_;
|
||||
};
|
||||
|
||||
} //namespace sigc
|
||||
|
||||
#endif //_SIGC_SLOT_BASE_HPP_
|
||||
|
||||
6
libs/sigc++2/sigc++/hide.h
Normal file
6
libs/sigc++2/sigc++/hide.h
Normal file
@@ -0,0 +1,6 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
|
||||
#ifndef _SIGC_MACROS_HIDEHM4_
|
||||
#define _SIGC_MACROS_HIDEHM4_
|
||||
#endif /* _SIGC_MACROS_HIDEHM4_ */
|
||||
455
libs/sigc++2/sigc++/limit_reference.h
Normal file
455
libs/sigc++2/sigc++/limit_reference.h
Normal file
@@ -0,0 +1,455 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
|
||||
|
||||
#ifndef _SIGC_MACROS_LIMIT_REFERENCEHM4_
|
||||
#define _SIGC_MACROS_LIMIT_REFERENCEHM4_
|
||||
|
||||
|
||||
#include <sigc++/type_traits.h>
|
||||
#include <sigc++/trackable.h>
|
||||
|
||||
|
||||
namespace sigc {
|
||||
|
||||
|
||||
/** A limit_reference<Foo> object stores a reference (Foo&), but make sure that,
|
||||
* if Foo inherits from sigc::trackable, then visit_each<>() will "limit" itself to the
|
||||
* sigc::trackable reference instead of the derived reference. This avoids use of
|
||||
* a reference to the derived type when the derived destructor has run. That can be
|
||||
* a problem when using virtual inheritance.
|
||||
*
|
||||
* If Foo inherits from trackable then both the derived reference and the
|
||||
* sigc::trackable reference are stored, so we can later retrieve the sigc::trackable
|
||||
* reference without doing an implicit conversion. To retrieve the derived reference
|
||||
* (so that you invoke methods or members of it), use invoke(). To retrieve the trackable
|
||||
* reference (so that you can call visit_each() on it), you use visit().
|
||||
*
|
||||
* If Foo does not inherit from sigc::trackable then invoke() and visit() just return the
|
||||
* derived reference.
|
||||
*
|
||||
* This is used for bound (sigc::bind) slot parameters (via bound_argument), bound return values,
|
||||
* and, with mem_fun(), the reference to the handling object.
|
||||
*
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type,
|
||||
bool I_derives_trackable =
|
||||
is_base_and_derived<trackable, T_type>::value>
|
||||
class limit_reference
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
limit_reference(T_type& _A_target)
|
||||
: visited(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const T_type& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline T_type& invoke() const
|
||||
{ return visited; }
|
||||
|
||||
private:
|
||||
/** The reference.
|
||||
*/
|
||||
T_type& visited;
|
||||
};
|
||||
|
||||
/** limit_reference object for a class that derives from trackable.
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type>
|
||||
class limit_reference<T_type, true>
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
limit_reference(T_type& _A_target)
|
||||
: visited(_A_target),
|
||||
invoked(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const trackable& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline T_type& invoke() const
|
||||
{ return invoked; }
|
||||
|
||||
private:
|
||||
/** The trackable reference.
|
||||
*/
|
||||
trackable& visited;
|
||||
|
||||
/** The reference.
|
||||
*/
|
||||
T_type& invoked;
|
||||
};
|
||||
|
||||
/** Implementation of visit_each() specialized for the limit_reference
|
||||
* class, to call visit_each() on the entity returned by the limit_reference's
|
||||
* visit() method.
|
||||
* - @e T_action The type of functor to invoke.
|
||||
* - @e T_type The type of the reference.
|
||||
* @param _A_action The functor to invoke.
|
||||
* @param _A_argument The visited instance.
|
||||
*/
|
||||
template <class T_action, class T_type, bool I_derives_trackable>
|
||||
void
|
||||
visit_each(const T_action& _A_action,
|
||||
const limit_reference<T_type, I_derives_trackable>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.visit());
|
||||
}
|
||||
|
||||
|
||||
/** A const_limit_reference<Foo> object stores a reference (Foo&), but make sure that,
|
||||
* if Foo inherits from sigc::trackable, then visit_each<>() will "limit" itself to the
|
||||
* sigc::trackable reference instead of the derived reference. This avoids use of
|
||||
* a reference to the derived type when the derived destructor has run. That can be
|
||||
* a problem when using virtual inheritance.
|
||||
*
|
||||
* If Foo inherits from trackable then both the derived reference and the
|
||||
* sigc::trackable reference are stored, so we can later retrieve the sigc::trackable
|
||||
* reference without doing an implicit conversion. To retrieve the derived reference
|
||||
* (so that you invoke methods or members of it), use invoke(). To retrieve the trackable
|
||||
* reference (so that you can call visit_each() on it), you use visit().
|
||||
*
|
||||
* If Foo does not inherit from sigc::trackable then invoke() and visit() just return the
|
||||
* derived reference.
|
||||
*
|
||||
* This is used for bound (sigc::bind) slot parameters (via bound_argument), bound return values,
|
||||
* and, with mem_fun(), the reference to the handling object.
|
||||
*
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type,
|
||||
bool I_derives_trackable =
|
||||
is_base_and_derived<trackable, T_type>::value>
|
||||
class const_limit_reference
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
const_limit_reference(const T_type& _A_target)
|
||||
: visited(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const T_type& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const T_type& invoke() const
|
||||
{ return visited; }
|
||||
|
||||
private:
|
||||
/** The reference.
|
||||
*/
|
||||
const T_type& visited;
|
||||
};
|
||||
|
||||
/** const_limit_reference object for a class that derives from trackable.
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type>
|
||||
class const_limit_reference<T_type, true>
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
const_limit_reference(const T_type& _A_target)
|
||||
: visited(_A_target),
|
||||
invoked(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const trackable& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const T_type& invoke() const
|
||||
{ return invoked; }
|
||||
|
||||
private:
|
||||
/** The trackable reference.
|
||||
*/
|
||||
const trackable& visited;
|
||||
|
||||
/** The reference.
|
||||
*/
|
||||
const T_type& invoked;
|
||||
};
|
||||
|
||||
/** Implementation of visit_each() specialized for the const_limit_reference
|
||||
* class, to call visit_each() on the entity returned by the const_limit_reference's
|
||||
* visit() method.
|
||||
* - @e T_action The type of functor to invoke.
|
||||
* - @e T_type The type of the reference.
|
||||
* @param _A_action The functor to invoke.
|
||||
* @param _A_argument The visited instance.
|
||||
*/
|
||||
template <class T_action, class T_type, bool I_derives_trackable>
|
||||
void
|
||||
visit_each(const T_action& _A_action,
|
||||
const const_limit_reference<T_type, I_derives_trackable>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.visit());
|
||||
}
|
||||
|
||||
|
||||
/** A volatile_limit_reference<Foo> object stores a reference (Foo&), but make sure that,
|
||||
* if Foo inherits from sigc::trackable, then visit_each<>() will "limit" itself to the
|
||||
* sigc::trackable reference instead of the derived reference. This avoids use of
|
||||
* a reference to the derived type when the derived destructor has run. That can be
|
||||
* a problem when using virtual inheritance.
|
||||
*
|
||||
* If Foo inherits from trackable then both the derived reference and the
|
||||
* sigc::trackable reference are stored, so we can later retrieve the sigc::trackable
|
||||
* reference without doing an implicit conversion. To retrieve the derived reference
|
||||
* (so that you invoke methods or members of it), use invoke(). To retrieve the trackable
|
||||
* reference (so that you can call visit_each() on it), you use visit().
|
||||
*
|
||||
* If Foo does not inherit from sigc::trackable then invoke() and visit() just return the
|
||||
* derived reference.
|
||||
*
|
||||
* This is used for bound (sigc::bind) slot parameters (via bound_argument), bound return values,
|
||||
* and, with mem_fun(), the reference to the handling object.
|
||||
*
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type,
|
||||
bool I_derives_trackable =
|
||||
is_base_and_derived<trackable, T_type>::value>
|
||||
class volatile_limit_reference
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
volatile_limit_reference(T_type& _A_target)
|
||||
: visited(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const T_type& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline volatile T_type& invoke() const
|
||||
{ return visited; }
|
||||
|
||||
private:
|
||||
/** The reference.
|
||||
*/
|
||||
T_type& visited;
|
||||
};
|
||||
|
||||
/** volatile_limit_reference object for a class that derives from trackable.
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type>
|
||||
class volatile_limit_reference<T_type, true>
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
volatile_limit_reference(T_type& _A_target)
|
||||
: visited(_A_target),
|
||||
invoked(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const trackable& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline volatile T_type& invoke() const
|
||||
{ return invoked; }
|
||||
|
||||
private:
|
||||
/** The trackable reference.
|
||||
*/
|
||||
trackable& visited;
|
||||
|
||||
/** The reference.
|
||||
*/
|
||||
T_type& invoked;
|
||||
};
|
||||
|
||||
/** Implementation of visit_each() specialized for the volatile_limit_reference
|
||||
* class, to call visit_each() on the entity returned by the volatile_limit_reference's
|
||||
* visit() method.
|
||||
* - @e T_action The type of functor to invoke.
|
||||
* - @e T_type The type of the reference.
|
||||
* @param _A_action The functor to invoke.
|
||||
* @param _A_argument The visited instance.
|
||||
*/
|
||||
template <class T_action, class T_type, bool I_derives_trackable>
|
||||
void
|
||||
visit_each(const T_action& _A_action,
|
||||
const volatile_limit_reference<T_type, I_derives_trackable>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.visit());
|
||||
}
|
||||
|
||||
|
||||
/** A const_volatile_limit_reference<Foo> object stores a reference (Foo&), but make sure that,
|
||||
* if Foo inherits from sigc::trackable, then visit_each<>() will "limit" itself to the
|
||||
* sigc::trackable reference instead of the derived reference. This avoids use of
|
||||
* a reference to the derived type when the derived destructor has run. That can be
|
||||
* a problem when using virtual inheritance.
|
||||
*
|
||||
* If Foo inherits from trackable then both the derived reference and the
|
||||
* sigc::trackable reference are stored, so we can later retrieve the sigc::trackable
|
||||
* reference without doing an implicit conversion. To retrieve the derived reference
|
||||
* (so that you invoke methods or members of it), use invoke(). To retrieve the trackable
|
||||
* reference (so that you can call visit_each() on it), you use visit().
|
||||
*
|
||||
* If Foo does not inherit from sigc::trackable then invoke() and visit() just return the
|
||||
* derived reference.
|
||||
*
|
||||
* This is used for bound (sigc::bind) slot parameters (via bound_argument), bound return values,
|
||||
* and, with mem_fun(), the reference to the handling object.
|
||||
*
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type,
|
||||
bool I_derives_trackable =
|
||||
is_base_and_derived<trackable, T_type>::value>
|
||||
class const_volatile_limit_reference
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
const_volatile_limit_reference(const T_type& _A_target)
|
||||
: visited(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const T_type& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const volatile T_type& invoke() const
|
||||
{ return visited; }
|
||||
|
||||
private:
|
||||
/** The reference.
|
||||
*/
|
||||
const T_type& visited;
|
||||
};
|
||||
|
||||
/** const_volatile_limit_reference object for a class that derives from trackable.
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type>
|
||||
class const_volatile_limit_reference<T_type, true>
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
const_volatile_limit_reference(const T_type& _A_target)
|
||||
: visited(_A_target),
|
||||
invoked(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const trackable& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const volatile T_type& invoke() const
|
||||
{ return invoked; }
|
||||
|
||||
private:
|
||||
/** The trackable reference.
|
||||
*/
|
||||
const trackable& visited;
|
||||
|
||||
/** The reference.
|
||||
*/
|
||||
const T_type& invoked;
|
||||
};
|
||||
|
||||
/** Implementation of visit_each() specialized for the const_volatile_limit_reference
|
||||
* class, to call visit_each() on the entity returned by the const_volatile_limit_reference's
|
||||
* visit() method.
|
||||
* - @e T_action The type of functor to invoke.
|
||||
* - @e T_type The type of the reference.
|
||||
* @param _A_action The functor to invoke.
|
||||
* @param _A_argument The visited instance.
|
||||
*/
|
||||
template <class T_action, class T_type, bool I_derives_trackable>
|
||||
void
|
||||
visit_each(const T_action& _A_action,
|
||||
const const_volatile_limit_reference<T_type, I_derives_trackable>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.visit());
|
||||
}
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
|
||||
#endif /* _SIGC_MACROS_LIMIT_REFERENCEHM4_ */
|
||||
27
libs/sigc++2/sigc++/macros/class_slot.h.m4
Normal file
27
libs/sigc++2/sigc++/macros/class_slot.h.m4
Normal file
@@ -0,0 +1,27 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
divert(0)
|
||||
|
||||
__FIREWALL__
|
||||
|
||||
#include <sigc++/slot.h>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
|
||||
23
libs/sigc++2/sigc++/macros/hide.h.m4
Normal file
23
libs/sigc++2/sigc++/macros/hide.h.m4
Normal file
@@ -0,0 +1,23 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
divert(0)dnl
|
||||
|
||||
__FIREWALL__
|
||||
158
libs/sigc++2/sigc++/macros/limit_reference.h.m4
Normal file
158
libs/sigc++2/sigc++/macros/limit_reference.h.m4
Normal file
@@ -0,0 +1,158 @@
|
||||
dnl
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([LIMIT_REFERENCE],[dnl
|
||||
/** A [$1]limit_reference<Foo> object stores a reference (Foo&), but make sure that,
|
||||
* if Foo inherits from sigc::trackable, then visit_each<>() will "limit" itself to the
|
||||
* sigc::trackable reference instead of the derived reference. This avoids use of
|
||||
* a reference to the derived type when the derived destructor has run. That can be
|
||||
* a problem when using virtual inheritance.
|
||||
*
|
||||
* If Foo inherits from trackable then both the derived reference and the
|
||||
* sigc::trackable reference are stored, so we can later retrieve the sigc::trackable
|
||||
* reference without doing an implicit conversion. To retrieve the derived reference
|
||||
* (so that you invoke methods or members of it), use invoke(). To retrieve the trackable
|
||||
* reference (so that you can call visit_each() on it), you use visit().
|
||||
*
|
||||
* If Foo does not inherit from sigc::trackable then invoke() and visit() just return the
|
||||
* derived reference.
|
||||
*
|
||||
* This is used for bound (sigc::bind) slot parameters (via bound_argument), bound return values,
|
||||
* and, with mem_fun(), the reference to the handling object.
|
||||
*
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type,
|
||||
bool I_derives_trackable =
|
||||
is_base_and_derived<trackable, T_type>::value>
|
||||
class [$1]limit_reference
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
[$1]limit_reference([$2]T_type& _A_target)
|
||||
: visited(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const T_type& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline [$3]T_type& invoke() const
|
||||
{ return visited; }
|
||||
|
||||
private:
|
||||
/** The reference.
|
||||
*/
|
||||
[$2]T_type& visited;
|
||||
};
|
||||
|
||||
/** [$1]limit_reference object for a class that derives from trackable.
|
||||
* - @e T_type The type of the reference.
|
||||
*/
|
||||
template <class T_type>
|
||||
class [$1]limit_reference<T_type, true>
|
||||
{
|
||||
public:
|
||||
/** Constructor.
|
||||
* @param _A_target The reference to limit.
|
||||
*/
|
||||
[$1]limit_reference([$2]T_type& _A_target)
|
||||
: visited(_A_target),
|
||||
invoked(_A_target)
|
||||
{}
|
||||
|
||||
/** Retrieve the entity to visit for visit_each().
|
||||
* Depending on the template specialization, this is either a derived reference, or sigc::trackable& if T_type derives from sigc::trackable.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline const trackable& visit() const
|
||||
{ return visited; }
|
||||
|
||||
/** Retrieve the reference.
|
||||
* This is always a reference to the derived instance.
|
||||
* @return The reference.
|
||||
*/
|
||||
inline [$3]T_type& invoke() const
|
||||
{ return invoked; }
|
||||
|
||||
private:
|
||||
/** The trackable reference.
|
||||
*/
|
||||
[$2]trackable& visited;
|
||||
|
||||
/** The reference.
|
||||
*/
|
||||
[$2]T_type& invoked;
|
||||
};
|
||||
|
||||
/** Implementation of visit_each() specialized for the [$1]limit_reference
|
||||
* class, to call visit_each() on the entity returned by the [$1]limit_reference's
|
||||
* visit() method.
|
||||
* - @e T_action The type of functor to invoke.
|
||||
* - @e T_type The type of the reference.
|
||||
* @param _A_action The functor to invoke.
|
||||
* @param _A_argument The visited instance.
|
||||
*/
|
||||
template <class T_action, class T_type, bool I_derives_trackable>
|
||||
void
|
||||
visit_each(const T_action& _A_action,
|
||||
const [$1]limit_reference<T_type, I_derives_trackable>& _A_target)
|
||||
{
|
||||
visit_each(_A_action, _A_target.visit());
|
||||
}
|
||||
])
|
||||
|
||||
divert(0)
|
||||
|
||||
__FIREWALL__
|
||||
|
||||
|
||||
#include <sigc++/type_traits.h>
|
||||
#include <sigc++/trackable.h>
|
||||
|
||||
|
||||
namespace sigc {
|
||||
|
||||
|
||||
LIMIT_REFERENCE([],[],[])dnl
|
||||
|
||||
|
||||
LIMIT_REFERENCE([const_],[const ],[const ])dnl
|
||||
|
||||
|
||||
LIMIT_REFERENCE([volatile_],[],[volatile ])dnl
|
||||
|
||||
|
||||
LIMIT_REFERENCE([const_volatile_],[const ],[const volatile ])dnl
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
|
||||
23
libs/sigc++2/sigc++/macros/method_slot.h.m4
Normal file
23
libs/sigc++2/sigc++/macros/method_slot.h.m4
Normal file
@@ -0,0 +1,23 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
divert(0)
|
||||
|
||||
__FIREWALL__
|
||||
22
libs/sigc++2/sigc++/macros/object_slot.h.m4
Normal file
22
libs/sigc++2/sigc++/macros/object_slot.h.m4
Normal file
@@ -0,0 +1,22 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
divert(0)
|
||||
|
||||
75
libs/sigc++2/sigc++/macros/retype.h.m4
Normal file
75
libs/sigc++2/sigc++/macros/retype.h.m4
Normal file
@@ -0,0 +1,75 @@
|
||||
dnl Copyright 2003, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
define([RETYPE_SLOT_OPERATOR],[dnl
|
||||
ifelse($1,0,[dnl
|
||||
T_return operator()();
|
||||
],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline T_return operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
|
||||
(LOOP([[static_cast<T_type%1>(_A_a%1)]], $1)));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline T_return sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
|
||||
(LOOP([[static_cast<T_type%1>(_A_a%1)]], $1)));
|
||||
}
|
||||
#endif
|
||||
|
||||
])dnl
|
||||
])
|
||||
define([RETYPE_SLOT_VOID_OPERATOR],[dnl
|
||||
ifelse($1,0,[dnl
|
||||
void operator()();
|
||||
],[dnl
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline void operator()(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
|
||||
(LOOP([[static_cast<T_type%1>(_A_a%1)]], $1)));
|
||||
}
|
||||
|
||||
#ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
template <LOOP(class T_arg%1, $1)>
|
||||
inline void sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
|
||||
{ T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
|
||||
(LOOP([[static_cast<T_type%1>(_A_a%1)]], $1)));
|
||||
}
|
||||
#endif
|
||||
|
||||
])dnl
|
||||
])
|
||||
define([RETYPE],[dnl
|
||||
template <LIST(class T_return, LOOP(class T_arg%1, $1), class T_ret, LOOP(class T_type%1, $1))>
|
||||
inline Slot$1<LIST(T_return, LOOP(T_arg%1, $1))>
|
||||
retype(const Slot$1<LIST(T_ret, LOOP(T_type%1, $1))>& _A_slot)
|
||||
{ return Slot$1<LIST(T_return, LOOP(T_arg%1, $1))>
|
||||
(retype_slot_functor<LIST(Slot$1<LIST(T_ret, LOOP(T_type%1, $1))>, T_return, LOOP(T_type%1, $1))>
|
||||
(_A_slot)); }
|
||||
|
||||
])
|
||||
|
||||
divert(0)dnl
|
||||
__FIREWALL__
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/slot.h>
|
||||
|
||||
1100
libs/sigc++2/sigc++/macros/signal.h.m4
Normal file
1100
libs/sigc++2/sigc++/macros/signal.h.m4
Normal file
File diff suppressed because it is too large
Load Diff
25
libs/sigc++2/sigc++/macros/slot.h.m4
Normal file
25
libs/sigc++2/sigc++/macros/slot.h.m4
Normal file
@@ -0,0 +1,25 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
divert(-1)
|
||||
|
||||
include(template.macros.m4)
|
||||
|
||||
divert(0)
|
||||
|
||||
__FIREWALL__
|
||||
|
||||
#include <sigc++/functors/slot.h>
|
||||
84
libs/sigc++2/sigc++/macros/template.macros.m4
Normal file
84
libs/sigc++2/sigc++/macros/template.macros.m4
Normal file
@@ -0,0 +1,84 @@
|
||||
dnl Copyright 2002, The libsigc++ Development Team
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Lesser General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2.1 of the License, or (at your option) any later version.
|
||||
dnl
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Lesser General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU Lesser General Public
|
||||
dnl License along with this library; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
dnl
|
||||
define(__t_div__,divnum)divert(-1)
|
||||
dnl
|
||||
dnl M4 macros for building large files quickly
|
||||
dnl
|
||||
divert(0)// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
divert(-1)
|
||||
changequote([, ])
|
||||
changecom()
|
||||
|
||||
dnl
|
||||
dnl Macros for sigc specifically.
|
||||
dnl
|
||||
|
||||
define([CALL_SIZE],7)
|
||||
|
||||
#Generate header guards:
|
||||
define([__FIREWALL__],[dnl
|
||||
define(__hfile_temp__,[translit(__file__,/., _)])dnl
|
||||
define(__hfile_temp2__,[translit(__hfile_temp__,+., _)])dnl
|
||||
define(__hfile__,[_SIGC_[]patsubst(translit(__hfile_temp2__,a-z.,A-Z_), _M4$)_])dnl
|
||||
#ifndef __hfile__
|
||||
#define __hfile__[]dnl
|
||||
divert(1)dnl
|
||||
#endif /* __hfile__ */
|
||||
divert(0)dnl
|
||||
])
|
||||
|
||||
define([_R_],[typename type_trait<$1>::take])
|
||||
define([_P_],[typename type_trait<$1>::pass])
|
||||
|
||||
|
||||
dnl
|
||||
dnl General macros
|
||||
dnl
|
||||
|
||||
define([UPPER],[translit([$*],[abcdefghijklmnopqrstuvwxyz],[ABCDEFGHIJKLMNOPQRSTUVWXYZ])])
|
||||
define([LOWER],[translit([$*],[ABCDEFGHIJKLMNOPQRSTUVWXYZ],[abcdefghijklmnopqrstuvwxyz])])
|
||||
define([PROT],[[$*]])
|
||||
|
||||
define([_LOOP],
|
||||
[ifelse(eval($1<$2),0,
|
||||
[indir([_LOOP_FORMAT], $1)],
|
||||
[indir([_LOOP_FORMAT], $1)[]_LOOP_SEP[]_LOOP(eval($1+1), $2)])])
|
||||
|
||||
define([LOOP],
|
||||
[pushdef([_LOOP_FORMAT], translit([$1],%, $))dnl
|
||||
pushdef([_LOOP_SEP],ifelse([$3],[],[[, ]],[$3]))dnl
|
||||
ifelse(eval($2>0),1,[PROT(_LOOP(1, $2))],[PROT()])dnl
|
||||
popdef([_LOOP_SEP])dnl
|
||||
popdef([_LOOP_FORMAT])dnl
|
||||
])
|
||||
|
||||
define([NUM],[eval(ifelse([$1],,0,1)ifelse($#,0,0, $#,1,,[+NUM(shift($@))]))])
|
||||
define([LIST],[ifelse($#,0,, $#,1,[$1],[$1],,[LIST(shift($@))],[__LIST($@)])])
|
||||
define([__LIST],[ifelse($#,0,, $#,1,[$1],[$1[]ifelse([$2],,,[[, ]])__LIST(shift($@))])])
|
||||
dnl
|
||||
define([_NL_],[
|
||||
])
|
||||
|
||||
define([FOR],
|
||||
[pushdef([_FOR_FUNC],PROT(translit([$3],%, $)))dnl
|
||||
_FOR($1, $2)[]dnl
|
||||
popdef([_FOR_FUNC])dnl
|
||||
])
|
||||
define([_FOR],[ifelse(eval($1>$2),1,[],[_FOR_FUNC($1)[]_FOR(eval($1+1), $2)])])
|
||||
|
||||
divert(__t_div__)dnl
|
||||
7
libs/sigc++2/sigc++/method_slot.h
Normal file
7
libs/sigc++2/sigc++/method_slot.h
Normal file
@@ -0,0 +1,7 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
|
||||
|
||||
#ifndef _SIGC_MACROS_METHOD_SLOTHM4_
|
||||
#define _SIGC_MACROS_METHOD_SLOTHM4_
|
||||
#endif /* _SIGC_MACROS_METHOD_SLOTHM4_ */
|
||||
24
libs/sigc++2/sigc++/object.h
Normal file
24
libs/sigc++2/sigc++/object.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_OBJECT_HPP_
|
||||
#define _SIGC_OBJECT_HPP_
|
||||
|
||||
#include <sigc++/trackable.h>
|
||||
|
||||
#endif /* _SIGC_OBJECT_HPP_ */
|
||||
4
libs/sigc++2/sigc++/object_slot.h
Normal file
4
libs/sigc++2/sigc++/object_slot.h
Normal file
@@ -0,0 +1,4 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
|
||||
|
||||
110
libs/sigc++2/sigc++/reference_wrapper.h
Normal file
110
libs/sigc++2/sigc++/reference_wrapper.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_REFERENCE_WRAPPER_H_
|
||||
#define _SIGC_REFERENCE_WRAPPER_H_
|
||||
|
||||
namespace sigc {
|
||||
|
||||
/** Reference wrapper.
|
||||
* Use sigc::ref() to create a reference wrapper.
|
||||
*/
|
||||
template <class T_type>
|
||||
struct reference_wrapper
|
||||
{
|
||||
explicit reference_wrapper(T_type& v)
|
||||
: value_(v) {}
|
||||
|
||||
operator T_type& () const
|
||||
{ return value_; }
|
||||
|
||||
T_type& value_;
|
||||
};
|
||||
|
||||
/** Const reference wrapper.
|
||||
* Use sigc::ref() to create a const reference wrapper.
|
||||
*/
|
||||
template <class T_type>
|
||||
struct const_reference_wrapper
|
||||
{
|
||||
explicit const_reference_wrapper(const T_type& v)
|
||||
: value_(v) {}
|
||||
|
||||
operator const T_type& () const
|
||||
{ return value_; }
|
||||
|
||||
const T_type& value_;
|
||||
};
|
||||
|
||||
/** Creates a reference wrapper.
|
||||
* Passing an object throught sigc::ref() makes libsigc++ adaptors
|
||||
* like, e.g., sigc::bind store references to the object instead of copies.
|
||||
* If the object type inherits from sigc::trackable this will ensure
|
||||
* automatic invalidation of the adaptors when the object is deleted
|
||||
* or overwritten.
|
||||
*
|
||||
* @param v Reference to store.
|
||||
* @return A reference wrapper.
|
||||
*/
|
||||
template <class T_type>
|
||||
reference_wrapper<T_type> ref(T_type& v)
|
||||
{ return reference_wrapper<T_type>(v); }
|
||||
|
||||
/** Creates a const reference wrapper.
|
||||
* Passing an object throught sigc::ref() makes libsigc++ adaptors
|
||||
* like, e.g., sigc::bind store references to the object instead of copies.
|
||||
* If the object type inherits from sigc::trackable this will ensure
|
||||
* automatic invalidation of the adaptors when the object is deleted
|
||||
* or overwritten.
|
||||
*
|
||||
* @param v Reference to store.
|
||||
* @return A reference wrapper.
|
||||
*/
|
||||
template <class T_type>
|
||||
const_reference_wrapper<T_type> ref(const T_type& v)
|
||||
{ return const_reference_wrapper<T_type>(v); }
|
||||
|
||||
template <class T_type>
|
||||
struct unwrap_reference
|
||||
{
|
||||
typedef T_type type;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
struct unwrap_reference<reference_wrapper<T_type> >
|
||||
{
|
||||
typedef T_type& type;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
struct unwrap_reference<const_reference_wrapper<T_type> >
|
||||
{
|
||||
typedef const T_type& type;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
T_type& unwrap(const reference_wrapper<T_type>& v)
|
||||
{ return v; }
|
||||
|
||||
template <class T_type>
|
||||
const T_type& unwrap(const const_reference_wrapper<T_type>& v)
|
||||
{ return v; }
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
#endif /* _SIGC_REFERENCE_WRAPPER_H_ */
|
||||
8
libs/sigc++2/sigc++/retype.h
Normal file
8
libs/sigc++2/sigc++/retype.h
Normal file
@@ -0,0 +1,8 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
#ifndef _SIGC_MACROS_RETYPEHM4_
|
||||
#define _SIGC_MACROS_RETYPEHM4_
|
||||
#include <sigc++/adaptors/adaptor_trait.h>
|
||||
#include <sigc++/slot.h>
|
||||
|
||||
#endif /* _SIGC_MACROS_RETYPEHM4_ */
|
||||
25
libs/sigc++2/sigc++/retype_return.h
Normal file
25
libs/sigc++2/sigc++/retype_return.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_RETYPE_RETURN_HPP_
|
||||
#define _SIGC_RETYPE_RETURN_HPP_
|
||||
|
||||
#include <sigc++/adaptors/retype_return.h>
|
||||
|
||||
|
||||
#endif /* _SIGC_RETYPE_RETURN_HPP_ */
|
||||
30
libs/sigc++2/sigc++/sigc++.h
Normal file
30
libs/sigc++2/sigc++/sigc++.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2003, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SIGCXX_SIGCXX_H
|
||||
#define SIGCXX_SIGCXX_H
|
||||
|
||||
#include <sigc++/signal.h>
|
||||
#include <sigc++/connection.h>
|
||||
#include <sigc++/trackable.h>
|
||||
#include <sigc++/adaptors/adaptors.h>
|
||||
#include <sigc++/functors/functors.h>
|
||||
|
||||
#endif /* SIGCXX_SIGCXX_H */
|
||||
|
||||
25
libs/sigc++2/sigc++/signal.cc
Normal file
25
libs/sigc++2/sigc++/signal.cc
Normal file
@@ -0,0 +1,25 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#include <sigc++/signal.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
|
||||
} /* sigc */
|
||||
3823
libs/sigc++2/sigc++/signal.h
Normal file
3823
libs/sigc++2/sigc++/signal.h
Normal file
File diff suppressed because it is too large
Load Diff
152
libs/sigc++2/sigc++/signal_base.cc
Normal file
152
libs/sigc++2/sigc++/signal_base.cc
Normal file
@@ -0,0 +1,152 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2003, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#include <sigc++/signal_base.h>
|
||||
|
||||
namespace sigc {
|
||||
namespace internal {
|
||||
|
||||
signal_impl::signal_impl()
|
||||
: ref_count_(0), exec_count_(0), deferred_(0)
|
||||
{}
|
||||
|
||||
// only MSVC needs this to guarantee that all new/delete are executed from the DLL module
|
||||
#ifdef SIGC_NEW_DELETE_IN_LIBRARY_ONLY
|
||||
void* signal_impl::operator new(size_t size_)
|
||||
{
|
||||
return malloc(size_);
|
||||
}
|
||||
|
||||
void signal_impl::operator delete(void* p)
|
||||
{
|
||||
free(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
void signal_impl::clear()
|
||||
{
|
||||
slots_.clear();
|
||||
}
|
||||
|
||||
signal_impl::size_type signal_impl::size() const
|
||||
{
|
||||
return slots_.size();
|
||||
}
|
||||
|
||||
signal_impl::iterator_type signal_impl::connect(const slot_base& slot_)
|
||||
{
|
||||
return insert(slots_.end(), slot_);
|
||||
}
|
||||
|
||||
signal_impl::iterator_type signal_impl::erase(iterator_type i)
|
||||
{
|
||||
return slots_.erase(i);
|
||||
}
|
||||
|
||||
signal_impl::iterator_type signal_impl::insert(signal_impl::iterator_type i, const slot_base& slot_)
|
||||
{
|
||||
iterator_type temp = slots_.insert(i, slot_);
|
||||
temp->set_parent(this, ¬ify);
|
||||
return temp;
|
||||
}
|
||||
|
||||
void signal_impl::sweep()
|
||||
{
|
||||
deferred_ = false;
|
||||
iterator_type i = slots_.begin();
|
||||
while (i != slots_.end())
|
||||
if ((*i).empty())
|
||||
i = slots_.erase(i);
|
||||
else
|
||||
++i;
|
||||
}
|
||||
|
||||
void* signal_impl::notify(void* d)
|
||||
{
|
||||
signal_impl* self = reinterpret_cast<signal_impl*>(d);
|
||||
if (self->exec_count_ == 0)
|
||||
self->sweep();
|
||||
else // This is occuring during signal emission.
|
||||
self->deferred_ = true; // => sweep() will be called from ~signal_exec().
|
||||
return 0; // This is safer because we don't have to care about our iterators in emit().
|
||||
}
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
signal_base::signal_base()
|
||||
: impl_(0)
|
||||
{}
|
||||
|
||||
signal_base::signal_base(const signal_base& src)
|
||||
: trackable(),
|
||||
impl_(src.impl())
|
||||
{
|
||||
impl_->reference();
|
||||
}
|
||||
|
||||
signal_base::~signal_base()
|
||||
{
|
||||
if (impl_)
|
||||
impl_->unreference();
|
||||
}
|
||||
|
||||
void signal_base::clear()
|
||||
{
|
||||
if (impl_)
|
||||
impl_->clear();
|
||||
}
|
||||
|
||||
signal_base::size_type signal_base::size() const
|
||||
{
|
||||
return (impl_ ? impl_->size() : 0);
|
||||
}
|
||||
|
||||
signal_base::iterator_type signal_base::connect(const slot_base& slot_)
|
||||
{
|
||||
return impl()->connect(slot_);
|
||||
}
|
||||
|
||||
signal_base::iterator_type signal_base::insert(iterator_type i, const slot_base& slot_)
|
||||
{
|
||||
return impl()->insert(i, slot_);
|
||||
}
|
||||
|
||||
signal_base::iterator_type signal_base::erase(iterator_type i)
|
||||
{
|
||||
return impl()->erase(i);
|
||||
}
|
||||
|
||||
signal_base& signal_base::operator = (const signal_base& src)
|
||||
{
|
||||
if (impl_) impl_->unreference();
|
||||
impl_ = src.impl();
|
||||
impl_->reference();
|
||||
return *this;
|
||||
}
|
||||
|
||||
internal::signal_impl* signal_base::impl() const
|
||||
{
|
||||
if (!impl_) {
|
||||
impl_ = new internal::signal_impl;
|
||||
impl_->reference(); // start with a reference count of 1
|
||||
}
|
||||
return impl_;
|
||||
}
|
||||
|
||||
} /* sigc */
|
||||
300
libs/sigc++2/sigc++/signal_base.h
Normal file
300
libs/sigc++2/sigc++/signal_base.h
Normal file
@@ -0,0 +1,300 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SIGC_SIGNAL_BASE_H_
|
||||
#define _SIGC_SIGNAL_BASE_H_
|
||||
|
||||
#include <list>
|
||||
#include <sigc++config.h>
|
||||
#include <sigc++/type_traits.h>
|
||||
#include <sigc++/trackable.h>
|
||||
#include <sigc++/functors/slot.h>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
|
||||
namespace sigc
|
||||
{
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
/** Implementation of the signal interface.
|
||||
* signal_impl manages a list of slots. When a slot becomes
|
||||
* invalid (because some referred object dies), notify() is executed.
|
||||
* notify() either calls sweep() directly or defers the execution of
|
||||
* sweep() when the signal is being emitted. sweep() removes all
|
||||
* invalid slot from the list.
|
||||
*/
|
||||
struct SIGC_API signal_impl
|
||||
{
|
||||
typedef size_t size_type;
|
||||
typedef std::list<slot_base> slot_list;
|
||||
typedef slot_list::iterator iterator_type;
|
||||
typedef slot_list::const_iterator const_iterator_type;
|
||||
|
||||
signal_impl();
|
||||
|
||||
// only MSVC needs this to guarantee that all new/delete are executed from the DLL module
|
||||
#ifdef SIGC_NEW_DELETE_IN_LIBRARY_ONLY
|
||||
void* operator new(size_t size_);
|
||||
void operator delete(void* p);
|
||||
#endif
|
||||
|
||||
/// Increments the reference counter.
|
||||
inline void reference()
|
||||
{ ++ref_count_; }
|
||||
|
||||
/// Increments the reference and execution counter.
|
||||
inline void reference_exec()
|
||||
{ ++ref_count_; ++exec_count_; }
|
||||
|
||||
/** Decrements the reference counter.
|
||||
* The object is deleted when the reference counter reaches zero.
|
||||
*/
|
||||
inline void unreference()
|
||||
{ if (!(--ref_count_)) delete this; }
|
||||
|
||||
/** Decrements the reference and execution counter.
|
||||
* Invokes sweep() if the execution counter reaches zero and the
|
||||
* removal of one or more slots has been deferred.
|
||||
*/
|
||||
inline void unreference_exec()
|
||||
{
|
||||
if (!(--ref_count_)) delete this;
|
||||
else if (!(--exec_count_) && deferred_) sweep();
|
||||
}
|
||||
|
||||
/** Returns whether the list of slots is empty.
|
||||
* @return @p true if the list of slots is empty.
|
||||
*/
|
||||
inline bool empty() const
|
||||
{ return slots_.empty(); }
|
||||
|
||||
/// Empties the list of slots.
|
||||
void clear();
|
||||
|
||||
/** Returns the number of slots in the list.
|
||||
* @return The number of slots in the list.
|
||||
*/
|
||||
size_type size() const;
|
||||
|
||||
/** Adds a slot at the bottom of the list of slots.
|
||||
* @param slot_ The slot to add to the list of slots.
|
||||
* @return An iterator pointing to the new slot in the list.
|
||||
*/
|
||||
iterator_type connect(const slot_base& slot_);
|
||||
|
||||
/** Adds a slot at the given position into the list of slots.
|
||||
* @param i An iterator indicating the position where @p slot_ should be inserted.
|
||||
* @param slot_ The slot to add to the list of slots.
|
||||
* @return An iterator pointing to the new slot in the list.
|
||||
*/
|
||||
iterator_type insert(iterator_type i, const slot_base& slot_);
|
||||
|
||||
/** Removes the slot at the given position from the list of slots.
|
||||
* @param i An iterator pointing to the slot to be removed.
|
||||
* @return An iterator pointing to the slot in the list after the one removed.
|
||||
*/
|
||||
iterator_type erase(iterator_type i);
|
||||
|
||||
/// Removes invalid slots from the list of slots.
|
||||
void sweep();
|
||||
|
||||
/** Callback that is executed when some slot becomes invalid.
|
||||
* This callback is registered in every slot when inserted into
|
||||
* the list of slots. It is executed when a slot becomes invalid
|
||||
* because of some referred object being destroyed.
|
||||
* It either calls sweep() directly or defers the execution of
|
||||
* sweep() when the signal is being emitted.
|
||||
* @param d The signal object (@p this).
|
||||
*/
|
||||
static void* notify(void* d);
|
||||
|
||||
/** Reference counter.
|
||||
* The object is destroyed when @em ref_count_ reaches zero.
|
||||
*/
|
||||
short ref_count_;
|
||||
|
||||
/** Execution counter.
|
||||
* Indicates whether the signal is being emitted.
|
||||
*/
|
||||
short exec_count_;
|
||||
|
||||
/// Indicates whether the execution of sweep() is being deferred.
|
||||
bool deferred_;
|
||||
|
||||
/// The list of slots.
|
||||
std::list<slot_base> slots_;
|
||||
};
|
||||
|
||||
/// Exception safe sweeper for cleaning up invalid slots on the slot list.
|
||||
struct SIGC_API signal_exec
|
||||
{
|
||||
/// The parent sigc::signal_impl object.
|
||||
signal_impl* sig_;
|
||||
|
||||
/** Increments the reference and execution counter of the parent sigc::signal_impl object.
|
||||
* @param sig The parent sigc::signal_impl object.
|
||||
*/
|
||||
inline signal_exec(const signal_impl* sig)
|
||||
: sig_(const_cast<signal_impl*>(sig) )
|
||||
{ sig_->reference_exec(); }
|
||||
|
||||
/// Decrements the reference and execution counter of the parent sigc::signal_impl object.
|
||||
inline ~signal_exec()
|
||||
{ sig_->unreference_exec(); }
|
||||
};
|
||||
|
||||
/** Temporary slot list used during signal emission.
|
||||
* Through evolution this class is slightly misnamed. It is now
|
||||
* an index into the slot_list passed into it. It simply keeps track
|
||||
* of where the end of this list was at construction, and pretends that's
|
||||
* the end of your list. This way you may connect during emittion without
|
||||
* inadvertently entering an infinite loop, as well as make other
|
||||
* modifications to the slot_list at your own risk.
|
||||
*/
|
||||
struct temp_slot_list
|
||||
{
|
||||
typedef signal_impl::slot_list slot_list;
|
||||
typedef signal_impl::iterator_type iterator;
|
||||
typedef signal_impl::const_iterator_type const_iterator;
|
||||
|
||||
temp_slot_list(slot_list &slots) : slots_(slots)
|
||||
{
|
||||
placeholder = slots_.insert(slots_.end(), slot_base());
|
||||
}
|
||||
|
||||
~temp_slot_list()
|
||||
{
|
||||
slots_.erase(placeholder);
|
||||
}
|
||||
|
||||
iterator begin() { return slots_.begin(); }
|
||||
iterator end() { return placeholder; }
|
||||
const_iterator begin() const { return slots_.begin(); }
|
||||
const_iterator end() const { return placeholder; }
|
||||
|
||||
private:
|
||||
slot_list &slots_;
|
||||
slot_list::iterator placeholder;
|
||||
};
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
|
||||
/** @defgroup signal Signals
|
||||
* Use sigc::signal::connect() with sigc::mem_fun() and sigc::ptr_fun() to connect a method or function with a signal.
|
||||
*
|
||||
* @code
|
||||
* signal_clicked.connect( sigc::mem_fun(*this, &MyWindow::on_clicked) );
|
||||
* @endcode
|
||||
*
|
||||
* When the signal is emitted your method will be called.
|
||||
*
|
||||
* signal::connect() returns a connection, which you can later use to disconnect your method.
|
||||
* If the type of your object inherits from sigc::trackable the method is disconnected
|
||||
* automatically when your object is destroyed.
|
||||
*
|
||||
* When signals are copied they share the underlying information,
|
||||
* so you can have a protected/private sigc::signal member and a public accessor method.
|
||||
*
|
||||
* signal and slot objects provide the core functionality of this
|
||||
* library. A slot is a container for an arbitrary functor.
|
||||
* A signal is a list of slots that are executed on emission.
|
||||
* For compile time type safety a list of template arguments
|
||||
* must be provided for the signal template that determines the
|
||||
* parameter list for emission. Functors and closures are converted
|
||||
* into slots implicitely on connection, triggering compiler errors
|
||||
* if the given functor or closure cannot be invoked with the
|
||||
* parameter list of the signal to connect to.
|
||||
*/
|
||||
|
||||
/** Base class for the sigc::signal# templates.
|
||||
* signal_base integrates most of the interface of the derived sigc::signal#
|
||||
* templates. The implementation, however, resides in sigc::internal::signal_impl.
|
||||
* A sigc::internal::signal_impl object is dynamically allocated from signal_base
|
||||
* when first connecting a slot to the signal. This ensures that empty signals
|
||||
* don't waste memory.
|
||||
*
|
||||
* @ingroup signal
|
||||
*/
|
||||
struct SIGC_API signal_base : public trackable
|
||||
{
|
||||
typedef size_t size_type;
|
||||
|
||||
signal_base();
|
||||
|
||||
signal_base(const signal_base& src);
|
||||
|
||||
~signal_base();
|
||||
|
||||
signal_base& operator = (const signal_base& src);
|
||||
|
||||
/** Returns whether the list of slots is empty.
|
||||
* @return @p true if the list of slots is empty.
|
||||
*/
|
||||
inline bool empty() const
|
||||
{ return (!impl_ || impl_->empty()); }
|
||||
|
||||
/// Empties the list of slots.
|
||||
void clear();
|
||||
|
||||
/** Returns the number of slots in the list.
|
||||
* @return The number of slots in the list.
|
||||
*/
|
||||
size_type size() const;
|
||||
|
||||
protected:
|
||||
typedef internal::signal_impl::iterator_type iterator_type;
|
||||
|
||||
/** Adds a slot at the end of the list of slots.
|
||||
* With connect(), slots can also be added during signal emission.
|
||||
* In this case, they won't be executed until the next emission occurs.
|
||||
* @param slot_ The slot to add to the list of slots.
|
||||
* @return An iterator pointing to the new slot in the list.
|
||||
*/
|
||||
iterator_type connect(const slot_base& slot_);
|
||||
|
||||
/** Adds a slot at the given position into the list of slots.
|
||||
* Note that this function does not work during signal emission!
|
||||
* @param i An iterator indicating the position where @e slot_ should be inserted.
|
||||
* @param slot_ The slot to add to the list of slots.
|
||||
* @return An iterator pointing to the new slot in the list.
|
||||
*/
|
||||
iterator_type insert(iterator_type i, const slot_base& slot_);
|
||||
|
||||
/** Removes the slot at the given position from the list of slots.
|
||||
* Note that this function does not work during signal emission!
|
||||
* @param i An iterator pointing to the slot to be removed.
|
||||
* @return An iterator pointing to the slot in the list after the one removed.
|
||||
*/
|
||||
iterator_type erase(iterator_type i);
|
||||
|
||||
/** Returns the signal_impl object encapsulating the list of slots.
|
||||
* @return The signal_impl object encapsulating the list of slots.
|
||||
*/
|
||||
internal::signal_impl* impl() const;
|
||||
|
||||
/// The signal_impl object encapsulating the slot list.
|
||||
mutable internal::signal_impl* impl_;
|
||||
};
|
||||
|
||||
} //namespace sigc
|
||||
|
||||
#endif /* _SIGC_SIGNAL_BASE_H_ */
|
||||
9
libs/sigc++2/sigc++/slot.h
Normal file
9
libs/sigc++2/sigc++/slot.h
Normal file
@@ -0,0 +1,9 @@
|
||||
// -*- c++ -*-
|
||||
/* Do not edit! -- generated file */
|
||||
|
||||
|
||||
#ifndef _SIGC_MACROS_SLOTHM4_
|
||||
#define _SIGC_MACROS_SLOTHM4_
|
||||
|
||||
#include <sigc++/functors/slot.h>
|
||||
#endif /* _SIGC_MACROS_SLOTHM4_ */
|
||||
127
libs/sigc++2/sigc++/trackable.cc
Normal file
127
libs/sigc++2/sigc++/trackable.cc
Normal file
@@ -0,0 +1,127 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sigc++/trackable.h>
|
||||
#include <iostream>
|
||||
|
||||
SIGC_USING_STD(ostream)
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace sigc
|
||||
{
|
||||
|
||||
trackable::trackable()
|
||||
: callback_list_(0)
|
||||
{}
|
||||
|
||||
/* Don't copy the notification list.
|
||||
The objects watching src don't need to be notified when the new object dies. */
|
||||
trackable::trackable(const trackable& /*src*/)
|
||||
: callback_list_(0)
|
||||
{}
|
||||
|
||||
trackable& trackable::operator=(const trackable& src)
|
||||
{
|
||||
if(this != &src)
|
||||
notify_callbacks(); //Make sure that we have finished with existing stuff before replacing it.
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
trackable::~trackable()
|
||||
{
|
||||
notify_callbacks();
|
||||
}
|
||||
|
||||
void trackable::add_destroy_notify_callback(void* data, func_destroy_notify func) const
|
||||
{
|
||||
callback_list()->add_callback(data, func);
|
||||
}
|
||||
|
||||
void trackable::remove_destroy_notify_callback(void* data) const
|
||||
{
|
||||
callback_list()->remove_callback(data);
|
||||
}
|
||||
|
||||
void trackable::notify_callbacks()
|
||||
{
|
||||
if (callback_list_)
|
||||
delete callback_list_; //This invokes all of the callbacks.
|
||||
|
||||
callback_list_ = 0;
|
||||
}
|
||||
|
||||
internal::trackable_callback_list* trackable::callback_list() const
|
||||
{
|
||||
if (!callback_list_)
|
||||
callback_list_ = new internal::trackable_callback_list;
|
||||
|
||||
return callback_list_;
|
||||
}
|
||||
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
trackable_callback_list::~trackable_callback_list()
|
||||
{
|
||||
clearing_ = true;
|
||||
|
||||
for (callback_list::iterator i = callbacks_.begin(); i != callbacks_.end(); ++i)
|
||||
(*i).func_((*i).data_);
|
||||
}
|
||||
|
||||
void trackable_callback_list::add_callback(void* data, func_destroy_notify func)
|
||||
{
|
||||
if (!clearing_) // TODO: Is it okay to silently ignore attempts to add dependencies when the list is being cleared?
|
||||
// I'd consider this a serious application bug, since the app is likely to segfault.
|
||||
// But then, how should we handle it? Throw an exception? Martin.
|
||||
callbacks_.push_back(trackable_callback(data, func));
|
||||
}
|
||||
|
||||
void trackable_callback_list::clear()
|
||||
{
|
||||
clearing_ = true;
|
||||
|
||||
for (callback_list::iterator i = callbacks_.begin(); i != callbacks_.end(); ++i)
|
||||
(*i).func_((*i).data_);
|
||||
|
||||
callbacks_.clear();
|
||||
|
||||
clearing_ = false;
|
||||
}
|
||||
|
||||
void trackable_callback_list::remove_callback(void* data)
|
||||
{
|
||||
if (clearing_) return; // No circular notices
|
||||
|
||||
for (callback_list::iterator i = callbacks_.begin(); i != callbacks_.end(); ++i)
|
||||
if ((*i).data_ == data)
|
||||
{
|
||||
callbacks_.erase(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
|
||||
} /* namespace sigc */
|
||||
148
libs/sigc++2/sigc++/trackable.h
Normal file
148
libs/sigc++2/sigc++/trackable.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_TRACKABLE_HPP_
|
||||
#define _SIGC_TRACKABLE_HPP_
|
||||
#include <list>
|
||||
#include <sigc++config.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
namespace internal {
|
||||
|
||||
typedef void* (*func_destroy_notify) (void* data);
|
||||
|
||||
/** Destroy notification callback.
|
||||
* A destroy notification callback consists of a data pointer and a
|
||||
* function pointer. The function is executed from the owning callback
|
||||
* list (of type sigc::internal::trackable_callback_list) when its parent
|
||||
* object (of type sigc::trackable) is destroyed or overwritten.
|
||||
*/
|
||||
struct SIGC_API trackable_callback
|
||||
{
|
||||
void* data_;
|
||||
func_destroy_notify func_;
|
||||
trackable_callback(void* data, func_destroy_notify func)
|
||||
: data_(data), func_(func) {}
|
||||
};
|
||||
|
||||
/** Callback list.
|
||||
* A callback list holds an STL list of callbacks of type
|
||||
* trackable_callback. Callbacks are added and removed with
|
||||
* add_callback(), remove_callback() and clear(). The callbacks
|
||||
* are invoked from clear() and from the destructor.
|
||||
*/
|
||||
struct SIGC_API trackable_callback_list
|
||||
{
|
||||
/** Add a callback function.
|
||||
* @param data Data that will be sent as a parameter to teh callback function.
|
||||
* @param func The callback function.
|
||||
*
|
||||
*/
|
||||
void add_callback(void* data, func_destroy_notify func);
|
||||
|
||||
/** Remove the callback which has this data associated with it.
|
||||
* @param data The data that was given as a parameter to add_callback().
|
||||
*/
|
||||
void remove_callback(void* data);
|
||||
|
||||
/** This invokes all of the callback functions.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
trackable_callback_list()
|
||||
: clearing_(false) {}
|
||||
|
||||
/** This invokes all of the callback functions.
|
||||
*/
|
||||
~trackable_callback_list();
|
||||
|
||||
private:
|
||||
typedef std::list<trackable_callback> callback_list;
|
||||
callback_list callbacks_;
|
||||
bool clearing_;
|
||||
};
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
|
||||
/** Base class for objects with auto-disconnection.
|
||||
* trackable must be inherited when objects shall automatically
|
||||
* invalidate slots referring to them on destruction.
|
||||
* A slot built from a member function of a trackable derived
|
||||
* type installs a callback that is invoked when the trackable object
|
||||
* is destroyed or overwritten.
|
||||
*
|
||||
* add_destroy_notify_callback() and remove_destroy_notify_callback()
|
||||
* can be used to manually install and remove callbacks when
|
||||
* notification of the object dying is needed.
|
||||
*
|
||||
* notify_callbacks() invokes and removes all previously installed
|
||||
* callbacks and can therefore be used to disconnect from all signals.
|
||||
*
|
||||
* Note that there is no virtual destructor. Don't use @p trackable*
|
||||
* as pointer type for managing your data or the destructors of
|
||||
* your derived types won't be called when deleting your objects.
|
||||
*
|
||||
* @ingroup signal
|
||||
*/
|
||||
struct SIGC_API trackable
|
||||
{
|
||||
trackable();
|
||||
|
||||
trackable(const trackable& src);
|
||||
|
||||
trackable& operator=(const trackable& src);
|
||||
|
||||
~trackable();
|
||||
|
||||
/*virtual ~trackable() {} */ /* we would need a virtual dtor for users
|
||||
who insist on using "trackable*" as
|
||||
pointer type for their own derived objects */
|
||||
|
||||
|
||||
typedef internal::func_destroy_notify func_destroy_notify;
|
||||
|
||||
/** Add a callback that is executed (notified) when the trackable object is detroyed.
|
||||
* @param data Passed into func upon notification.
|
||||
* @param func Callback executed upon destruction of the object.
|
||||
*/
|
||||
void add_destroy_notify_callback(void* data, func_destroy_notify func) const;
|
||||
|
||||
/** Remove a callback previously installed with add_destroy_notify_callback().
|
||||
* The callback is not executed.
|
||||
* @param data Parameter passed into previous call to add_destroy_notify_callback().
|
||||
*/
|
||||
void remove_destroy_notify_callback(void* data) const;
|
||||
|
||||
/// Execute and remove all previously installed callbacks.
|
||||
void notify_callbacks();
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
private:
|
||||
/* The callbacks are held in a list of type trackable_callback_list.
|
||||
* This list is allocated dynamically when the first callback is added.
|
||||
*/
|
||||
internal::trackable_callback_list* callback_list() const;
|
||||
mutable internal::trackable_callback_list* callback_list_;
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
#endif /* _SIGC_TRACKABLE_HPP_ */
|
||||
147
libs/sigc++2/sigc++/type_traits.h
Normal file
147
libs/sigc++2/sigc++/type_traits.h
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_TYPE_TRAIT_H_
|
||||
#define _SIGC_TYPE_TRAIT_H_
|
||||
|
||||
#include <sigc++config.h> //To get SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION
|
||||
|
||||
|
||||
namespace sigc {
|
||||
|
||||
template <class T_type>
|
||||
struct type_trait
|
||||
{
|
||||
typedef T_type type;
|
||||
typedef T_type& pass;
|
||||
typedef const T_type& take;
|
||||
typedef T_type* pointer;
|
||||
};
|
||||
|
||||
template <class T_type, int N>
|
||||
struct type_trait<T_type[N]>
|
||||
{
|
||||
typedef T_type* type;
|
||||
typedef T_type*& pass;
|
||||
typedef const T_type*& take;
|
||||
typedef T_type** pointer;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
struct type_trait<T_type&>
|
||||
{
|
||||
typedef T_type type;
|
||||
typedef T_type& pass;
|
||||
typedef T_type& take;
|
||||
typedef T_type* pointer;
|
||||
};
|
||||
|
||||
template <class T_type>
|
||||
struct type_trait<const T_type&>
|
||||
{
|
||||
typedef const T_type type;
|
||||
typedef const T_type& pass;
|
||||
typedef const T_type& take;
|
||||
typedef const T_type* pointer;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct type_trait<void>
|
||||
{
|
||||
typedef void type;
|
||||
typedef void pass;
|
||||
typedef void take;
|
||||
typedef void* pointer;
|
||||
};
|
||||
|
||||
|
||||
// From Esa Pulkkin:
|
||||
/**
|
||||
* Compile-time determination of base-class relationship in C++
|
||||
* (adapted to match the syntax of boost's type_traits library).
|
||||
*
|
||||
* Use this to provide a template specialization for a set of types.
|
||||
* For instance,
|
||||
*
|
||||
* template < class T_thing, bool Tval_derives_from_something = sigc::is_base_and_derived<Something, T_thing>::value >
|
||||
* class TheTemplate
|
||||
* {
|
||||
* //Standard implementation.
|
||||
* }
|
||||
*
|
||||
* //Specialization for T_things that derive from Something (Tval_derives_from_something is true)
|
||||
* template <class T_thing>
|
||||
* class TheTemplate<T_thing, true>
|
||||
* {
|
||||
* T_thing thing;
|
||||
thing.method_that_is_in_something();
|
||||
* }
|
||||
*/
|
||||
template <class T_base, class T_derived>
|
||||
struct is_base_and_derived
|
||||
{
|
||||
private:
|
||||
struct big {
|
||||
char memory[64];
|
||||
};
|
||||
|
||||
#ifndef SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION
|
||||
|
||||
//Allow the internal inner class to access the other (big) inner
|
||||
//class. The Tru64 compiler needs this. murrayc.
|
||||
friend struct internal_class;
|
||||
|
||||
//Certain compilers, notably GCC 3.2, require these functions to be inside an inner class.
|
||||
struct internal_class
|
||||
{
|
||||
static big is_base_class_(...);
|
||||
static char is_base_class_(typename type_trait<T_base>::pointer);
|
||||
};
|
||||
|
||||
public:
|
||||
static const bool value =
|
||||
sizeof(internal_class::is_base_class_(reinterpret_cast<typename type_trait<T_derived>::pointer>(0))) ==
|
||||
sizeof(char);
|
||||
|
||||
#else //SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION
|
||||
|
||||
//The AIX xlC compiler does not like these 2 functions being in the inner class.
|
||||
//It says "The incomplete type "test" must not be used as a qualifier.
|
||||
//It does not seem necessary anyway. murrayc.
|
||||
static big is_base_class_(...);
|
||||
static char is_base_class_(typename type_trait<T_base>::pointer);
|
||||
|
||||
public:
|
||||
static const bool value =
|
||||
sizeof(is_base_class_(reinterpret_cast<typename type_trait<T_derived>::pointer>(0))) ==
|
||||
sizeof(char);
|
||||
|
||||
#endif //SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION
|
||||
|
||||
void avoid_gcc3_warning_(); //Not implemented. g++ 3.3.5 (but not 3.3.4, and not 3.4) warn that there are no public methods, even though there is a public variable.
|
||||
};
|
||||
|
||||
template <class T_base>
|
||||
struct is_base_and_derived<T_base, T_base>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
} /* namespace sigc */
|
||||
|
||||
#endif /* _SIGC_TYPE_TRAIT_H_ */
|
||||
174
libs/sigc++2/sigc++/visit_each.h
Normal file
174
libs/sigc++2/sigc++/visit_each.h
Normal file
@@ -0,0 +1,174 @@
|
||||
// -*- c++ -*-
|
||||
/*
|
||||
* Copyright 2002, The libsigc++ Development Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef _SIGC_VISIT_EACH_HPP_
|
||||
#define _SIGC_VISIT_EACH_HPP_
|
||||
|
||||
#include <sigc++/type_traits.h>
|
||||
|
||||
namespace sigc {
|
||||
|
||||
namespace internal {
|
||||
|
||||
//This should really be an inner class of limit_derived_target, without the T_limit template type,
|
||||
//But the SUN CC 5.7 (not earlier versions) compiler finds it ambiguous when we specify a particular specialization of it.
|
||||
//and does not seem to allow us to tell it explicitly that it's an inner class.
|
||||
template <bool I_derived, class T_type, class T_limit>
|
||||
struct with_type;
|
||||
|
||||
//Specialization for I_derived = false
|
||||
template <class T_type, class T_limit> struct
|
||||
with_type<false, T_type, T_limit>
|
||||
{
|
||||
static void execute_(const T_type&, const T_limit&) {}
|
||||
};
|
||||
|
||||
//Specialization for I_derived = true
|
||||
template <class T_type, class T_limit>
|
||||
struct with_type<true, T_type, T_limit>
|
||||
{
|
||||
static void execute_(const T_type& _A_type, const T_limit& _A_action)
|
||||
{ _A_action.action_(_A_type); }
|
||||
};
|
||||
|
||||
|
||||
/// Helper struct for visit_each_type().
|
||||
template <class T_target, class T_action>
|
||||
struct limit_derived_target
|
||||
{
|
||||
typedef limit_derived_target<T_target, T_action> T_self;
|
||||
|
||||
|
||||
template <class T_type>
|
||||
void operator()(const T_type& _A_type) const
|
||||
{
|
||||
with_type<is_base_and_derived<T_target, T_type>::value, T_type, T_self>::execute_(_A_type, *this);
|
||||
}
|
||||
|
||||
limit_derived_target(const T_action& _A_action)
|
||||
: action_(_A_action)
|
||||
{}
|
||||
|
||||
T_action action_;
|
||||
};
|
||||
|
||||
// Specialization for T_target pointer types, to provide a slightly different execute_() implementation.
|
||||
|
||||
template <bool I_derived, class T_type, class T_limit>
|
||||
struct with_type_pointer;
|
||||
|
||||
//Specialization for I_derived = false
|
||||
template <class T_type, class T_limit>
|
||||
struct with_type_pointer<false, T_type, T_limit>
|
||||
{
|
||||
static void execute_(const T_type&, const T_limit&) {}
|
||||
};
|
||||
|
||||
//Specialization for I_derived = true
|
||||
template <class T_type, class T_limit>
|
||||
struct with_type_pointer<true, T_type, T_limit>
|
||||
{
|
||||
static void execute_(const T_type& _A_type, const T_limit& _A_action)
|
||||
{ _A_action.action_(&_A_type); }
|
||||
};
|
||||
|
||||
template <class T_target, class T_action>
|
||||
struct limit_derived_target<T_target*, T_action>
|
||||
{
|
||||
typedef limit_derived_target<T_target*, T_action> T_self;
|
||||
|
||||
|
||||
template <class T_type>
|
||||
void operator()(const T_type& _A_type) const
|
||||
{
|
||||
with_type_pointer<is_base_and_derived<T_target, T_type>::value, T_type, T_self>::execute_(_A_type, *this);
|
||||
}
|
||||
|
||||
limit_derived_target(const T_action& _A_action)
|
||||
: action_(_A_action)
|
||||
{}
|
||||
|
||||
T_action action_;
|
||||
};
|
||||
|
||||
} /* namespace internal */
|
||||
|
||||
|
||||
/** This function performs a functor on each of the targets of a functor.
|
||||
* All unknown types just call @e _A_action on them.
|
||||
* Add overloads that specialize the @e T_functor argument for your own
|
||||
* functor types, so that subobjects get visited. This is needed to enable
|
||||
* auto-disconnection support for your functor types.
|
||||
*
|
||||
* @par Example:
|
||||
* @code
|
||||
* struct some_functor
|
||||
* {
|
||||
* void operator()() {}
|
||||
* some_possibly_sigc_trackable_derived_type some_data_member;
|
||||
* some_other_functor_type some_other_functor;
|
||||
* }
|
||||
*
|
||||
* namespace sigc
|
||||
* {
|
||||
* template <class T_action>
|
||||
* void visit_each(const T_action& _A_action,
|
||||
* const some_functor& _A_target)
|
||||
* {
|
||||
* visit_each(_A_action, _A_target.some_data_member);
|
||||
* visit_each(_A_action, _A_target.some_other_functor);
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
template <class T_action, class T_functor>
|
||||
void visit_each(const T_action& _A_action, const T_functor& _A_functor)
|
||||
{ _A_action(_A_functor); }
|
||||
|
||||
/** This function performs a functor on each of the targets
|
||||
* of a functor limited to a restricted type.
|
||||
*
|
||||
* @ingroup functors
|
||||
*/
|
||||
template <class T_type, class T_action, class T_functor>
|
||||
void visit_each_type(const T_action& _A_action, const T_functor& _A_functor)
|
||||
{
|
||||
typedef internal::limit_derived_target<T_type, T_action> type_limited_action;
|
||||
|
||||
type_limited_action limited_action(_A_action);
|
||||
|
||||
//specifying the types of the template specialization prevents disconnection of bound trackable references (such as with sigc::ref()),
|
||||
//probably because the visit_each<> specializations take various different template types,
|
||||
//in various sequences, and we are probably specifying only a subset of them with this.
|
||||
//
|
||||
//But this is required by the AIX (and maybe IRIX MipsPro and Tru64) compilers.
|
||||
//I guess that sigc::ref() therefore does not work on those platforms. murrayc
|
||||
//visit_each<type_limited_action, T_functor>(limited_action, _A_functor);
|
||||
|
||||
//g++ (even slightly old ones) is our primary platform, so we could use the non-crashing version.
|
||||
//However, the expliict version also fixes a crash in a slightl more common case: http://bugzilla.gnome.org/show_bug.cgi?id=169225
|
||||
//Users (and distributors) of libsigc++ on AIX (and maybe IRIX MipsPro and Tru64) do
|
||||
//need to use the version above instead, to allow compilation.
|
||||
visit_each(limited_action, _A_functor);
|
||||
}
|
||||
|
||||
} /* namespace sigc */
|
||||
#endif
|
||||
80
libs/sigc++2/sigc++config.h.in
Normal file
80
libs/sigc++2/sigc++config.h.in
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
#ifndef _SIGCXX_CONFIG_H
|
||||
#define _SIGCXX_CONFIG_H
|
||||
|
||||
// Detect common platforms
|
||||
#if defined(_WIN32)
|
||||
// Win32 compilers have a lot of variation
|
||||
#if defined(_MSC_VER)
|
||||
#define SIGC_MSC
|
||||
#define SIGC_WIN32
|
||||
#define SIGC_DLL
|
||||
#elif defined(__CYGWIN__)
|
||||
#define SIGC_CONFIGURE
|
||||
#elif defined(__MINGW32__)
|
||||
#define SIGC_WIN32
|
||||
#define SIGC_CONFIGURE
|
||||
#else
|
||||
//The Tru64 compiler complains about this "unrecognized preprocessing directive", but it should never get this far anyway.
|
||||
//#warning "libsigc++ config: Unknown win32 architecture (send me gcc --dumpspecs or equiv)"
|
||||
#endif
|
||||
#else
|
||||
#define SIGC_CONFIGURE
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifdef SIGC_CONFIGURE
|
||||
// configure checks
|
||||
#undef SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#undef SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#undef SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION
|
||||
|
||||
#undef SIGC_HAVE_NAMESPACE_STD
|
||||
#undef SIGC_HAVE_SUN_REVERSE_ITERATOR
|
||||
#undef SIGC_TYPEDEF_REDEFINE_ALLOWED
|
||||
|
||||
// platform specific macros
|
||||
// #define LIBSIGC_DISABLE_DEPRECATED
|
||||
// #define SIGC_NEW_DELETE_IN_LIBRARY_ONLY
|
||||
#endif /* SIGC_CONFIGURE */
|
||||
|
||||
#ifdef SIGC_MSC
|
||||
|
||||
// MS VC7 Warning 4251 says that the classes to any member objects in an
|
||||
// exported class must be also be exported. Some of the libsigc++
|
||||
// template classes contain std::list members. MS KB article 168958 says
|
||||
// that it's not possible to export a std::list instantiation due to some
|
||||
// wacky class nesting issues, so our only options are to ignore the
|
||||
// warning or to modify libsigc++ to remove the std::list dependency.
|
||||
// AFAICT, the std::list members are used internally by the library code
|
||||
// and don't need to be used from the outside, and ignoring the warning
|
||||
// seems to have no adverse effects, so that seems like a good enough
|
||||
// solution for now.
|
||||
//
|
||||
#pragma warning(disable:4251)
|
||||
|
||||
#define SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
|
||||
#define SIGC_NEW_DELETE_IN_LIBRARY_ONLY // To keep ABI compatibility
|
||||
#define SIGC_HAVE_NAMESPACE_STD 1
|
||||
|
||||
#endif /* SIGC_MSC */
|
||||
|
||||
//Put things in the std namespace, if they should be there.
|
||||
#ifndef SIGC_HAVE_NAMESPACE_STD
|
||||
# define SIGC_USING_STD(Symbol) namespace std { using ::Symbol; }
|
||||
#else
|
||||
# define SIGC_USING_STD(Symbol) /* empty */
|
||||
#endif
|
||||
|
||||
#ifdef SIGC_DLL
|
||||
#if defined(SIGC_BUILD) && defined(_WINDLL)
|
||||
#define SIGC_API __declspec(dllexport)
|
||||
#elif !defined(SIGC_BUILD)
|
||||
#define SIGC_API __declspec(dllimport)
|
||||
#else
|
||||
#define SIGC_API
|
||||
#endif /* SIGC_BUILD - _WINDLL */
|
||||
#else
|
||||
#define SIGC_API
|
||||
#endif /* SIGC_DLL */
|
||||
|
||||
#endif /* _SIGCXX_CONFIG_H */
|
||||
Reference in New Issue
Block a user