LCOV - code coverage report
Current view: top level - xmpp - xmpp_connection_manager.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 1 1 100.0 %
Date: 2026-06-04 02:06:09 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : 
       5             : #ifndef XMPP_XMPP_CONNECTION_MANAGER_H
       6             : #define XMPP_XMPP_CONNECTION_MANAGER_H
       7             : 
       8             : #include <mutex>
       9             : 
      10             : #include "base/queue_task.h"
      11             : #include "io/ssl_server.h"
      12             : 
      13             : class LifetimeActor;
      14             : class XmppSession;
      15             : 
      16             : //
      17             : // Common class to represent XmppClient and XmppServer
      18             : //
      19             : class XmppConnectionManager : public SslServer {
      20             : public:
      21             :     XmppConnectionManager(EventManager *evm,
      22             :         boost::asio::ssl::context::method m,
      23             :         bool ssl_enabled, bool ssl_handshake_delayed);
      24             : 
      25             :     void Shutdown();
      26             :     void EnqueueSession(XmppSession *session);
      27             :     size_t GetSessionQueueSize() const;
      28             :     virtual LifetimeActor *deleter() = 0;
      29       15775 :     std::mutex &mutex() const { return mutex_; }
      30             : 
      31             : private:
      32             :     bool DequeueSession(TcpSessionPtr tcp_session);
      33             :     void WorkQueueExitCallback(bool done);
      34             : 
      35             :     WorkQueue<TcpSessionPtr> session_queue_;
      36             :     mutable std::mutex mutex_;
      37             : 
      38             :     DISALLOW_COPY_AND_ASSIGN(XmppConnectionManager);
      39             : };
      40             : 
      41             : #endif  // XMPP_XMPP_CONNECTION_MANAGER_H

Generated by: LCOV version 1.14