Skip to content

Commit

Permalink
fix: LLBC_Event operator<<实现bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reckfullol committed Dec 25, 2024
1 parent fa57d6c commit 0facb3a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions llbc/include/llbc/core/event/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ class LLBC_EXPORT LLBC_Event : public LLBC_PoolObj
LLBC_Delegate<void(void *)> *_extDataClearDeleg;
};

/**
* Stream output operator support.
*/
std::ostream &operator<<(std::ostream &o, const LLBC_Event &ev);

/**
* \brief The event deleg class encapsulation.
*/
Expand All @@ -179,4 +174,9 @@ class LLBC_EXPORT LLBC_EventListener

__LLBC_NS_END

/**
* Stream output operator support.
*/
std::ostream &operator<<(std::ostream &o, const llbc::LLBC_Event &ev);

#include "llbc/core/event/EventInl.h"
34 changes: 17 additions & 17 deletions llbc/include/llbc/core/event/EventInl.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,22 @@ inline LLBC_Event &LLBC_Event::operator=(LLBC_Event &&other) noexcept
return *this;
}

inline std::ostream &operator<<(std::ostream &o, const LLBC_Event &ev)
inline void LLBC_Event::Reuse()
{
ClearExtData(true);

LLBC_STLHelper::DeleteContainer(_heavyKeys);
_params.clear();

_dontDelAfterFire = false;
_id = 0;
}

#undef __LLBC_Inl_EventKeyMatch

__LLBC_NS_END

inline std::ostream &operator<<(std::ostream &o, const llbc::LLBC_Event &ev)
{
o << "LLBC_Event("
<< "id:" << ev.GetId()
Expand All @@ -249,19 +264,4 @@ inline std::ostream &operator<<(std::ostream &o, const LLBC_Event &ev)
o << "})";

return o;
}

inline void LLBC_Event::Reuse()
{
ClearExtData(true);

LLBC_STLHelper::DeleteContainer(_heavyKeys);
_params.clear();

_dontDelAfterFire = false;
_id = 0;
}

#undef __LLBC_Inl_EventKeyMatch

__LLBC_NS_END
}

0 comments on commit 0facb3a

Please sign in to comment.