Revision: 41764
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41764&view=rev
Author:   davidloman
Date:     2010-12-22 14:18:40 +0000 (Wed, 22 Dec 2010)

Log Message:
-----------
Implement PingCmd.  Used by GSClient to initiate a ping.

Added Paths:
-----------
    rt^3/trunk/include/PingCmd.h
    rt^3/trunk/src/GS/cmds/PingCmd.cxx

Added: rt^3/trunk/include/PingCmd.h
===================================================================
--- rt^3/trunk/include/PingCmd.h                                (rev 0)
+++ rt^3/trunk/include/PingCmd.h        2010-12-22 14:18:40 UTC (rev 41764)
@@ -0,0 +1,54 @@
+/*                       P I N G C M D . H
+ * BRLCAD
+ *
+ * Copyright (c) 2010 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file PingCmd.h
+ * PingCmd.h
+ *
+ *  Created on: Dec 22, 2010
+ */
+
+#ifndef __PINGCMD_H__
+#define __PINGCMD_H__
+
+#include "AbstractClientCmd.h"
+#include <QtCore/QString>
+
+class PingCmd: public AbstractClientCmd {
+public:
+       PingCmd();
+       virtual ~PingCmd();
+       QString getUsage();
+       QString getHelp();
+
+protected:
+       bool _exec(GSClient* client, QStringList args);
+
+};
+
+#endif /* __PINGCMD_H__ */
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */


Property changes on: rt^3/trunk/include/PingCmd.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Revision Date Author
Added: svn:eol-style
   + native

Added: rt^3/trunk/src/GS/cmds/PingCmd.cxx
===================================================================
--- rt^3/trunk/src/GS/cmds/PingCmd.cxx                          (rev 0)
+++ rt^3/trunk/src/GS/cmds/PingCmd.cxx  2010-12-22 14:18:40 UTC (rev 41764)
@@ -0,0 +1,68 @@
+/*                     P I N G C M D . C X X
+ * BRLCAD
+ *
+ * Copyright (c) 2010 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file PingCmd.cxx
+ * PingCmd.cxx
+ *
+ *  Created on: Dec 22, 2010
+ */
+
+#include "PingCmd.h"
+
+PingCmd::PingCmd(): AbstractClientCmd("ping"){}
+
+PingCmd::~PingCmd() {}
+
+
+QString
+PingCmd::getUsage(){
+       return "Usage: ping";
+}
+
+QString
+PingCmd::getHelp(){
+       return "Pings the remote host.  Pong is expected in return.";
+}
+
+bool
+PingCmd::_exec(GSClient* client, QStringList args){
+       Portal* p = client->getCurrentPortal();
+
+       if (p == NULL)  {
+               this->log->logERROR("LoginCmd", "Current Portal is NULL.");
+               return false;
+       }
+
+       quint64 now = Logger::getCurrentTime();
+       PingMsg msg(now);
+
+       p->send(&msg);
+       return true;
+}
+
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */


Property changes on: rt^3/trunk/src/GS/cmds/PingCmd.cxx
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Revision Date Author
Added: svn:eol-style
   + native


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

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your 
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to