MCPcopy Create free account
hub / github.com/comaps/comaps / Add

Method Add

libs/base/observer_list.hpp:34–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32{
33public:
34 bool Add(Observer & observer)
35 {
36 std::lock_guard<Mutex> lock(m_observersLock);
37 auto const it = std::find(m_observers.begin(), m_observers.end(), &observer);
38 if (it != m_observers.end())
39 {
40 LOG(LWARNING, ("Can't add the same observer twice:", &observer));
41 return false;
42 }
43 m_observers.push_back(&observer);
44 return true;
45 }
46
47 bool Remove(Observer const & observer)
48 {

Callers

nothing calls this directly

Calls 4

findFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected