aboutsummaryrefslogtreecommitdiff
path: root/c++-qt/src/gatsstream.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-04-06 06:57:51 +0000
committerMike Buland <eichlan@xagasoft.com>2012-04-06 06:57:51 +0000
commit52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4 (patch)
treeb5e9f366a86d679495dd50790e150933da892d7a /c++-qt/src/gatsstream.h
parentfe9f6c6bbc9e682af709fe08757c31ba17a298d1 (diff)
downloadlibgats-52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4.tar.gz
libgats-52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4.tar.bz2
libgats-52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4.tar.xz
libgats-52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4.zip
Qt is tested more thoroughly, some read bugs are fixed. It also works better
with qt principles. You can hook up the readyRead signal to the readObject slot on GatsStream, and connect the GatsStream objectRead signal to your own functions, and you'll be notified whenever a new gats object is read. Cool.
Diffstat (limited to '')
-rw-r--r--c++-qt/src/gatsstream.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/c++-qt/src/gatsstream.h b/c++-qt/src/gatsstream.h
index 3cf1081..f1c0625 100644
--- a/c++-qt/src/gatsstream.h
+++ b/c++-qt/src/gatsstream.h
@@ -15,6 +15,7 @@ namespace Gats
15 GatsStream( QIODevice &rStream ); 15 GatsStream( QIODevice &rStream );
16 virtual ~GatsStream(); 16 virtual ~GatsStream();
17 17
18 public slots:
18 /** 19 /**
19 * Read an object packet from the assosiated stream. This will make 20 * Read an object packet from the assosiated stream. This will make
20 * every effort to only read exactly enough data to describe one packet, 21 * every effort to only read exactly enough data to describe one packet,
@@ -32,6 +33,7 @@ namespace Gats
32 */ 33 */
33 Gats::Object *readObject(); 34 Gats::Object *readObject();
34 35
36 public:
35 /** 37 /**
36 * Write an object 38 * Write an object
37 */ 39 */
@@ -45,6 +47,11 @@ namespace Gats
45 bool hasReadBuffer() { return qbRead.size() > 0; } 47 bool hasReadBuffer() { return qbRead.size() > 0; }
46 int getReadBufferSize() { return qbRead.size(); } 48 int getReadBufferSize() { return qbRead.size(); }
47 49
50 QIODevice &getIODevice() { return rStream; }
51
52 signals:
53 void objectRead( Gats::Object *pObj );
54
48 private: 55 private:
49 bool skipReadNulls(); 56 bool skipReadNulls();
50 57