connection between 2 systems and bug fixes (#14)

This commit is contained in:
tompzf
2026-07-03 14:53:48 +02:00
committed by GitHub
parent 0fb5660d27
commit 46842200f1
284 changed files with 35200 additions and 8265 deletions

View File

@@ -0,0 +1,47 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Denisa Ros - initial API and implementation
********************************************************************************/
#if defined(__unix__)
#ifndef UDS_UNIX_SOCKETS_WATCHDOG_H
#define UDS_UNIX_SOCKETS_WATCHDOG_H
#include <map>
#include <memory>
#include <mutex>
class CUnixSocketsConnectionWatchDog
{
public:
template<typename T>
void AddConnection(const std::shared_ptr<T>& connection)
{
if (!connection)
{
return;
}
AddConnectionImpl(std::static_pointer_cast<void>(connection));
}
void RemoveConnection(const void* connection);
void Clear();
private:
void AddConnectionImpl(const std::shared_ptr<void>& connection);
std::mutex m_Mutex;
std::map<const void*, std::shared_ptr<void>> m_Connections;
};
#endif // UDS_UNIX_SOCKETS_WATCHDOG_H
#endif // defined(__unix__)