LCOV - code coverage report
Current view: top level - felix-client/src - felix_client_info.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 59 60 98.3 %
Date: 2025-06-10 03:23:28 Functions: 19 19 100.0 %

          Line data    Source code
       1             : #include "felix/felix_client_info.hpp"
       2             : #include "felix/felix_client_exception.hpp"
       3             : 
       4             : #include "clog.h"
       5             : 
       6             : 
       7       10869 : netio_socket_type FelixClientContext::getType(){
       8       10869 :     return mType;
       9             : }
      10             : 
      11        6451 : netio_socket_connection FelixClientContext::getConnectionType(){
      12        6451 :     return mConnection;
      13             : }
      14             : 
      15      193805 : subscribe_state FelixClientContext::getSubscriptionState(){
      16      193805 :     return mSubscribed.load();
      17             : }
      18             : 
      19        2177 : std::unordered_map<std::string, timespec> FelixClientContext::getSubscriptionTimes(){
      20        2177 :     return mSubscriptionTimes;
      21             : }
      22             : 
      23       22651 : SocketWrapper* FelixClientContext::getSocket(){
      24       22651 :     return mSocket;
      25             : }
      26             : 
      27         351 : bool FelixClientContext::getForRegister(){
      28         351 :     return mForRegister;
      29             : }
      30             : 
      31         553 : uint FelixClientContext::getWatermark(){
      32         553 :     return mWatermark;
      33             : }
      34             : 
      35        1025 : uint FelixClientContext::getPagesize(){
      36        1025 :     return mPagesize;
      37             : }
      38             : 
      39         575 : uint FelixClientContext::getPages(){
      40         575 :     return mPages;
      41             : }
      42             : 
      43        7440 : uint FelixClientContext::getPort(){
      44        7440 :     return mPort;
      45             : }
      46             : 
      47        7440 : std::string FelixClientContext::getIp(){
      48        7440 :     return mIp;
      49             : }
      50             : 
      51        4443 : void FelixClientContext::setSubscriptionTimes(std::string name, timespec ts){
      52        4443 :     if(name == "subscribe" || name == "subscribe_evloop"){
      53        4443 :         mSubscriptionTimes[name] = ts;
      54             :     }else{
      55           0 :        clog_error("Invalid entry for SubscriptionTime");
      56             :    }
      57        4443 : }
      58             : 
      59        2915 : void FelixClientContext::setSocket(SocketWrapper* s){
      60        2915 :     mSocket = s;
      61        2915 : }
      62             : 
      63        5020 : void FelixClientContext::setInfos(std::string& ip, uint port, uint pages, uint pagesize, uint watermark, bool unbuffered, bool pubsub){
      64        5020 :     mIp = ip;
      65        5020 :     mPort = port;
      66        5020 :     mPages = pages;
      67        5020 :     mPagesize = pagesize;
      68        5020 :     mWatermark = watermark;
      69        5020 :     mType = unbuffered ? UNBUFFERED : BUFFERED;
      70        5020 :     mConnection = pubsub ? PUBSUB : SENDRECV;
      71        5020 : }
      72             : 
      73       11208 : void FelixClientContext::setSubscriptionState(subscribe_state s){
      74       11208 :     if (s == SUB){
      75        4647 :         if (mMultiWaitCtx){
      76        2718 :             mMultiWaitCtx->count++;
      77        2718 :             if(mMultiWaitCtx->count == mMultiWaitCtx->expectedSize){
      78         432 :                 mMultiWaitCtx->allSubscribed.notify_all();
      79             :             }
      80             :         }
      81        4647 :         mSubscribeWait.notify_all();        //Socket changes to subscribe state
      82             :     }
      83       11208 :     mSubscribed = s;
      84       11208 : }
      85             : 
      86          34 : void FelixClientContext::setForRegister(bool r){
      87          34 :     mForRegister = r;
      88          34 : }
      89             : 
      90        1582 : void FelixClientContext::setWaitContext(MultiFidsWaitContext* ctx){
      91        1582 :     mMultiWaitCtx = ctx;
      92        1582 : }
      93             : 
      94        1582 : void FelixClientContext::clearWaitContext(){
      95        1582 :     mMultiWaitCtx = NULL;
      96        1582 : }
      97             : 
      98        2390 : void FelixClientContext::removeSocket(){
      99        2390 :     mSocket = mDummyWrapper.get();
     100        2390 : }

Generated by: LCOV version 1.0