Giter Club home page Giter Club logo

cpp-events's Introduction

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])

cpp-events's People

Contributors

nickolas-pohilets avatar

cpp-events's Issues

Research of RTTI/DLL problem

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 of idea of declaring classes inside function declaration (as return type)

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

Can't compile under MacOS X

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

Change connection syntax

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

Research of C++0x lambda functions

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

Connection handling

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 Array class

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.