MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / SetConnection

Method SetConnection

plugins/base/macro-condition-websocket.cpp:136–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void MacroConditionWebsocket::SetConnection(const std::string &connectionName)
137{
138 _connection = GetWeakConnectionByName(connectionName);
139 if (_type == Type::REQUEST) {
140 // This should not really happen, but let's be safe
141 return;
142 }
143
144 auto connection = _connection.lock();
145 if (!connection) {
146 return;
147 }
148 _messageBuffer = connection->RegisterForEvents();
149}
150
151std::weak_ptr<WSConnection> MacroConditionWebsocket::GetConnection() const
152{

Callers 2

UpdateEntryDataMethod · 0.45

Calls 2

GetWeakConnectionByNameFunction · 0.85
RegisterForEventsMethod · 0.45

Tested by

no test coverage detected