PdCom  4.2
Process data communication client
Subscriber.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vim:tw=78
3  * $Id: Subscriber.h,v 482b38b2b140 2020/04/06 15:29:14 lerichi $
4  *
5  * Copyright (C) 2016 Richard Hacker (lerichi at gmx dot net)
6  *
7  * This file is part of the PdCom library.
8  *
9  * The PdCom library is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or (at your
12  * option) any later version.
13  *
14  * The PdCom library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with the PdCom library. If not, see <http://www.gnu.org/licenses/>.
21  *
22  *****************************************************************************/
23 
26 #ifndef PDCOM_SUBSCRIBER_H
27 #define PDCOM_SUBSCRIBER_H
28 
29 #include "Variable.h"
30 
31 #include <stddef.h>
32 #include <string>
33 #include <stdint.h>
34 
35 namespace PdCom {
36 
91  struct Subscriber {
98  virtual ~Subscriber();
99 
108  virtual void newGroupValue(uint64_t time_ns) = 0;
109 
118  virtual void newValue(
119  const Variable::Subscription* subscription) = 0;
120 
134  virtual void active(const std::string& path,
135  const Variable::Subscription* subscription) = 0;
136 
145  virtual void invalid(
146  PdCom::Process* process, const std::string& path, int id);
147 
149  // Obsolete, use invalid() above
150  virtual void invalid(const std::string& path, int id);
152  };
153 } // namespace
154 
155 #endif // PDCOM_SUBSCRIBER_H
virtual void newGroupValue(uint64_t time_ns)=0
New values for all active signal subscriptions.
Class required to receive subscribed variables.
Definition: Subscriber.h:91
virtual void invalid(PdCom::Process *process, const std::string &path, int id)
Subscription request invalid.
Base class for PdCom protocol handler.
Definition: Process.h:93
Subscription class.
Definition: Variable.h:77
virtual void active(const std::string &path, const Variable::Subscription *subscription)=0
Subscription is active.
virtual ~Subscriber()
Destructor.
Definition: Process.h:37
virtual void newValue(const Variable::Subscription *subscription)=0
New values for a single subscription is available.