MCPcopy Create free account
hub / github.com/alibaba/euler / Instance

Method Instance

euler/common/singleton.h:37–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36 template<typename... Args>
37 static T *Instance(Args &&... args) {
38 if (instance_ == nullptr) {
39 MutexLock lock(&mu_);
40 if (instance_ == nullptr) {
41 instance_.reset(new T(std::forward<Args>(args)...));
42 }
43 }
44 return instance_.get();
45 }
46
47 protected:
48 SingletonBase() {}

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected