MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtFileDistributor Class Reference

Distributes fomModule files from initiating federate to RtiExec and then from RtiExec to all joining federates. More...

+ Inheritance diagram for DtFileDistributor:
+ Collaboration diagram for DtFileDistributor:

Public Member Functions

virtual bool sendFedFile (const std::vector< MAKRti::DtString > &modules)
 Override sendFedFile upload fed files passed in.
virtual bool pushFedFile (DtConnectionMgr *connMgr, const MAKRti::DtString &fileName, const unsigned int fileSize, const char *fileBuffer, const DtFederateHandle destination=0)
 pushFedFile
virtual void fedFileUploaded (const MAKRti::DtString fileUploaded)
 Called when Fom Module received successfully.
virtual bool fileReceived (const DtFomModuleDistributionMsg &msg, bool &areAllHere)
virtual bool fileRequested (const DtFomModuleRequestMsg &msg)
virtual void removeFile (const MAKRti::DtString fileName)
 Remove all knowledge of this file from myFiles.
virtual void removeFiles (const std::vector< MAKRti::DtString > &modules)
 Remove all knowledge of these file from myFiles.
virtual bool fedFileReady (const MAKRti::DtString &fileName) const
 Does the distributor have a valid copy of this fom Module.
virtual bool fedFilesReady (const std::vector< MAKRti::DtString > *fileNames) const
 Does the distributor have a valid copy of all of these fom Modules.
const FILE * fedFilePtr (MAKRti::DtString fileName) const
 Get the fed file pointer.
const char * fedFileBuff (MAKRti::DtString fileName) const
 Get the fed file buffer.
DtFileInformationtakeFedFile (MAKRti::DtString fileName)
 Take ownership of the file.
unsigned int fileSize (MAKRti::DtString fileName) const
FILE * getTmpFile ()
void setFedHandle (unsigned int newHandle)
 Set the Fed Handle of the distributor.
void setFedexHandle (unsigned int newHandle)
bool requestsPending () const
 Are there outstanding requests to be handled?

Static Public Member Functions

static void setCreatorFunction (DtFileDistributorCreator fn)

Protected Types

typedef std::list< DtRtiMsg * > rtiMsgList

Protected Member Functions

 DtFileDistributor (const int fedExHandle, const int federateHandle, const MAKRti::DtString &fedExName)
 Constructor.
virtual ~DtFileDistributor ()
 Destructor.

Protected Attributes

std::map< MAKRti::DtString,
DtFileInformation * > 
myFiles
 Map between files that have been uploaded to me and their 'file names'.
std::set< std::pair
< DtFederateHandle,
MAKRti::DtString > > 
myPendingRequests
MAKRti::DtString myFedExName
int myFedExHandle
int myFederateHandle
std::map< MAKRti::DtString,
FILE * > 
myTempFileHandles

Static Protected Attributes

static DtFileDistributorCreator theCreator

Private Member Functions

 DtFileDistributor ()
 DtFileDistributor (const DtFileDistributor &orig)
DtFileDistributoroperator= (const DtFileDistributor &orig)

Detailed Description

Distributes fomModule files from initiating federate to RtiExec and then from RtiExec to all joining federates.

Member Typedef Documentation

typedef std::list< DtRtiMsg* > DtFileDistributor::rtiMsgList
protected

Constructor & Destructor Documentation

DtFileDistributor::DtFileDistributor ( const int  fedExHandle,
const int  federateHandle,
const MAKRti::DtString &  fedExName 
)
protected

Constructor.

virtual DtFileDistributor::~DtFileDistributor ( )
protectedvirtual

Destructor.

DtFileDistributor::DtFileDistributor ( )
private
DtFileDistributor::DtFileDistributor ( const DtFileDistributor orig)
private

Member Function Documentation

const char* DtFileDistributor::fedFileBuff ( MAKRti::DtString  fileName) const

Get the fed file buffer.

const FILE* DtFileDistributor::fedFilePtr ( MAKRti::DtString  fileName) const

Get the fed file pointer.

virtual bool DtFileDistributor::fedFileReady ( const MAKRti::DtString &  fileName) const
virtual

Does the distributor have a valid copy of this fom Module.

virtual bool DtFileDistributor::fedFilesReady ( const std::vector< MAKRti::DtString > *  fileNames) const
virtual

Does the distributor have a valid copy of all of these fom Modules.

virtual void DtFileDistributor::fedFileUploaded ( const MAKRti::DtString  fileUploaded)
virtual

Called when Fom Module received successfully.

virtual bool DtFileDistributor::fileReceived ( const DtFomModuleDistributionMsg msg,
bool &  areAllHere 
)
virtual
virtual bool DtFileDistributor::fileRequested ( const DtFomModuleRequestMsg msg)
virtual
unsigned int DtFileDistributor::fileSize ( MAKRti::DtString  fileName) const
FILE* DtFileDistributor::getTmpFile ( )
DtFileDistributor& DtFileDistributor::operator= ( const DtFileDistributor orig)
private
virtual bool DtFileDistributor::pushFedFile ( DtConnectionMgr connMgr,
const MAKRti::DtString &  fileName,
const unsigned int  fileSize,
const char *  fileBuffer,
const DtFederateHandle  destination = 0 
)
virtual

pushFedFile

virtual void DtFileDistributor::removeFile ( const MAKRti::DtString  fileName)
virtual

Remove all knowledge of this file from myFiles.

virtual void DtFileDistributor::removeFiles ( const std::vector< MAKRti::DtString > &  modules)
virtual

Remove all knowledge of these file from myFiles.

bool DtFileDistributor::requestsPending ( ) const

Are there outstanding requests to be handled?

Reimplemented in DtAsyncFileDistributorRunnable.

virtual bool DtFileDistributor::sendFedFile ( const std::vector< MAKRti::DtString > &  modules)
virtual

Override sendFedFile upload fed files passed in.

Reimplemented in DtSynchronousFileDistributor.

static void DtFileDistributor::setCreatorFunction ( DtFileDistributorCreator  fn)
static
void DtFileDistributor::setFedexHandle ( unsigned int  newHandle)
void DtFileDistributor::setFedHandle ( unsigned int  newHandle)

Set the Fed Handle of the distributor.

Because federates will use the distributor before they're joined, they'll need to reassign from the connectHandle to their Fed Handle once they're joined.

DtFileInformation* DtFileDistributor::takeFedFile ( MAKRti::DtString  fileName)

Take ownership of the file.

retVal will be zero if file not complete (or nonexistent)

Member Data Documentation

int DtFileDistributor::myFederateHandle
protected
int DtFileDistributor::myFedExHandle
protected
MAKRti::DtString DtFileDistributor::myFedExName
protected
std::map<MAKRti::DtString, DtFileInformation*> DtFileDistributor::myFiles
protected

Map between files that have been uploaded to me and their 'file names'.

std::set<std::pair<DtFederateHandle, MAKRti::DtString> > DtFileDistributor::myPendingRequests
protected
std::map<MAKRti::DtString, FILE* > DtFileDistributor::myTempFileHandles
protected
DtFileDistributorCreator DtFileDistributor::theCreator
staticprotected

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)