..... virtual void Mediator::Send(std::string message, Colleague *colleague) { if (colleague==static_cast<Colleague*>(m_Colleague1)) { m_Colleague2->Notify(message); } else if (colleague==static_cast<Colleague*>(m_Colleague2)) { m_Colleague1->Notify(message); } }....
C++ (Qt)class CAdjuster : public QObject { Q_OBJECT public: void AddPair( QWidget *, QWidget * ); public slots: void Adjust( QWidget * src, TCommand cmd ); typedef enum { cmd_SetButton, cmd_SetLabel,} TCommand; private: QVector <QPair<QWidget *, QWidget *> > mData; };