MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / AttachComponent_

Method AttachComponent_

IntelPresentMon/CommonUtilities/log/Channel.cpp:263–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 Replace_(objectPtrs_, std::shared_ptr<IChannelObject>{}, tag);
262 }
263 void ChannelInternal_::AttachComponent_(std::shared_ptr<IChannelComponent> pComponent, std::string tag)
264 {
265 if (auto pDriver = std::dynamic_pointer_cast<IDriver>(pComponent)) {
266 Replace_(driverPtrs_, std::move(pDriver), std::move(tag));
267 }
268 else if (auto pPolicy = std::dynamic_pointer_cast<IPolicy>(pComponent)) {
269 Replace_(policyPtrs_, std::move(pPolicy), std::move(tag));
270 }
271 else if (auto pObject = std::dynamic_pointer_cast<IChannelObject>(pComponent)) {
272 Replace_(objectPtrs_, std::move(pObject), std::move(tag));
273 }
274 else {
275 std::string type = typeid(*pComponent).name();
276 throw Except<Exception>("bad type for component attachment in channel, type => " + type );
277 }
278 }
279 void ChannelInternal_::EnqueueEntry(Entry&& e)
280 {
281 Queue_(this).enqueue(std::move(e));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected