SpiecsEngine
 
Loading...
Searching...
No Matches

◆ UnBind()

template<typename ... Args>
bool Spices::Delegate_Basic< Args >::UnBind ( std::function< void(Args...)> func)
inline

UnBind Function pointer from delegate.

Parameters
[in]funcFunction pointer.
Returns
Returns true if unbind successfully.

Erase from map.

Definition at line 104 of file DelegateBasic.h.

105 {
107
108 uint64_t* addr = reinterpret_cast<uint64_t*>(&func);
109 if (!m_Agents->has_key(*addr))
110 {
111 SPICES_CORE_WARN("Agent Function not binded yet.");
112 return false;
113 }
114
118 m_Agents->erase(*addr);
119
120 return true;
121 }
#define SPICES_PROFILE_ZONE
std::shared_ptr< scl::linked_unordered_map< uint64_t, Agent > > m_Agents
Map of Agent Function Pointer.
void erase(const K &key)
Remove a element inside the container if founded by key.
bool has_key(const K &key)
Determine whether the key is in the container.

References Spices::Delegate_Basic< Args >::m_Agents.