Revision: 41639
http://brlcad.svn.sourceforge.net/brlcad/?rev=41639&view=rev
Author: davidloman
Date: 2010-12-16 14:52:55 +0000 (Thu, 16 Dec 2010)
Log Message:
-----------
Modify commands exec() and _exec() to take a GSClient* as an arg. Allows the
command to perform limited state changes on the provided GSClient object.
Modified Paths:
--------------
rt^3/trunk/include/AbstractClientCmd.h
rt^3/trunk/include/GSClient.h
rt^3/trunk/include/ShutdownCmd.h
rt^3/trunk/src/GS/GSClient.cxx
rt^3/trunk/src/GS/cmds/AbstractClientCmd.cxx
rt^3/trunk/src/GS/cmds/ShutdownCmd.cxx
Modified: rt^3/trunk/include/AbstractClientCmd.h
===================================================================
--- rt^3/trunk/include/AbstractClientCmd.h 2010-12-16 14:45:15 UTC (rev
41638)
+++ rt^3/trunk/include/AbstractClientCmd.h 2010-12-16 14:52:55 UTC (rev
41639)
@@ -30,10 +30,12 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
+class GSClient;
+
class AbstractClientCmd {
public:
virtual ~AbstractClientCmd();
- bool exec(QStringList args);
+ bool exec(GSClient* client, QStringList args);
QString getCmd();
virtual QString getUsage() = 0;
@@ -43,7 +45,7 @@
AbstractClientCmd(QString cmd);
AbstractClientCmd(AbstractClientCmd* acCmd);
- virtual bool _exec(QStringList args) = 0;
+ virtual bool _exec(GSClient* client, QStringList args) = 0;
Logger* log;
Modified: rt^3/trunk/include/GSClient.h
===================================================================
--- rt^3/trunk/include/GSClient.h 2010-12-16 14:45:15 UTC (rev 41638)
+++ rt^3/trunk/include/GSClient.h 2010-12-16 14:52:55 UTC (rev 41639)
@@ -28,6 +28,7 @@
#include "ClientCmdRegistry.h"
#include "Logger.h"
#include "JobManager.h"
+#include "PortalManager.h"
#include <QtCore/QString>
#include <QtCore/QStringList>
@@ -43,12 +44,17 @@
int run();
bool execCmd(QString cmd, QStringList args);
+ PortalManager* getPortMan();
+protected:
+
private:
ClientCmdRegistry* ccReg;
Logger* log;
JobManager* jobMan;
+ PortalManager* portMan;
+
bool stayRun;
std::string prompt;
const static std::string defaultPrompt;
Modified: rt^3/trunk/include/ShutdownCmd.h
===================================================================
--- rt^3/trunk/include/ShutdownCmd.h 2010-12-16 14:45:15 UTC (rev 41638)
+++ rt^3/trunk/include/ShutdownCmd.h 2010-12-16 14:52:55 UTC (rev 41639)
@@ -39,7 +39,7 @@
QString getHelp();
protected:
- bool _exec(QStringList args);
+ bool _exec(GSClient* client, QStringList args);
};
Modified: rt^3/trunk/src/GS/GSClient.cxx
===================================================================
--- rt^3/trunk/src/GS/GSClient.cxx 2010-12-16 14:45:15 UTC (rev 41638)
+++ rt^3/trunk/src/GS/GSClient.cxx 2010-12-16 14:52:55 UTC (rev 41639)
@@ -30,11 +30,14 @@
this->ccReg = ClientCmdRegistry::getInstance();
this->log = Logger::getInstance();
this->jobMan = JobManager::getInstance();
+ this->portMan = new PortalManager();
+
this->stayRun = true;
this->prompt = defaultPrompt;
}
GSClient::~GSClient() {
+ delete this->portMan;
}
int
@@ -83,9 +86,14 @@
return false;
}
- return acc->exec(args);
+ return acc->exec(this, args);
}
+PortalManager*
+GSClient::getPortMan()
+{
+ return this->portMan;
+}
/*
* Local Variables:
Modified: rt^3/trunk/src/GS/cmds/AbstractClientCmd.cxx
===================================================================
--- rt^3/trunk/src/GS/cmds/AbstractClientCmd.cxx 2010-12-16 14:45:15 UTC
(rev 41638)
+++ rt^3/trunk/src/GS/cmds/AbstractClientCmd.cxx 2010-12-16 14:52:55 UTC
(rev 41639)
@@ -23,6 +23,7 @@
*/
#include "AbstractClientCmd.h"
+#include "GSClient.h"
AbstractClientCmd::AbstractClientCmd(QString cmd) : cmd(cmd)
{
@@ -42,8 +43,8 @@
}
bool
-AbstractClientCmd::exec(QStringList args) {
- return this->_exec(args);
+AbstractClientCmd::exec(GSClient* client, QStringList args) {
+ return this->_exec(client, args);
}
/*
Modified: rt^3/trunk/src/GS/cmds/ShutdownCmd.cxx
===================================================================
--- rt^3/trunk/src/GS/cmds/ShutdownCmd.cxx 2010-12-16 14:45:15 UTC (rev
41638)
+++ rt^3/trunk/src/GS/cmds/ShutdownCmd.cxx 2010-12-16 14:52:55 UTC (rev
41639)
@@ -41,10 +41,9 @@
}
bool
-ShutdownCmd::_exec(QStringList args){
+ShutdownCmd::_exec(GSClient* client, QStringList args){
-
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits