LCOV - code coverage report
Current view: top level - libmogwai-schedule - scheduler.h (source / functions) Hit Total Coverage
Test: Code coverage Lines: 1 1 100.0 %
Date: 2022-06-30 20:59:16 Functions: 4 4 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 4 6 66.7 %

           Branch data     Line data    Source code
       1                 :            : /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
       2                 :            :  *
       3                 :            :  * Copyright © 2017, 2018 Endless Mobile, Inc.
       4                 :            :  *
       5                 :            :  * This library is free software; you can redistribute it and/or
       6                 :            :  * modify it under the terms of the GNU Lesser General Public
       7                 :            :  * License as published by the Free Software Foundation; either
       8                 :            :  * version 2.1 of the License, or (at your option) any later version.
       9                 :            :  *
      10                 :            :  * This library is distributed in the hope that it will be useful,
      11                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      12                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      13                 :            :  * Lesser General Public License for more details.
      14                 :            :  *
      15                 :            :  * You should have received a copy of the GNU Lesser General Public
      16                 :            :  * License along with this library; if not, write to the Free Software
      17                 :            :  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
      18                 :            :  *
      19                 :            :  * Authors:
      20                 :            :  *  - Philip Withnall <withnall@endlessm.com>
      21                 :            :  */
      22                 :            : 
      23                 :            : #pragma once
      24                 :            : 
      25                 :            : #include <glib.h>
      26                 :            : #include <glib-object.h>
      27                 :            : #include <libmogwai-schedule/clock.h>
      28                 :            : #include <libmogwai-schedule/connection-monitor.h>
      29                 :            : #include <libmogwai-schedule/peer-manager.h>
      30                 :            : #include <libmogwai-schedule/schedule-entry.h>
      31                 :            : 
      32                 :            : G_BEGIN_DECLS
      33                 :            : 
      34                 :            : /**
      35                 :            :  * MwsSchedulerError:
      36                 :            :  * @MWS_SCHEDULER_ERROR_FULL: There are enough schedule entries in the scheduler
      37                 :            :  *    and it has hit its resource limits.
      38                 :            :  * @MWS_SCHEDULER_ERROR_IDENTIFYING_PEER: A peer which was requesting a schedule
      39                 :            :  *    entry to be added could not be identified.
      40                 :            :  * @MWS_SCHEDULER_ERROR_INVALID_PARAMETERS: A schedule entry could not be
      41                 :            :  *    created due to having invalid parameters.
      42                 :            :  *
      43                 :            :  * Errors which can be returned by #MwsScheduler.
      44                 :            :  *
      45                 :            :  * Since: 0.1.0
      46                 :            :  */
      47                 :            : typedef enum
      48                 :            : {
      49                 :            :   MWS_SCHEDULER_ERROR_FULL = 0,
      50                 :            :   MWS_SCHEDULER_ERROR_IDENTIFYING_PEER,
      51                 :            :   MWS_SCHEDULER_ERROR_INVALID_PARAMETERS,
      52                 :            : } MwsSchedulerError;
      53                 :            : #define MWS_SCHEDULER_N_ERRORS (MWS_SCHEDULER_ERROR_INVALID_PARAMETERS + 1)
      54                 :            : 
      55                 :            : GQuark mws_scheduler_error_quark (void);
      56                 :            : #define MWS_SCHEDULER_ERROR mws_scheduler_error_quark ()
      57                 :            : 
      58                 :            : #define MWS_TYPE_SCHEDULER mws_scheduler_get_type ()
      59   [ +  +  +  -  :       1036 : G_DECLARE_FINAL_TYPE (MwsScheduler, mws_scheduler, MWS, SCHEDULER, GObject)
                   +  - ]
      60                 :            : 
      61                 :            : MwsScheduler     *mws_scheduler_new             (MwsConnectionMonitor *connection_monitor,
      62                 :            :                                                  MwsPeerManager       *peer_manager,
      63                 :            :                                                  MwsClock             *clock);
      64                 :            : 
      65                 :            : MwsPeerManager   *mws_scheduler_get_peer_manager (MwsScheduler     *self);
      66                 :            : 
      67                 :            : gboolean          mws_scheduler_update_entries  (MwsScheduler      *self,
      68                 :            :                                                  GPtrArray         *added,
      69                 :            :                                                  GPtrArray         *removed,
      70                 :            :                                                  GError           **error);
      71                 :            : gboolean          mws_scheduler_remove_entries_for_owner (MwsScheduler  *self,
      72                 :            :                                                           const gchar   *owner,
      73                 :            :                                                           GError       **error);
      74                 :            : 
      75                 :            : MwsScheduleEntry *mws_scheduler_get_entry       (MwsScheduler      *self,
      76                 :            :                                                  const gchar       *entry_id);
      77                 :            : GHashTable       *mws_scheduler_get_entries     (MwsScheduler      *self);
      78                 :            : 
      79                 :            : gboolean          mws_scheduler_is_entry_active (MwsScheduler      *self,
      80                 :            :                                                  MwsScheduleEntry  *entry);
      81                 :            : 
      82                 :            : void              mws_scheduler_reschedule      (MwsScheduler *self);
      83                 :            : 
      84                 :            : gboolean          mws_scheduler_get_allow_downloads (MwsScheduler *self);
      85                 :            : 
      86                 :            : G_END_DECLS

Generated by: LCOV version 1.16