stec-platform
vqsubscriber.h
1 /***************************************************************************
2  * Copyright (C) 2009,2011 by VremSoft *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18  ***************************************************************************/
19 
20 /*
21 *
22 * $LastChangedDate: 2014-08-14 12:47:21 -0400 (Thu, 14 Aug 2014) $
23 * $LastChangedBy: ed $
24 * $Revision: 61 $
25 * $Author: ed $
26 * $URL: svn+ssh://svn.vremsoft.com/var/share/svn/tags/platfom3.4.3/platformlib/qnxtalk/vqsubscriber.h $
27 * $Id: vqsubscriber.h 61 2014-08-14 16:47:21Z ed $
28 * edc@vremsoft.com
29 *
30 * 19
31 *
32 * *** 2014<c> ***
33 *
34 *
35 */
36 
37 #ifndef VQSUBSCRIBER_H
38 #define VQSUBSCRIBER_H
39 
40 #include <QObject>
41 #include <QList>
42 #include <QVariant>
43 #include <QString>
44 #include <QStringList>
45 #include <QMutex>
46 
47 #include "pdscmsg.h"
48 #include "vqdefines.h"
49 #include "gds_codex.h"
50 
51 
52 #include <publication.h>
53 #include <subscription.h>
54 #include <pluginclass.h>
55 #include <platform_global.h>
56 
57 namespace QXX {
58 class gds_codex;
59 
60 
72 class PLATFORMSHARED_EXPORT VQSubscriber : public QObject
73 {
74  Q_OBJECT
75 
76 private :
78  DLock < PblId > xpblid; // Belongs to the PDS, on the QNX side it is a handle to the publication or subscription
79 
80 protected :
81 
84 
86  QString srcToPlatform;
87 
89  QString Name;
90 
93 
96 
99 
102 
105 
108 
109 public :
111  VQSubscriber (
112  gds_codex *codex,
113  QString subscription,
114  QString alias,
115  int index = 0,
116  int count = 1,
117  QObject *parent = NULL );
118 
120  virtual ~VQSubscriber();
121 
123  virtual void vf_UpdateValues ( VremVArray &values, int index );
124 
126 
128  void setPblId ( PblId pbl );
129 
131  void setLastKnownType ( ArticleType type );
132 
134  void setClassValid ( int t );
135 
137  void setProceedureError ( QString error );
138 
140  void setSubscriptionError();
141 
143  QString getName ( void ) { return Name; }
144 
145 public slots : // Slots, for user
147  void usl_RequestUpdate ( VremVArray &values, int index );
148 
149  void uslEventOccured(qint16 index, qint16 count, QVariant src);
150 
151 signals :
153  void usi_UpdateValues ( VremVArray &values, int index );
154 
156  void usi_SubscriberHasPublisher ( int YesNo );
157 
159  void usi_ProceedureError ( QString error );
160 
163 
165  void usi_ArticleTypeFromPublisher ( ArticleType type );
166 
167 }; // VQSubscriber
168 
169 }
170 
171 
172 #endif // VQSUBSCRIBER_H
Definition: vqsubscriber.h:73
Subscription * PlatformSubscription
Platform Subscription.
Definition: vqsubscriber.h:83
QString getName(void)
Get the GdsName.
Definition: vqsubscriber.h:143
void usi_SubscriberHasPublisher(int YesNo)
User should connect to this signal to know if there is a publisher out there, if 1 has publihser atta...
DLock< int > Count
Number of articles to subscribe to.
Definition: vqsubscriber.h:95
DLock< int > ClassValid
Turns off Updates when pds is still coming up.
Definition: vqsubscriber.h:101
void usi_ArticleTypeFromPublisher(ArticleType type)
User can connect to this to see the publisher's type.
DLock< long > ID
Id to handle created as unique, for gdsbridge to handle.
Definition: vqsubscriber.h:98
void usi_UpdateValues(VremVArray &values, int index)
User should connect to this signal to receive values.
DLock< ArticleType > LastKnowPublisherType
Last know type that the publisher published to us.
Definition: vqsubscriber.h:107
void usi_SubscriptionError()
User should connect for subscription Error.
DLock< int > Index
Index to subscribe to.
Definition: vqsubscriber.h:92
void usi_ProceedureError(QString error)
User should connect for proceedure Error.
QString srcToPlatform
Src.
Definition: vqsubscriber.h:86
QString Name
Subsciption Name.
Definition: vqsubscriber.h:89
gds_codex * Codex
The codex to decode our messages.
Definition: vqsubscriber.h:104
Definition: gds_codex.h:59
The Subscription class A platform subscriber must use or inheit this class.
Definition: subscription.h:43
Definition: pdscmsg.h:41