2026-10-04 00:04:20 +08:00
|
|
|
#ifndef _TREACTORUNLOCKSWITCH_H__
|
2026-09-28 15:28:50 +08:00
|
|
|
#define _TREACTORUNLOCKSWITCH_H__
|
|
|
|
|
|
|
|
|
|
template <class T1,class T2> class TReactorUnlockSwitch
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
TReactorUnlockSwitch(T1* pOwner,T2* pReactor)
|
|
|
|
|
{
|
|
|
|
|
m_pOwner = NULL; m_pReactor = NULL;
|
|
|
|
|
if (pOwner != NULL && pReactor != NULL)
|
|
|
|
|
{
|
|
|
|
|
pOwner->removeReactor(pReactor);
|
|
|
|
|
m_pReactor = pReactor;
|
|
|
|
|
m_pOwner = pOwner;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
~TReactorUnlockSwitch()
|
|
|
|
|
{
|
|
|
|
|
if (m_pOwner != NULL && m_pReactor != NULL)
|
|
|
|
|
{
|
|
|
|
|
m_pOwner->addReactor(m_pReactor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private:
|
|
|
|
|
T1* m_pOwner;
|
|
|
|
|
T2* m_pReactor;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|