VR-Forces 4.0.4 Class Documentation

DtTestInteractionInterface.h

/******************************************************************************
** Copyright (c) 2012 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/
/******************************************************************************
** $RCSfile: DtTestInteractionInterface.h,v $ $Revision: 1.1 $ $State: Exp $
******************************************************************************/

//\file DtTestInteractionInterface.h

//\brief Contains DtTestInteractionInterface class.

#pragma once

#include <vrfGuiCore/DtNetworkMessageInterface.h>

#include <vector>
#include <string>

//The DtTestInteractionInterface will be used to communicate from the network thread
//to the Gui thread the contents of the Test Pdu.  In order to register
//for this message in the gui, use the static method ::name() as the item
//to register for

class DtTestInteractionInterface : public makVrf::DtNetworkMessageInterface
{
public:
   DtTestInteractionInterface();
      
   //Copy constructor.  Supply your own copy constructor and use
   //it from the clone method as that is the mechanism that will be
   //used to transfer the data from the network thread to the GUI thread
   DtTestInteractionInterface(const DtTestInteractionInterface&);

   virtual ~DtTestInteractionInterface();

   //Override to provide a clone of your class
   virtual DtNetworkMessageInterface* clone() const;

   void setMessage(const std::string&);
   const std::string& message() const;

   //The unique name of this item.  Typically will use class name.  This is what
   //will be sent when notifying the gui of a receipt of a network message and
   //what the gui will register for to receive it
   static const char* theName();

   //Returns static member
   virtual const char* name() { return theName(); };

protected:
   std::string myMessage;
};

DtTestInteractionInterface.cxx

/******************************************************************************
** Copyright (c) 2012 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/
/******************************************************************************
** $RCSfile: DtTestInteractionInterface.cxx,v $ $Revision: 1.1 $ $State: Exp $
******************************************************************************/

//\file DtTestInteractionInterface.cxx

#include "DtTestInteractionInterface.h"

using namespace makVrf;

DtTestInteractionInterface::DtTestInteractionInterface()
{
}
      
DtTestInteractionInterface::DtTestInteractionInterface(const DtTestInteractionInterface& orig)
: DtNetworkMessageInterface(orig)
, myMessage(orig.myMessage)
{
}

DtTestInteractionInterface::~DtTestInteractionInterface()
{
}

DtNetworkMessageInterface* DtTestInteractionInterface::clone() const
{
   return new DtTestInteractionInterface(*this);
}

void DtTestInteractionInterface::setMessage(const std::string& message)
{
   myMessage = message;
}

const std::string& DtTestInteractionInterface::message() const
{
   return myMessage;
}

//The unique name of this item.  Typically will use class name.  This is what
//will be sent when notifying the gui of a receipt of a network message and
//what the gui will register for to receive it
const char* DtTestInteractionInterface::theName()
{
   return "DtTestInteractionInterface";
}

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)