/*
  sigc.cpp test file.  Compile with:
  g++ sigc.cpp -o sigc -std=c++0x `pkg-config --cflags --libs sigc++-2.0`
*/

#include <iostream>
#include <functional>

#include <sigc++/sigc++.h>

class Test: public sigc::trackable {
  int a;
public:
  void non_static_func() {std::cout << "In non_static_func" << std::endl;}
  static void static_func() {std::cout << "In static_func" << std::endl;}
  Test(): a(0) {}
};

int main() {
  sigc::signal<void> sig;
  Test* test = new Test;
  sig.connect(sigc::mem_fun(*test, &Test::non_static_func));
  //sig.connect(sigc::mem_fun(*test, &Test::static_func));
  sig.connect(sigc::ptr_fun(&Test::static_func));

  sig.connect(std::bind(&Test::non_static_func, test));


  sig.emit();

  std::cout << "Deleting Test object" << std::endl;
  delete test;

  sig.emit();
}
