Revision: 40744
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40744&view=rev
Author:   davidloman
Date:     2010-09-28 17:43:12 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
WS, Formatting.

Modified Paths:
--------------
    rt^3/trunk/include/ControlledThread.h
    rt^3/trunk/include/PortalManager.h
    rt^3/trunk/src/libNet/Portal.cxx
    rt^3/trunk/src/libNet/PortalManager.cxx
    rt^3/trunk/src/libPkgCpp/PkgServer.cxx
    rt^3/trunk/src/libPkgCpp/PkgTcpServer.cxx
    rt^3/trunk/src/utility/ControlledThread.cxx

Modified: rt^3/trunk/include/ControlledThread.h
===================================================================
--- rt^3/trunk/include/ControlledThread.h       2010-09-28 17:42:41 UTC (rev 
40743)
+++ rt^3/trunk/include/ControlledThread.h       2010-09-28 17:43:12 UTC (rev 
40744)
@@ -27,32 +27,31 @@
 #include <Qt>
 #include "GSThread.h"
 
-class ControlledThread : public QThread
-{
+class ControlledThread: public QThread {
 public:
-  ControlledThread(QString threadname = "");
-  virtual ~ControlledThread();
+       ControlledThread(QString threadname = "");
+       virtual ~ControlledThread();
 
-  bool startup();
-  bool shutdown();
+       bool startup();
+       bool shutdown();
 
 protected:
-  virtual bool preStartupHook();
-  virtual bool postStartupHook();
+       virtual bool preStartupHook();
+       virtual bool postStartupHook();
 
-  virtual bool preRunHook();
-  void run();
-  virtual void _run();
-  virtual void _runLoopPass();
-  virtual bool postRunHook();
+       virtual bool preRunHook();
+       void run();
+       virtual void _run();
+       virtual void _runLoopPass();
+       virtual bool postRunHook();
 
-  virtual bool preShutdownHook();
-  virtual bool postShutdownHook();
+       virtual bool preShutdownHook();
+       virtual bool postShutdownHook();
 
-  /* fields */
-  QString threadName;
-  bool runCmd;
-  bool runStatus;
+       /* fields */
+       QString threadName;
+       bool runCmd;
+       bool runStatus;
 };
 
 #endif /* __CONTROLLEDTHREAD_H__ */

Modified: rt^3/trunk/include/PortalManager.h
===================================================================
--- rt^3/trunk/include/PortalManager.h  2010-09-28 17:42:41 UTC (rev 40743)
+++ rt^3/trunk/include/PortalManager.h  2010-09-28 17:43:12 UTC (rev 40744)
@@ -37,8 +37,7 @@
 
 class Portal;
 
-class PortalManager : public ControlledThread
-{
+class PortalManager: public ControlledThread {
 public:
        PortalManager(quint16 port = 0);
        ~PortalManager();

Modified: rt^3/trunk/src/libNet/Portal.cxx
===================================================================
--- rt^3/trunk/src/libNet/Portal.cxx    2010-09-28 17:42:41 UTC (rev 40743)
+++ rt^3/trunk/src/libNet/Portal.cxx    2010-09-28 17:43:12 UTC (rev 40744)
@@ -30,8 +30,7 @@
 #include "NetMsgTypes.h"
 #include "RemoteNodenameSetMsg.h"
 
-Portal::Portal(PkgTcpClient* client, struct pkg_switch* table)
-{
+Portal::Portal(PkgTcpClient* client, struct pkg_switch* table) {
        this->remoteNodeName = "NotSetYet-" + QUuid::createUuid().toString();
        this->pkgClient = client;
        this->callbackTable = table;
@@ -42,14 +41,11 @@
        this->handshakeComplete = false;
 }
 
-Portal::~Portal()
-{
+Portal::~Portal() {
        delete callbackTable;
 }
 
-
-int
-Portal::send(NetMsg* msg){
+int Portal::send(NetMsg* msg) {
        QByteArray* ba = msg->serialize();
 
        QString s("Sending msg.  Type: ");
@@ -60,7 +56,7 @@
 
        int retval = this->pkgClient->send(PKG_MAGIC2, ba->data(), ba->size());
 
-       s="Sent ";
+       s = "Sent ";
        s.append(QString::number(retval));
        s.append(" bytes.");
        log->logDEBUG("Portal", s);
@@ -68,10 +64,9 @@
        delete ba;
        return retval;
 }
-void
-Portal::sendGSNodeName()
-{
-       QString localNodeName = 
Config::getInstance()->getConfigValue("LocalGSNodeName");
+void Portal::sendGSNodeName() {
+       QString localNodeName = Config::getInstance()->getConfigValue(
+                       "LocalGSNodeName");
        if (localNodeName.length() == 0) {
                localNodeName = QUuid::createUuid().toString();
        }
@@ -84,70 +79,68 @@
        this->send(msg);
 }
 
-int
-Portal::flush(){
+int Portal::flush() {
        return this->pkgClient->flush();
 }
-int
-Portal::read(){
-  int retval = 0;
+int Portal::read() {
+       int retval = 0;
        this->log->logINFO("Portal", "Read");
-/*
-  const pkg_switch* table = this->pkgClient->getCallBackTable();
-  pkg_switch sw = table[0];
-  bu_log("P(1.1): Route[0] type: %d\n", sw.pks_type);
-  bu_log("P(1.1): Route[0] callback: %d\n", sw.pks_handler);
-  bu_log("P(1.1): Route[0] user_data: %d\n", sw.pks_user_data);
-*/
+       /*
+        const pkg_switch* table = this->pkgClient->getCallBackTable();
+        pkg_switch sw = table[0];
+        bu_log("P(1.1): Route[0] type: %d\n", sw.pks_type);
+        bu_log("P(1.1): Route[0] callback: %d\n", sw.pks_handler);
+        bu_log("P(1.1): Route[0] user_data: %d\n", sw.pks_user_data);
+        */
 
-//recv first
-  retval = this->pkgClient->processData();
-  if (retval < 0){
-         this->log->logERROR("Portal", "Unable to process packets? Weird. (1) 
\n");
-      return retval;
-  }//TODO do we need to check for ==0 ?
+       //recv first
+       retval = this->pkgClient->processData();
+       if (retval < 0) {
+               this->log->logERROR("Portal",
+                               "Unable to process packets? Weird. (1) \n");
+               return retval;
+       }//TODO do we need to check for ==0 ?
 
 
-retval = this->pkgClient->pullDataFromSocket();
-  if (retval < 0) {
-         this->log->logERROR("Portal", "Seemed to have trouble pulling the 
data from the socket.\n");
-    return retval;
+       retval = this->pkgClient->pullDataFromSocket();
+       if (retval < 0) {
+               this->log->logERROR("Portal",
+                               "Seemed to have trouble pulling the data from 
the socket.\n");
+               return retval;
 
-  } else if (retval == 0) {
-         this->log->logERROR("Portal", "Client closed the connection.\n");
-    return retval;
-  }
-  bu_log("Sucked in %d bytes.", retval);
+       } else if (retval == 0) {
+               this->log->logERROR("Portal", "Client closed the 
connection.\n");
+               return retval;
+       }
+       bu_log("Sucked in %d bytes.\n", retval);
 
-  retval = this->pkgClient->processData();
-  if (retval < 0){
-         this->log->logERROR("Portal", "Unable to process packets? Weird. 
(2)\n");
-      return retval;
-  }//TODO do we need to check for ==0 ?
+       retval = this->pkgClient->processData();
+       if (retval < 0) {
+               this->log->logERROR("Portal", "Unable to process packets? 
Weird. (2)\n");
+               return retval;
+       }//TODO do we need to check for ==0 ?
 
-  return 1;
+       return 1;
 }
 
-QString
-Portal::getRemoteNodeName(){
-  return this->remoteNodeName + "";
+QString Portal::getRemoteNodeName() {
+       return this->remoteNodeName + "";
 }
 
-bool
-Portal::handleNetMsg(NetMsg* msg)
-{
+bool Portal::handleNetMsg(NetMsg* msg) {
        quint16 type = msg->getMsgType();
 
        if (type == GS_REMOTE_NODENAME_SET) {
                if (this->handshakeComplete) {
-                       this->log->logDEBUG("Portal", "Recv-ed a 
RemoteNodename, but that is already set!");
+                       this->log->logDEBUG("Portal",
+                                       "Recv-ed a RemoteNodename, but that is 
already set!");
                } else {
-                       RemoteNodenameSetMsg* t = (RemoteNodenameSetMsg*)msg;
+                       RemoteNodenameSetMsg* t = (RemoteNodenameSetMsg*) msg;
                        this->remoteNodeName = t->getRemoteNodename();
                        this->handshakeComplete = true;
 
                        QString s("Recv-ed a RemoteNodename: ");
-                       s.append(this->remoteNodeName );
+                       s.append(this->remoteNodeName);
                        this->log->logDEBUG("Portal", s);
 
                        //reply
@@ -160,51 +153,49 @@
        return false;
 }
 
-void
-Portal::callbackSpringboard(struct pkg_conn* conn, char* buf)
-{
-  /* Check to see if we got a good Buffer and Portal Object */
-  if (buf == 0) {
-    bu_bomb("pkg callback returned a NULL buffer!\n");
-  }
+void Portal::callbackSpringboard(struct pkg_conn* conn, char* buf) {
+       /* Check to see if we got a good Buffer and Portal Object */
+       if (buf == 0) {
+               bu_bomb("pkg callback returned a NULL buffer!\n");
+       }
 
-  QByteArray ba(buf);
+       QByteArray ba(buf);
 
-  QString s("Got ");
-  s.append(QString::number(ba.size()));
-  s.append(" bytes.");
-  Logger::getInstance()->logINFO("Portal(s)", s);
+       QString s("Got ");
+       s.append(QString::number(ba.size()));
+       s.append(" bytes.");
+       Logger::getInstance()->logINFO("Portal(s)", s);
 
-   if (conn->pkc_user_data == 0) {
-     bu_bomb("pkg callback returned a NULL user_data pointer!\n");
-   }
+       if (conn->pkc_user_data == 0) {
+               bu_bomb("pkg callback returned a NULL user_data pointer!\n");
+       }
 
-  Portal* p = (Portal*)conn->pkc_user_data;
+       Portal* p = (Portal*) conn->pkc_user_data;
 
-  if (p == 0) {
-          bu_log("WARNING!  NetMsg failed to deserialize properly.\n");
-  }
+       if (p == 0) {
+               bu_log("WARNING!  NetMsg failed to deserialize properly.\n");
+       }
 
-  //TODO Split the code here?  Fire off a Job?
+       //TODO Split the code here?  Fire off a Job?
 
 
-  /* Build a NetMsg */
-  NetMsg* msg  = NetMsgFactory::getInstance()->deserializeNetMsg(ba, p);
+       /* Build a NetMsg */
+       NetMsg* msg = NetMsgFactory::getInstance()->deserializeNetMsg(ba, p);
 
-  /* check to see if we deserialized the msg properly */
-  if (msg == 0) {
-    bu_log("WARNING!  NetMsg failed to deserialize properly.\n");
-    return;
-  }
+       /* check to see if we deserialized the msg properly */
+       if (msg == 0) {
+               bu_log("WARNING!  NetMsg failed to deserialize properly.\n");
+               return;
+       }
 
-  /* Route */
+       /* Route */
 
-  //give the Portal first dibs on the netmsg
-  if (p->handleNetMsg(msg)){
-         return;
-  }
+       //give the Portal first dibs on the netmsg
+       if (p->handleNetMsg(msg)) {
+               return;
+       }
 
-  //TODO add in routing code.
+       //TODO add in routing code.
 }
 
 // Local Variables: ***

Modified: rt^3/trunk/src/libNet/PortalManager.cxx
===================================================================
--- rt^3/trunk/src/libNet/PortalManager.cxx     2010-09-28 17:42:41 UTC (rev 
40743)
+++ rt^3/trunk/src/libNet/PortalManager.cxx     2010-09-28 17:43:12 UTC (rev 
40744)
@@ -28,22 +28,20 @@
 #include "NetMsgFactory.h"
 #include "PkgTcpClient.h"
 
-PortalManager::PortalManager(quint16 port) : ControlledThread("PortalManager")
-{
-  this->port = port;
-  this->tcpServer = new PkgTcpServer();
-  this->fdPortalMap = new QMap<int, Portal*>();
-  this->portalsLock = new QMutex();
-  this->log = Logger::getInstance();
+PortalManager::PortalManager(quint16 port) :
+       ControlledThread("PortalManager") {
+       this->port = port;
+       this->tcpServer = new PkgTcpServer();
+       this->fdPortalMap = new QMap<int, Portal*> ();
+       this->portalsLock = new QMutex();
+       this->log = Logger::getInstance();
 }
 
-PortalManager::~PortalManager()
-{
+PortalManager::~PortalManager() {
 }
 
 Portal*
-PortalManager::connectToHost(QString host, quint16 port)
-{
+PortalManager::connectToHost(QString host, quint16 port) {
        struct pkg_switch* table = this->makeNewSwitchTable();
 
        PkgTcpClient* pkgc = (PkgTcpClient*) this->tcpServer->connectToHost(
@@ -57,8 +55,7 @@
        }
 }
 
-void
-PortalManager::_run() {
+void PortalManager::_run() {
        struct timeval timeout;
        fd_set readfds;
        fd_set writefds;
@@ -95,7 +92,7 @@
        while (this->runCmd) {
                //Set values EVERY loop since select() on *nix modifies this.
                timeout.tv_sec = 0;
-               timeout.tv_usec = 500*1000 * 2;
+               timeout.tv_usec = 500 * 1000 * 2;
 
                this->masterFDSLock.lock();
                readfds = masterfds;
@@ -104,8 +101,7 @@
                this->masterFDSLock.unlock();
 
                //Shelect!!
-               int retval =
-                               select(fdmax + 1, &readfds, NULL, 
&exceptionfds, &timeout);
+               int retval = select(fdmax + 1, &readfds, NULL, &exceptionfds, 
&timeout);
 
                QString out("Select returned: ");
                out.append(QString::number(retval));
@@ -175,19 +171,16 @@
                        log->logDEBUG("PortalManager", s);
 
                        //If nothing to do, then continue;
-                       if (!readyRead && !readyWrite && !readyAccept && ! 
readyException){
+                       if (!readyRead && !readyWrite && !readyAccept && 
!readyException) {
                                continue;
                        }
 
-
                        //Handle exceptions
                        if (readyException) {
                                //TODO handle exceptions
                                perror("Exception on FileDescriptor");
                        }
 
-
-
                        Portal* p = NULL;
                        //Accept new connections:
                        if (readyAccept) {
@@ -196,7 +189,8 @@
                                struct pkg_switch* table = 
this->makeNewSwitchTable();
 
                                PkgTcpClient* client =
-                                               (PkgTcpClient*) 
this->tcpServer->waitForClient(table, 42);
+                                               (PkgTcpClient*) 
this->tcpServer->waitForClient(table,
+                                                               42);
 
                                if (client == 0) {
                                        log->logERROR("PortalManager",
@@ -230,23 +224,23 @@
                                this->closeFD(i, s);
                                continue;
                        }
-/*
-                         const pkg_switch* table = 
p->pkgClient->getCallBackTable();
-                         pkg_switch sw = table[0];
-                         bu_log("PM(3.1): Route[0] type: %d\n", sw.pks_type);
-                         bu_log("PM(3.1): Route[0] callback: %d\n", 
sw.pks_handler);
-                         bu_log("PM(3.1): Route[0] user_data: %d\n", 
sw.pks_user_data);
-*/
+                       /*
+                        const pkg_switch* table = 
p->pkgClient->getCallBackTable();
+                        pkg_switch sw = table[0];
+                        bu_log("PM(3.1): Route[0] type: %d\n", sw.pks_type);
+                        bu_log("PM(3.1): Route[0] callback: %d\n", 
sw.pks_handler);
+                        bu_log("PM(3.1): Route[0] user_data: %d\n", 
sw.pks_user_data);
+                        */
                        //read
                        if (readyRead) {
                                this->log->logINFO("PortalManager", "Read");
 
                                int readResult = p->read();
 
-                                 QString s("Got ");
-                                 s.append(QString::number(readResult));
-                                 s.append(" bytes.");
-                                 
Logger::getInstance()->logINFO("PortalManager", s);
+                               QString s("Got ");
+                               s.append(QString::number(readResult));
+                               s.append(" bytes.");
+                               Logger::getInstance()->logINFO("PortalManager", 
s);
 
                                if (readResult == 0) {
                                        this->closeFD(i, "Lost connection.");
@@ -288,7 +282,7 @@
        this->fdPortalMap->insert(newFD, newPortal);
        this->portalsLock->unlock();
 
-       QString s ("New Portal with FD: ");
+       QString s("New Portal with FD: ");
        s.append(QString::number(newFD));
        log->logDEBUG("PortalManager", s);
 
@@ -303,8 +297,7 @@
 }
 
 struct pkg_switch*
-PortalManager::makeNewSwitchTable()
-{
+PortalManager::makeNewSwitchTable() {
        struct pkg_switch* table = new pkg_switch[2];
 
        table[0].pks_type = PKG_MAGIC2;
@@ -314,15 +307,13 @@
 
        table[1].pks_type = 0;
        table[1].pks_handler = 0;
-       table[1].pks_title = (char*)0;
+       table[1].pks_title = (char*) 0;
        table[1].pks_user_data = 0;
 
        return table;
 }
 
-void
-PortalManager::closeFD(int fd, QString logComment)
-{
+void PortalManager::closeFD(int fd, QString logComment) {
        close(fd);
 
        this->masterFDSLock.lock();
@@ -334,7 +325,6 @@
        this->log->logERROR("PortalManager", logComment);
 }
 
-
 // Local Variables:
 // tab-width: 8
 // mode: C++

Modified: rt^3/trunk/src/libPkgCpp/PkgServer.cxx
===================================================================
--- rt^3/trunk/src/libPkgCpp/PkgServer.cxx      2010-09-28 17:42:41 UTC (rev 
40743)
+++ rt^3/trunk/src/libPkgCpp/PkgServer.cxx      2010-09-28 17:43:12 UTC (rev 
40744)
@@ -30,47 +30,41 @@
 #include <stdlib.h>
 #include <sstream>
 
-PkgServer::PkgServer(std::string proto)
-{
-  this->proto = proto;
-  this->listenFD = -1;
+PkgServer::PkgServer(std::string proto) {
+       this->proto = proto;
+       this->listenFD = -1;
 }
 
-PkgServer::~PkgServer()
-{}
+PkgServer::~PkgServer() {
+}
 
-int
-PkgServer::listen(unsigned short port)
-{
-  //Convert port -> char* to make libpkg happy.
-  char portCString[7] = { 0 };
-  int fd;
-  snprintf(portCString, 6, "%d", port);
+int PkgServer::listen(unsigned short port) {
+       //Convert port -> char* to make libpkg happy.
+       char portCString[7] = { 0 };
+       int fd;
+       snprintf(portCString, 6, "%d", port);
 
-  fd = pkg_permserver(portCString, this->proto.c_str(), 0, 0);
+       fd = pkg_permserver(portCString, this->proto.c_str(), 0, 0);
 
-  if (fd < 0)
-    return fd;
+       if (fd < 0)
+               return fd;
 
-  this->listenFD = fd;
+       this->listenFD = fd;
 
- // bu_log("Listening on port '%d' (FD:%d).\n", port,fd);
+       // bu_log("Listening on port '%d' (FD:%d).\n", port,fd);
 
-  return fd;
+       return fd;
 }
-int
-PkgServer::getListeningFD()
-{
-  return this->listenFD;
+int PkgServer::getListeningFD() {
+       return this->listenFD;
 }
 
-
 /**
  * Attempts to open a new connection to ipOrHostname:port.  Returns NULL if 
connection fails for any reason.
  */
 PkgClient*
-PkgServer::connectToHost(std::string ipOrHostname, short port, struct 
pkg_switch* callbackTable)
-{
+PkgServer::connectToHost(std::string ipOrHostname, short port,
+               struct pkg_switch* callbackTable) {
        std::stringstream ss;
        ss << port;
        std::string s_port = ss.str();
@@ -79,36 +73,33 @@
                        this->proto.c_str(), NULL, NULL, callbackTable, NULL);
 
        if (conn == PKC_ERROR) {
-               bu_log("Connection to %s, port %d, failed.\n", 
ipOrHostname.c_str(), port);
+               bu_log("Connection to %s, port %d, failed.\n", 
ipOrHostname.c_str(),
+                               port);
                return NULL;
        }
        return this->getNewClient(conn);
 }
 
-
 PkgClient*
 PkgServer::waitForClient(struct pkg_switch* callbackTable, int waitTime) {
-       pkg_conn* conn = pkg_getclient(this->listenFD, callbackTable, NULL, 
waitTime);
+       pkg_conn* conn = pkg_getclient(this->listenFD, callbackTable, NULL,
+                       waitTime);
 
-  if (conn == PKC_NULL)
-    {
-      if (waitTime == 0)
-        {
-          bu_log("Connection seems to be busy, waiting...\n");
-          usleep(100);
-        }
-      return NULL;
-    }
-  else if (conn == PKC_ERROR)
-    {
-      //Fatal error accepting client connection
-      bu_log("Fatal error accepting client connection.\n");
-      pkg_close(conn);
-      return NULL;
-    }
+       if (conn == PKC_NULL) {
+               if (waitTime == 0) {
+                       bu_log("Connection seems to be busy, waiting...\n");
+                       usleep(100);
+               }
+               return NULL;
+       } else if (conn == PKC_ERROR) {
+               //Fatal error accepting client connection
+               bu_log("Fatal error accepting client connection.\n");
+               pkg_close(conn);
+               return NULL;
+       }
 
-  PkgClient* pkgClientObj = this->getNewClient(conn);
-  return pkgClientObj;
+       PkgClient* pkgClientObj = this->getNewClient(conn);
+       return pkgClientObj;
 }
 
 /*

Modified: rt^3/trunk/src/libPkgCpp/PkgTcpServer.cxx
===================================================================
--- rt^3/trunk/src/libPkgCpp/PkgTcpServer.cxx   2010-09-28 17:42:41 UTC (rev 
40743)
+++ rt^3/trunk/src/libPkgCpp/PkgTcpServer.cxx   2010-09-28 17:43:12 UTC (rev 
40744)
@@ -27,16 +27,15 @@
 #include "PkgTcpServer.h"
 
 PkgTcpServer::PkgTcpServer() :
-  PkgServer(PKGCPP_PROTO_TCP)
-{}
+       PkgServer(PKGCPP_PROTO_TCP) {
+}
 
-PkgTcpServer::~PkgTcpServer()
-{}
+PkgTcpServer::~PkgTcpServer() {
+}
 
 PkgClient*
-PkgTcpServer::getNewClient(pkg_conn* conn)
-{
-  return new PkgTcpClient(conn);
+PkgTcpServer::getNewClient(pkg_conn* conn) {
+       return new PkgTcpClient(conn);
 }
 // Local Variables:
 // tab-width: 8

Modified: rt^3/trunk/src/utility/ControlledThread.cxx
===================================================================
--- rt^3/trunk/src/utility/ControlledThread.cxx 2010-09-28 17:42:41 UTC (rev 
40743)
+++ rt^3/trunk/src/utility/ControlledThread.cxx 2010-09-28 17:43:12 UTC (rev 
40744)
@@ -23,112 +23,83 @@
 
 #include "ControlledThread.h"
 
-ControlledThread::ControlledThread(QString threadName)
-{
-  if (threadName.length() <= 0)
-    {
-      this->threadName = "DEFAULT_THREAD_NAME";
-    }
-  else
-    {
-      this->threadName = threadName;
-    }
-  this->runCmd = false;
-  this->runStatus = false;
+ControlledThread::ControlledThread(QString threadName) {
+       if (threadName.length() <= 0) {
+               this->threadName = "DEFAULT_THREAD_NAME";
+       } else {
+               this->threadName = threadName;
+       }
+       this->runCmd = false;
+       this->runStatus = false;
 }
 
-ControlledThread::~ControlledThread()
-{
+ControlledThread::~ControlledThread() {
 }
 
-bool
-ControlledThread::startup()
-{
-  bool preRetVal = this->preStartupHook();
-  this->runCmd = true;
-  this->start();
-  bool postRetVal = this->postStartupHook();
+bool ControlledThread::startup() {
+       bool preRetVal = this->preStartupHook();
+       this->runCmd = true;
+       this->start();
+       bool postRetVal = this->postStartupHook();
 }
 
-bool
-ControlledThread::shutdown()
-{
-  bool preRetVal = this->preShutdownHook();
-  this->runCmd = false;
-  bool postRetVal = this->postShutdownHook();
+bool ControlledThread::shutdown() {
+       bool preRetVal = this->preShutdownHook();
+       this->runCmd = false;
+       bool postRetVal = this->postShutdownHook();
 }
 
-void
-ControlledThread::run()
-{
-  this->preRunHook();
-  this->runStatus = true;
+void ControlledThread::run() {
+       this->preRunHook();
+       this->runStatus = true;
 
-  this->_run();
+       this->_run();
 
-  this->postRunHook();
-  this->runStatus = true;
+       this->postRunHook();
+       this->runStatus = true;
 }
 
-void
-ControlledThread::_run()
-{
-  while (this->runCmd)
-    {
-      this->_runLoopPass();
-    }
+void ControlledThread::_run() {
+       while (this->runCmd) {
+               this->_runLoopPass();
+       }
 }
 
-void
-ControlledThread::_runLoopPass()
-{
-  //DOES NOTHING BY DEFAULT
-  GSThread::msleep(123);
+void ControlledThread::_runLoopPass() {
+       //DOES NOTHING BY DEFAULT
+       GSThread::msleep(123);
 }
 
 /**
  * User hook.  Called immediately after ControlledThread::startup() is called 
but prior to 'runCmd' being set to true;
  */
-bool
-ControlledThread::preStartupHook()
-{
-  return true;
+bool ControlledThread::preStartupHook() {
+       return true;
 }
 
 /**
  * User hook.  Called immediately after 'runCmd' is set to true;
  */
-bool
-ControlledThread::postStartupHook()
-{
-  return true;
+bool ControlledThread::postStartupHook() {
+       return true;
 }
 
-bool
-ControlledThread::preRunHook()
-{
-  return true;
+bool ControlledThread::preRunHook() {
+       return true;
 }
 
-bool
-ControlledThread::postRunHook()
-{
-  return true;
+bool ControlledThread::postRunHook() {
+       return true;
 }
 
-bool
-ControlledThread::preShutdownHook()
-{
-  return true;
+bool ControlledThread::preShutdownHook() {
+       return true;
 }
 
-bool
-ControlledThread::postShutdownHook()
-{
-  return true;
+bool ControlledThread::postShutdownHook() {
+       return true;
 }
 
-
 // Local Variables:
 // tab-width: 8
 // mode: C++


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