stec-platform
vqpublisher.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/vqpublisher.h $
27 * $Id: vqpublisher.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 VQPUBLISHER_H
38 #define VQPUBLISHER_H
39 
40 #include <QObject>
41 #include <QList>
42 #include <QVariant>
43 #include <QString>
44 #include <QStringList>
45 #include <QMutex>
46 
47 
48 
49 #include "pdscmsg.h"
50 #include "vqdefines.h"
51 
52 #include "gds_codex.h"
53 
54 namespace QXX {
55 
56 class gds_codex;
57 
58 
59 class PLATFORMSHARED_EXPORT VQPublisher : public QObject
60 {
61  Q_OBJECT
62 
63 private :
64  gds_codex *Codex;
65 
66  QString Name;
67  DLock < long > ID;
68  DLock < PblId > xpblid; // Belongs to the GDS, on the QNX side it is a handle to the publication or subscription
69  DLock < int > ClassValid;
70  DLock < int > nbrArticles;
71 
72 public :
74  VQPublisher (
75  gds_codex *codex,
76  QString publication,
77  int initialNbrValues,
78  QObject *parent = NULL );
79 
81  virtual ~VQPublisher();
82 
84  void setPublicationError();
85 
87  void setPublicationExists ( int exists );
88 
90  void setProceedureError ( QString error );
91 
93  void updateAllSubscribers();
94 
96  void updateSubscriber ( PblId pblid, int index, int count );
97 
99  void setPblId ( PblId pbl );
100 
102  void setClassValid ( int valid );
103 
105  PblId getGlobalPblId() { return xpblid.value(); }
106 
108  virtual void vf_UpdateValues ( VremVArray &values, int index );
109 
110 public slots :
112  void usl_UpdateValuesToGds ( VremVArray &values, PblId pblid, int index );
113 
114 signals :
117 
119  void usi_ProceedureError ( QString error );
120 
122  void usi_PublisherValid ( int valid );
123 
125  void usi_PublicationExists ( int exists );
126 
128  void usi_UserRequestUpdate ( PblId pblid, int index, int count );
129 
131  void usi_UpdateValues ( VremVArray &values, int index );
132 
133 }; // VQPublisher
134 
135 }
136 
137 
138 #endif
const T value(void)
Returns a value from DLock.
Definition: platform_global.h:171
Definition: vqpublisher.h:60
void usi_ProceedureError(QString error)
User can connect to this to get Proceedure Error.
void usi_UpdateValues(VremVArray &values, int index)
User should connect to this signal to receive values.
PblId getGlobalPblId()
Global updates to gds are done to this pblid, this is the PblId used when all the subscriber must kno...
Definition: vqpublisher.h:105
void usi_PublisherValid(int valid)
User can connect to this to get Publisher is valid.
void usi_UserRequestUpdate(PblId pblid, int index, int count)
User should connect to this, and if called, he should UpdateValuesToGds based on pblid,...
void usi_PublicationError()
User can connect to this and get general publication errors.
void usi_PublicationExists(int exists)
User can connect to this, to get Publication already exists already somewhere.
Definition: gds_codex.h:59
Definition: pdscmsg.h:41