THE Creator, returns a new object of the proper type or 0
| 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 | } |
| 93 | private: |
| 94 | Factory(const Factory&); // hide copy |
| 95 | Factory& operator=(const Factory&); // and assign |
no test coverage detected