Revision: 40783
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40783&view=rev
Author:   davidloman
Date:     2010-09-29 11:33:13 +0000 (Wed, 29 Sep 2010)

Log Message:
-----------
Modified GeometryService class to require a port arg in cstr (for Portalmanager 
to listen on).  Also make GeometryService extend ControlledThread so it can be 
run in both standalone app and daemon modes.

Modified Paths:
--------------
    rt^3/trunk/include/GeometryService.h
    rt^3/trunk/src/GS/GeometryService.cxx

Modified: rt^3/trunk/include/GeometryService.h
===================================================================
--- rt^3/trunk/include/GeometryService.h        2010-09-29 11:30:53 UTC (rev 
40782)
+++ rt^3/trunk/include/GeometryService.h        2010-09-29 11:33:13 UTC (rev 
40783)
@@ -28,20 +28,23 @@
 
 #include "libutility.h"
 
-#include <QTcpSocket>
-#include <QString>
-#include <QStringList>
-#include <QCoreApplication>
+#include <QtCore/QString>
 
-class GeometryService
+class GeometryService : public ControlledThread
 {
 
 public:
-       GeometryService(const QString localNodeName);
+       GeometryService(const QString localNodeName, const quint16 listenPort);
        virtual ~GeometryService();
+
+protected:
+       bool preRunHook();
+       void _run();
+       bool postRunHook();
 private:
        Logger* log;
        QString localNodeName;
+       quint16 listenPort;
 };
 
 #endif

Modified: rt^3/trunk/src/GS/GeometryService.cxx
===================================================================
--- rt^3/trunk/src/GS/GeometryService.cxx       2010-09-29 11:30:53 UTC (rev 
40782)
+++ rt^3/trunk/src/GS/GeometryService.cxx       2010-09-29 11:33:13 UTC (rev 
40783)
@@ -26,8 +26,8 @@
 #include "GeometryService.h"
 #include "SessionManager.h"
 
-GeometryService::GeometryService(const QString localNodeName) :
-localNodeName(localNodeName)
+GeometryService::GeometryService(const QString localNodeName, quint16 
listenPort) :
+localNodeName(localNodeName), listenPort(listenPort)
 {
     this->log = Logger::getInstance();
     this->log->logINFO("GeometryService", localNodeName + " is starting 
up...");
@@ -38,7 +38,29 @@
 
 }
 
+bool
+GeometryService::preRunHook() {
+       //Do initi stuff here
+       this->log->logINFO("GeometryService", "Running");
 
+       return true;
+}
+
+void
+GeometryService::_run() {
+
+       GSThread::sleep(2);
+
+}
+
+bool
+GeometryService::postRunHook() {
+       //Do teardown stuff here
+       this->log->logINFO("GeometryService", "Shutdown");
+
+       return true;
+}
+
 // Local Variables: ***
 // mode: C++ ***
 // tab-width: 8 ***


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