//
// C++ Implementation: signal_slot_test
//
// Description: 
//
//
// Author: Messenger of death aka Denis A. Birukov <messengerofdeath@gmail.com>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include <stdio.h>
#include "slot.h"
#include "me_signal.h"
#include "signal_manager.h"
#include "storage.h"
class Test
{
    public:
            
        DECLARE_SLOT(Test, print)
        {
            printf ( "%s\n", args->string_args.at(0).c_str() );
            return true;
        };
        DECLARE_SLOT(Test, print_number)
        {
            printf("%d\n", (int)args->string_args.at(0).length());
            return true;
        }
		
    private:
    public:
        Test() : INIT_SLOT(Test, this, print), INIT_SLOT(Test, this, print_number)
        {
            register_slot("slot1", &print);
            register_slot("slot2", &print_number);
        }
	virtual ~Test(){};
};

int main()
{
    Signal signal1("mega_signal->print");
    Signal signal2("mega_signal->print_count");
    signal1.add_params("Hello World");
    signal2.add_params("GoodBye World");
    connect("mega_signal->print", "slot1");
    
    Test a;
    signal1.rise();
    signal2.rise();
    disconnect("mega_signal->print", "slot1");
}
