/*******************************************************************************
** Copyright (c) 1998 MaK Technologies, Inc.
** All rights reserved.
*******************************************************************************/

//! \file lcPlayFile.h
//! \brief Contains DtLgrPbFilePdu

#pragma once

#include "lcPdu.h"
#include <vlutil/vlFilename.h>

//! Instances of DtLgrPbFilePdu are used for switching to play-mode and defining
//! which file to read from when sending traffic into the simulation.
//! \ingroup loggerControlToolkit
class DT_DLL_LOGGERCONTROL DtLgrPbFilePdu : public DtLgrControlPdu
{
public:

   //! (default) constructor
   DtLgrPbFilePdu( DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER );

   //! constructor (construct from network representation)
   DtLgrPbFilePdu( const DtNetLgrControlPdu* initial,
      DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0 );

   //! constructor (construct and prepare for send)
   DtLgrPbFilePdu( const DtEntityIdentifier& sender,
      const DtEntityIdentifier& receiver, const char* name,
      DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER );

   //! destructor
   virtual ~DtLgrPbFilePdu();

   //! copy constructor
   DtLgrPbFilePdu( const DtLgrPbFilePdu& src );

   //! assignment operator
   DtLgrPbFilePdu& operator=( const DtLgrPbFilePdu& src );

   //! Get/set file to open for playback.  (Path relative to logger.)
   virtual const char* filename() const;
   virtual void setFilename( const char* path );

   //! Return correctly cast parameters pointer; see lgrControlP.h.
   virtual DtLgrStringParams* params() const;

   //! Diagnostic output.
   virtual void printData() const;

private:
   //! Parameter
   DtFilename myFilename;
};

