MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / CreateObject

Method CreateObject

extra/yassl/include/factory.hpp:76–92  ·  view source on GitHub ↗

THE Creator, returns a new object of the proper type or 0

Source from the content-addressed store, hash-verified

74
75 // THE Creator, returns a new object of the proper type or 0
76 AbstractProduct* CreateObject(const IdentifierType& id) const
77 {
78 typedef typename STL::vector<CallBack>::const_iterator cIter;
79
80 cIter first = callbacks_.begin();
81 cIter last = callbacks_.end();
82
83 while (first != last) {
84 if (first->first == id)
85 break;
86 ++first;
87 }
88
89 if (first == callbacks_.end())
90 return 0;
91 return (first->second)();
92 }
93private:
94 Factory(const Factory&); // hide copy
95 Factory& operator=(const Factory&); // and assign

Callers 3

DoProcessReplyFunction · 0.80
createKeyMethod · 0.80
ProcessMethod · 0.80

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected