/*------------------------------------------------------------------------------
 src/lib/djWidget/djWidget_.h

 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

namespace dj {

template <class T>
Signal<T>::Signal() :
  _obj(0), _callback(0)
{}

template <class T>
void Signal<T>::set(void * obj, Callback * callback)
{
  _obj = obj;
  _callback = callback;
}

template <class T>
void Signal<T>::del(void * obj, Callback * callback)
{
  if (obj == _obj && callback == _callback) {
    _obj = 0;
    _callback = 0;
  }
}

template <class T>
void Signal<T>::emit(T in)
{
  if (_obj && _callback)
    _callback(_obj, in);
}

}
