Revision: 40733
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40733&view=rev
Author:   davidloman
Date:     2010-09-28 14:56:29 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
Add in a getCallbackTable for verifying the contents of the passed in 
pkg_switch* table.  Dropped setCallbackTable since the callback table is being 
set prior to PkgClient creation.  Exposed pkg_flush as a PkgClient method.

Modified Paths:
--------------
    rt^3/trunk/include/PkgClient.h
    rt^3/trunk/src/libPkgCpp/PkgClient.cxx

Modified: rt^3/trunk/include/PkgClient.h
===================================================================
--- rt^3/trunk/include/PkgClient.h      2010-09-28 12:34:44 UTC (rev 40732)
+++ rt^3/trunk/include/PkgClient.h      2010-09-28 14:56:29 UTC (rev 40733)
@@ -63,11 +63,20 @@
    */
   int pullDataFromSocket();
 
+  /**
+   * Empty the stream buffer of any queued messages.
+   *
+   * Flush any pending data in the pkc_stream buffer.
+   *
+   * Returns < 0 on failure, else number of bytes sent.
+   */
+  int flush();
+
   void close();
 
   int send(int opcode, const char* buffer, size_t bufferLen);
 
-  void setCallBackTable(struct pkg_switch* callback);
+  const struct pkg_switch* getCallBackTable();
 
   int getFileDescriptor();
 

Modified: rt^3/trunk/src/libPkgCpp/PkgClient.cxx
===================================================================
--- rt^3/trunk/src/libPkgCpp/PkgClient.cxx      2010-09-28 12:34:44 UTC (rev 
40732)
+++ rt^3/trunk/src/libPkgCpp/PkgClient.cxx      2010-09-28 14:56:29 UTC (rev 
40733)
@@ -52,6 +52,13 @@
 }
 
 int
+PkgClient::flush()
+{
+  //call the c function
+  return pkg_flush(this->conn);
+}
+
+int
 PkgClient::send(int opcode, const char* buffer, size_t bufferLen)
 {
   //call the c function
@@ -92,10 +99,10 @@
   return retVal;
 }
 
-void
-PkgClient::setCallBackTable(struct pkg_switch* callback)
+const struct pkg_switch*
+PkgClient::getCallBackTable()
 {
-  this->conn->pkc_switch = callback;
+       return this->conn->pkc_switch;
 }
 
 int


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to