| 129 | // |
| 130 | // |
| 131 | virtual Variant getStatInfo() const override |
| 132 | { |
| 133 | struct ClassStatInfo |
| 134 | { |
| 135 | ClassId nClassId = c_nInvalidClassId; |
| 136 | Size nCount = 0; |
| 137 | |
| 138 | ClassStatInfo() = default; |
| 139 | ClassStatInfo(ClassId _nClassId, Size _nCount) : nClassId(_nClassId), nCount(_nCount) {} |
| 140 | }; |
| 141 | |
| 142 | // Avoid long locking of m_mtxFactoryMap |
| 143 | std::vector<ClassStatInfo> statInfo; |
| 144 | { |
| 145 | std::scoped_lock _lock(m_mtxFactoryMap); |
| 146 | statInfo.reserve(m_FactoryMap.size()); |
| 147 | |
| 148 | for (auto&[nClassId, info] : m_FactoryMap) |
| 149 | statInfo.emplace_back(nClassId, info.nObjCount); |
| 150 | } |
| 151 | |
| 152 | Sequence vStatInfo; |
| 153 | Size nClassCount = statInfo.size(); |
| 154 | vStatInfo.setSize(nClassCount); |
| 155 | |
| 156 | for (Size i=0; i< nClassCount; ++i) |
| 157 | { |
| 158 | auto& info = statInfo[i]; |
| 159 | |
| 160 | vStatInfo.put(i, Dictionary({ |
| 161 | { "clsid", info.nClassId }, |
| 162 | { "count", info.nCount }, |
| 163 | })); |
| 164 | } |
| 165 | |
| 166 | return vStatInfo; |
| 167 | } |
| 168 | |
| 169 | // |
| 170 | // |
nothing calls this directly
no test coverage detected