src/core/trace-source-accessor.h
changeset 2531 b451b5fc8b57
parent 2463 c77e43117673
child 2569 d5cff2968984
     1.1 --- a/src/core/trace-source-accessor.h	Fri Feb 22 00:08:00 2008 +0100
     1.2 +++ b/src/core/trace-source-accessor.h	Sun Mar 02 21:00:37 2008 +0100
     1.3 @@ -17,6 +17,7 @@
     1.4    void Unref (void) const;
     1.5  
     1.6    virtual bool Connect (ObjectBase *obj, const CallbackBase &cb) const = 0;
     1.7 +  virtual bool ConnectWithContext (ObjectBase *obj, std::string context, const CallbackBase &cb) const = 0;
     1.8    virtual bool Disconnect (ObjectBase *obj, const CallbackBase &cb) const = 0;
     1.9  private:
    1.10    mutable uint32_t m_count;
    1.11 @@ -44,6 +45,15 @@
    1.12        (p->*m_source).Connect (cb);
    1.13        return true;
    1.14      }
    1.15 +    virtual bool ConnectWithContext (ObjectBase *obj, std::string context, const CallbackBase &cb) const {
    1.16 +      T *p = dynamic_cast<T*> (obj);
    1.17 +      if (p == 0)
    1.18 +	{
    1.19 +	  return false;
    1.20 +	}
    1.21 +      (p->*m_source).ConnectWithContext (cb, context);
    1.22 +      return true;
    1.23 +    }
    1.24      virtual bool Disconnect (ObjectBase *obj, const CallbackBase &cb) const {
    1.25        T *p = dynamic_cast<T*> (obj);
    1.26        if (p == 0)