novowind / cpp-events Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/cpp-events
License: MIT License
Automatically exported from code.google.com/p/cpp-events
License: MIT License
CppEvents - event/delegate (signal/slot) mechanism implementation for C++ http://code.google.com/p/cpp-events/ Library is written in C++03 and does not use C++0x features. For generating variadic templates custom preprocessor was written. It was named MCS, that stands for Monkey Coding Script;) The MCS executable is an interpreter for the custom scripting language specially designed for generating plain text files. Script files are named by appending '.mcs' suffix to the name of the output file, e.g. script file named 'ArgList.hpp.mcs' is used for generating source file 'ArgList.hpp'. This distribution contains both MCS script files and generated C++ source files, so you do not need to build the MCS executable if you are not going to edit library sources. The MCS executable is built using GNU Bison (version 2.4.1) and Flex (version 2.5.35). Bison version 2.3.1 and Flex version 2.5.4 do not work, other version were not tested. Windows executable for Bison was used from the GnuWin32 project, and the one for Flex - from the Cygwin project. Files that were generated by Bison and Flex are also included into this distribution. Google C++ Testing Framework is required for building unit test suit. If framework is not be found then building unit test suilt is skipped. Elsewise Test suit is built and executed as a part of the building process. It is strongly recommended to install the Framework, build and run test suit on your system. > Note! In default distribution of Google C++ Testing Framework project files > for MSVS are configured for linking against static runtime library. This > should be reverted to the DLL versions. Distribution also contains set of execution speed tests that include tests for CppEvents, Boost.Signals, LigSigC++, SigSlot, Qt and C#. These tests are built if dependency library is found. C# test is not included in CMake build files, but can be built using native MSVS project. Please note that C# test runs very quickly, but hangs for a very long time when it comes to garbage collection. Library uses CMake as a distribution build system but native MSVS 2005 project files are included in the distribution as well. Project files are separated from sources and located in the 'build' subdirectory. Subdirectory 'build/cmake' contains input files for CMake. Subdirectory 'build/cmake.out' is a storage for files generated by CMake and is originally empty. In order to build library and tests with CMake change your working directory to 'build/cmake.out' and run 'cmake ../cmake' command. Directory 'build/cmake.out' will contain project files for your native build system. Subdirectory 'build/msvs2005' contains native project files for MSVS. These are origianl IDE files used for development. They expect that all dependecies are available and do not run unit tests automatically. After building the library, add path to the 'src' subdirectory to the list of the system include directories and path to the 'lib' subdirectory to the list of the library directories. The MCS interpreter is not built automatically when building the library and should be built separately if needed. This is done so because Bison and Flex are likely to be the source of problems when building the interpreter. I don't want this to break the entire building process. Separate tree of project files for building interpreter is located in subdirectory 'tools/mcs/build'. Use it as described above. Resulting executable should be located in the directory 'tools/mcs/bin/Release' or 'tools/mcs/bin'. I hope this library will be useful to you. If you have any comments, questions, ideas or propositions please e-mail me. All feedback will be much appreciated. Nickolas V. Pohilets ([email protected])
1. What cases cause this problem (compiler, linkage options, etc.)?
2. How to detect this problem ?
3. Possible workarounds?
Original issue reported on code.google.com by [email protected]
on 28 Oct 2009 at 8:55
Research if it is possible to use declaration of new class as return type
of functions (similar to declaring instances of the class inside class
declaration statement).
Example:
class OuterTestClass
{
class InnerTestClass
{
InnerTestClass(int x) : x_(x) {}
int getX() { return x_; }
void setX(int x) { x_ = x; }
private:
int x_;
} testFunction() { return -34; }
};
Original issue reported on code.google.com by [email protected]
on 28 Oct 2009 at 8:38
Add support for functor objects
Example:
Connection c = scope_.connect(sender->event(), func);
Original issue reported on code.google.com by [email protected]
on 29 Oct 2009 at 3:31
What steps will reproduce the problem?
1. cd cpp-events/build
2. mkdir macos
3. cd macos
4. cmake ../cmake
5. make
or
4. export CC=gcc-mp-4.5
5. export CXX=g++-mp-4.5
6. cmake ../cmake
7. make
What is the expected output? What do you see instead?
It should compile but in both ways, there is an error
[ 10%] Building CXX object .../src/Cpp/Events/ConnectionList.cpp.o
.../src/Cpp/Threading/POSIX/AtomicInt.hpp.inl: In member function 'void
Cpp::AtomicInt::retain()':
.../src/Cpp/Threading/POSIX/AtomicInt.hpp.inl:32: error: '__sync_add_and_fetch'
was not declared in this scope
.../src/Cpp/Threading/POSIX/AtomicInt.hpp.inl: In member function 'bool
Cpp::AtomicInt::release()':
.../src/Cpp/Threading/POSIX/AtomicInt.hpp.inl:33: error: '__sync_sub_and_fetch'
was not declared in this scope
So, I use a more recent compiler
[ 9%] Building CXX object .../ConnectionList.cpp.o
[ 18%] Building CXX object .../Threading.cpp.o
In file included from .../src/Cpp/Threading/RecursiveMutex.hpp:27:0,
from .../src/Cpp/Events/Threading.cpp:26:
.../src/Cpp/Threading/POSIX/RecursiveMutex.hpp.inl: In constructor
'Cpp::RecursiveMutex::RecursiveMutex()':
.../src/Cpp/Threading/POSIX/RecursiveMutex.hpp.inl:33:37: error:
'PTHREAD_MUTEX_RECURSIVE_NP' was not declared in this scope
What version of the product are you using? On what operating system?
MacOS X 10.4.11
gcc 4.0.1 and gcc 4.5.2
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 5 May 2011 at 9:02
Low-level ConnectionList should be hidden from the user.
For that purpose ConnectionScope class should be introduced.
Original issue reported on code.google.com by [email protected]
on 28 Oct 2009 at 8:51
Use scope-oriented syntax instead of event-oriented
Current:
senderObject->theEvent().connect(&connectionScope_, reciever,
&RecieverClass::delegateFunction);
New:
connectionScope_.connect(senderObject->theEvent(), reciever,
&RecieverClass::delegateFunction);
Original issue reported on code.google.com by [email protected]
on 29 Oct 2009 at 3:20
1. What type do C++0x lambda functions have? Is it std::function<>? Can we
avoid dynamic polymorphism?
2. Are they movable?
3. Can they be compared?
Information sources:
1. http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions
2. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2960.pdf
Original issue reported on code.google.com by [email protected]
on 28 Oct 2009 at 8:31
Introduce connection handler mechanism
Example:
Connection c1 = scope_.connect(sender->event(), reciever,
&Reciever::delegate);
Connection c2 = scope_.connect(sender->event(), reciever,
&Reciever::delegate);
void ConnectionMap::insert(T const & key, Connection c)
{
ConnectionLock connLock(c);
map_.insert(std::make_pair(key, c));
connLock.addDisconnectListener(this, &ConnectionMap::removeConn);
}
{
ConnectionLock connLock(c);
connLock.disconnect();
}
Original issue reported on code.google.com by [email protected]
on 29 Oct 2009 at 3:28
Custom minimalistic class for dynamic array with implicit sharing for
ConnectionList internals and possibly other places
Original issue reported on code.google.com by [email protected]
on 28 Oct 2009 at 8:49
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.