VR-Forces 4.1.1 Class Documentation
Turn And Move To PSR

This subclass of DtVrfProcessStateRepository that will keep information about the turn and move task to use when reloaded as part of a scenario.


Header file:

/*******************************************************************************
** Copyright (c) 2005 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: turnAndMoveControllerPSR.h,v $ $Revision: 1.3 $ $State: Exp $
*******************************************************************************/
#ifndef turnAndMoveControllerPSR_H_
#define turnAndMoveControllerPSR_H_
#include "vrfutil/rwInt.h"
//RW type definition.
const char DtTurnAndMoveControllerPSRType[] = "turn-and-move-process-state-repository";
//DtTurnAndMoveControllerPSR is a process state repository which holds state variables for
//the DtTurnAndMoveController component.
//Process State Repositories hold state data for one or more components so that
//their internal state is preserved when a scenario is saved and reloaded.
{
public:
//Constructor
const DtString& rwName = DtString::nullString(),
DtReaderWriterRegistry* parentRegistry = 0);
//Copy constructor
const DtString& rwName = DtString::nullString(),
DtReaderWriterRegistry* parentRegistry = 0);
//Assignment Operator
//Destructor
//Returns complete copy of this class using the copy constructor.
const DtString& rwName = DtString::nullString(),
DtReaderWriterRegistry* parentRegistry = 0) const;
//Returns "turn-and-move-process-state-repository"
virtual DtString type() const;
//Static creator function for factory registration.
DtVrfObject* vrfObject, DtReaderWriterRegistry* parentRegistry = 0);
virtual DtString destinationName() const;
virtual void setDestinationName(const DtString& newValue);
virtual int subtaskId() const;
virtual void setSubtaskId(const int& newValue);
virtual int taskState() const;
virtual void setTaskState(const int& newValue);
protected:
};
#endif

Implementation:

/*******************************************************************************
** Copyright (c) 2005 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: turnAndMoveControllerPSR.cxx,v $ $Revision: 1.1 $ $State: Exp $
*******************************************************************************/
//All RW data members must be registered in the constructor with their rw names.
const DtString& rwName,
DtReaderWriterRegistry* parentRegistry) :
DtVrfProcessStateRepository(vrfObject, rwName, parentRegistry),
myDestinationName("destination-name", &myRegistry),
mySubtaskId("subtask-id", &myRegistry),
myTaskState("task-state", &myRegistry)
{
//Set default values for RW data members.
//These values will be the initial values for a newly created component.
myDestinationName = "";
mySubtaskId = -1;
myTaskState = 0;
}
const DtString& rwName,
DtReaderWriterRegistry* parentRegistry) :
DtVrfProcessStateRepository(orig, rwName, parentRegistry),
myDestinationName(orig.myDestinationName.name(), &myRegistry),
mySubtaskId(orig.mySubtaskId.name(), &myRegistry),
myTaskState(orig.myTaskState.name(), &myRegistry)
{
myDestinationName = orig.myDestinationName;
mySubtaskId = orig.mySubtaskId;
myTaskState = orig.myTaskState;
}
{
if (this == &orig) {return *this;}
return *this;
}
{
}
{
}
const DtString& rwName, DtReaderWriterRegistry* parentRegistry) const
{
return new DtTurnAndMoveControllerPSR(*this, rwName, parentRegistry);
}
const DtString& rwName, DtVrfObject* vrfObject, DtReaderWriterRegistry* parentRegistry)
{
return new DtTurnAndMoveControllerPSR(vrfObject, rwName, parentRegistry);
}
{
}
{
myDestinationName = newValue;
}
{
return mySubtaskId;
}
{
mySubtaskId = newValue;
}
{
return myTaskState;
}
{
myTaskState = newValue;
}

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)