Revision: 41758
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41758&view=rev
Author:   davidloman
Date:     2010-12-22 13:28:08 +0000 (Wed, 22 Dec 2010)

Log Message:
-----------
Introduce a new generic class: GenericEightBytesMsg.  Is designed to transport 
a single 64 bit value.  Prompted by Ping/PongMsg's need to move a 64 time value.

Modified Paths:
--------------
    rt^3/trunk/src/libNet/CMakeLists.txt

Added Paths:
-----------
    rt^3/trunk/include/GenericEightBytesMsg.h
    rt^3/trunk/src/libNet/netMsg/GenericEightBytesMsg.cxx

Added: rt^3/trunk/include/GenericEightBytesMsg.h
===================================================================
--- rt^3/trunk/include/GenericEightBytesMsg.h                           (rev 0)
+++ rt^3/trunk/include/GenericEightBytesMsg.h   2010-12-22 13:28:08 UTC (rev 
41758)
@@ -0,0 +1,74 @@
+/*          G E N E R I C E I G H T B Y T E S M S G . H
+ * BRL-CAD
+ *
+ * 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 GenericEightBytesMsg.h
+ *
+ * Brief description
+ *
+ */
+
+#ifndef __GENERICEIGHTBYTESMSG_H__
+#define __GENERICEIGHTBYTESMSG_H__
+
+#include "NetMsg.h"
+
+class GenericEightBytesMsg : public NetMsg
+{
+public:
+       /* Normal Constructor */
+       GenericEightBytesMsg(quint32 type, quint64 b);
+
+       /* Reply Constructor */
+       GenericEightBytesMsg(quint32 type, NetMsg* msg, quint64 b);
+
+       /* Deserializing Constructor */
+       GenericEightBytesMsg(QDataStream* ds, Portal* origin);
+
+       /* Destructor */
+       virtual ~GenericEightBytesMsg();
+
+       /*
+        * Utilities
+        */
+       virtual QString toString();
+
+protected:
+       quint64 getData();
+       quint64 data;
+
+       virtual bool _serialize(QDataStream* ds);
+       virtual bool _equals(const NetMsg& msg);
+
+private:
+       /* Disable copy cstr and =operator */
+       GenericEightBytesMsg(GenericEightBytesMsg const&):NetMsg(0){};
+       GenericEightBytesMsg& operator=(GenericEightBytesMsg const&){};
+};
+
+#endif /* __GENERICEIGHTBYTESMSG_H__ */
+
+/*
+ * Local Variables: ***
+ * mode: C++ ***
+ * tab-width: 8 ***
+ * c-basic-offset: 2 ***
+ * indent-tabs-mode: t ***
+ * End: ***
+ * ex: shiftwidth=2 tabstop=8
+*/


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

Modified: rt^3/trunk/src/libNet/CMakeLists.txt
===================================================================
--- rt^3/trunk/src/libNet/CMakeLists.txt        2010-12-22 13:18:51 UTC (rev 
41757)
+++ rt^3/trunk/src/libNet/CMakeLists.txt        2010-12-22 13:28:08 UTC (rev 
41758)
@@ -56,6 +56,7 @@
        netMsg/GenericOneByteMsg.cxx
        netMsg/GenericTwoBytesMsg.cxx
        netMsg/GenericFourBytesMsg.cxx
+       netMsg/GenericEightBytesMsg.cxx
        netMsg/GenericMultiByteMsg.cxx
        netMsg/FailureMsg.cxx
        netMsg/SuccessMsg.cxx
@@ -86,6 +87,7 @@
        GenericOneByteMsg.h
        GenericTwoBytesMsg.h
        GenericFourBytesMsg.h
+       GenericEightBytesMsg.h
        GenericMultiByteMsg.h
        FailureMsg.h
        SuccessMsg.h

Added: rt^3/trunk/src/libNet/netMsg/GenericEightBytesMsg.cxx
===================================================================
--- rt^3/trunk/src/libNet/netMsg/GenericEightBytesMsg.cxx                       
        (rev 0)
+++ rt^3/trunk/src/libNet/netMsg/GenericEightBytesMsg.cxx       2010-12-22 
13:28:08 UTC (rev 41758)
@@ -0,0 +1,96 @@
+/*        G E N E R I C E I G H T B Y T E S M S G . C X X
+ * BRL-CAD
+ *
+ * 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 GenericEightBytesMsg.cxx
+ *
+ * Brief description
+ *
+ */
+
+
+#include "GenericEightBytesMsg.h"
+#include <sstream>
+
+/* Normal Constructor */
+GenericEightBytesMsg::GenericEightBytesMsg(quint32 type, quint64 data) :
+    NetMsg(type), data(data)
+{}
+
+/* Reply Constructor */
+GenericEightBytesMsg::GenericEightBytesMsg(quint32 type, NetMsg* msg, quint64 
data) :
+       NetMsg(type, msg), data(data)
+{}
+
+/* Deserializing Constructor */
+GenericEightBytesMsg::GenericEightBytesMsg(QDataStream* ds, Portal* origin) :
+    NetMsg(ds, origin)
+{
+    *ds >> this->data;
+}
+
+/* Destructor */
+GenericEightBytesMsg::~GenericEightBytesMsg()
+{}
+
+bool GenericEightBytesMsg::_serialize(QDataStream* ds)
+{
+    *ds << this->data;
+    return true;
+}
+
+QString GenericEightBytesMsg::toString()
+{
+    QString out;
+
+    out.append(NetMsg::toString());
+    out.append("\t data: '");
+    out.append(QString::number(this->data));
+    out.append("'");
+
+    return out;
+}
+
+bool GenericEightBytesMsg::_equals(const NetMsg& msg)
+{
+    GenericEightBytesMsg& gmsg = (GenericEightBytesMsg&) msg;
+
+    if (this->getData() != gmsg.getData()) {
+       return false;
+    }
+
+    return true;
+}
+
+/*
+ *Getters n Setters
+ */
+quint64 GenericEightBytesMsg::getData()
+{
+    return this->data;
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */


Property changes on: rt^3/trunk/src/libNet/netMsg/GenericEightBytesMsg.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