12 #ifndef __NET_CONNECTIONHANDLER_H__
13 #define __NET_CONNECTIONHANDLER_H__
40 myInfoCallback = std::move(info_clb);
44 myConnectionManager(conn_mgr)
50 virtual void start() = 0;
73 handler->myNext = myConnections;
74 handler->myPrev.reset();
76 myConnections->myPrev = handler;
77 myConnections = handler;
103 auto head = myConnections;
104 myConnections =
nullptr;
105 while (
head !=
nullptr)
107 auto next =
head->myNext;
111 head->myNext.reset();
112 head->myPrev.reset();
122 if (myConnections == handler)
123 myConnections = handler->myNext;
124 if (
auto prev = handler->myPrev.lock(); prev !=
nullptr)
125 prev->myNext = handler->myNext;
127 handler->myNext->myPrev = handler->myPrev;
134 #endif // __NET_CONNECTIONHANDLER_H__
virtual ~NET_ConnectionHandler()
void stop(const NET_ConnectionHandlerSPtr &handler)
UT_UniquePtr< NET_InfoCallback > myInfoCallback
UT_StringArray JOINTS head
NET_ConnectionHandler(NET_ConnectionManager &conn_mgr)
void start(const NET_ConnectionHandlerSPtr &handler)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
UT_SharedPtr< NET_ConnectionHandler > NET_ConnectionHandlerSPtr
SIM_API const UT_StringHolder force
NET_ConnectionManager & myConnectionManager
void setInfoCallback(UT_UniquePtr< NET_InfoCallback > info_clb)
std::weak_ptr< T > UT_WeakPtr