paul@288 | 1 | /* |
paul@288 | 2 | * Notification unsubscribing support. |
paul@288 | 3 | * |
paul@288 | 4 | * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk> |
paul@288 | 5 | * |
paul@288 | 6 | * This program is free software; you can redistribute it and/or |
paul@288 | 7 | * modify it under the terms of the GNU General Public License as |
paul@288 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@288 | 9 | * the License, or (at your option) any later version. |
paul@288 | 10 | * |
paul@288 | 11 | * This program is distributed in the hope that it will be useful, |
paul@288 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@288 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@288 | 14 | * GNU General Public License for more details. |
paul@288 | 15 | * |
paul@288 | 16 | * You should have received a copy of the GNU General Public License |
paul@288 | 17 | * along with this program; if not, write to the Free Software |
paul@288 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@288 | 19 | * Boston, MA 02110-1301, USA |
paul@288 | 20 | */ |
paul@288 | 21 | |
paul@288 | 22 | #pragma once |
paul@288 | 23 | |
paul@288 | 24 | #include <fsserver/notification.h> |
paul@288 | 25 | #include <fsserver/notifier_peer_interface.h> |
paul@288 | 26 | #include <fsserver/resource.h> |
paul@288 | 27 | |
paul@288 | 28 | |
paul@288 | 29 | |
paul@288 | 30 | /* A notifier endpoint peer for unsubscribing from notifications. */ |
paul@288 | 31 | |
paul@288 | 32 | class NotifierPeerEndpoint : public Resource, public NotifierPeer |
paul@288 | 33 | { |
paul@288 | 34 | protected: |
paul@288 | 35 | NotificationSupport *_notification; |
paul@288 | 36 | unsigned int _endpoint; |
paul@288 | 37 | l4_cap_idx_t _notifier; |
paul@288 | 38 | |
paul@288 | 39 | public: |
paul@288 | 40 | explicit NotifierPeerEndpoint(NotificationSupport *notification, |
paul@288 | 41 | unsigned int endpoint, l4_cap_idx_t notifier); |
paul@288 | 42 | |
paul@288 | 43 | virtual ~NotifierPeerEndpoint(); |
paul@288 | 44 | |
paul@288 | 45 | /* Server details. */ |
paul@288 | 46 | |
paul@288 | 47 | int expected_items(); |
paul@288 | 48 | |
paul@288 | 49 | ipc_server_handler_type handler(); |
paul@288 | 50 | |
paul@288 | 51 | void *interface() |
paul@288 | 52 | { return static_cast<NotifierPeer *>(this); } |
paul@288 | 53 | |
paul@288 | 54 | /* Operations. */ |
paul@288 | 55 | |
paul@288 | 56 | virtual long unsubscribe(); |
paul@288 | 57 | }; |
paul@288 | 58 | |
paul@288 | 59 | // vim: tabstop=4 expandtab shiftwidth=4 |