Files
envi-code/SourceCode/Code2026/tg_shs/shs_pipebase/TReactorUnlockSwitch.h
T
2026-09-28 15:28:50 +08:00

30 lines
536 B
C++

#ifndef _TREACTORUNLOCKSWITCH_H__
#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