Files
envi-code/SourceCode/Code2026/tg_shs/shs_pipebase/TReactorUnlockSwitch.h
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

30 lines
539 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