![]() |
MAK RTIspy API Documentation for HLA 1516
|
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. | |
| DtFileInformation * | takeFedFile (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 * > | myOpenFileHandles |
Static Protected Attributes | |
| static DtFileDistributorCreator | theCreator = 0 |
Private Member Functions | |
| DtFileDistributor () | |
| DtFileDistributor (const DtFileDistributor &orig) | |
| DtFileDistributor & | operator= (const DtFileDistributor &orig) |
Distributes fomModule files from initiating federate to RtiExec and then from RtiExec to all joining federates.
typedef std::list< DtRtiMsg* > DtFileDistributor::rtiMsgList [protected] |
| DtFileDistributor::DtFileDistributor | ( | const int | fedExHandle, |
| const int | federateHandle, | ||
| const MAKRti::DtString & | fedExName | ||
| ) | [protected] |
Constructor.
| DtFileDistributor::~DtFileDistributor | ( | ) | [protected, virtual] |
Destructor.
References myFiles, and myOpenFileHandles.
| DtFileDistributor::DtFileDistributor | ( | ) | [private] |
| DtFileDistributor::DtFileDistributor | ( | const DtFileDistributor & | orig | ) | [private] |
| const char * DtFileDistributor::fedFileBuff | ( | MAKRti::DtString | fileName | ) | const |
Get the fed file buffer.
References myFiles.
| const FILE * DtFileDistributor::fedFilePtr | ( | MAKRti::DtString | fileName | ) | const |
Get the fed file pointer.
References myFiles.
Referenced by DtRtiExecFederateMgr::mergeFomModules().
| bool DtFileDistributor::fedFileReady | ( | const MAKRti::DtString & | fileName | ) | const [virtual] |
Does the distributor have a valid copy of this fom Module.
References myFiles.
Referenced by fedFilesReady().
| bool DtFileDistributor::fedFilesReady | ( | const std::vector< MAKRti::DtString > * | fileNames | ) | const [virtual] |
Does the distributor have a valid copy of all of these fom Modules.
References fedFileReady().
| void DtFileDistributor::fedFileUploaded | ( | const MAKRti::DtString | fileUploaded | ) | [virtual] |
Called when Fom Module received successfully.
References DtReadFile(), fileSize(), getTmpFile(), DtFileInformation::myBuffer, DtFileInformation::myFilePointer, myFiles, DtFileInformation::myFileSize, and NULL.
Referenced by DtSynchronousFileDistributor::multFileReceivedCb().
| bool DtFileDistributor::fileReceived | ( | const DtFomModuleDistributionMsg & | msg, |
| bool & | areAllHere | ||
| ) | [virtual] |
References DtFomModuleDistributionMsg::blockSize(), DtFomModuleDistributionMsg::destination(), DtRtiMsg::federateHandle(), DtFomModuleDistributionMsg::fomModuleName(), DtFomModuleDistributionMsg::fullFedExName(), maxBlockSize, myFederateHandle, myFedExName, myFiles, NULL, DtFomModuleDistributionMsg::numFomModuleBlocks(), DtFomModuleDistributionMsg::readFomModuleBlock(), DtFomModuleDistributionMsg::seqNum(), and DtFomModuleDistributionMsg::sourceID().
Referenced by DtSynchronousFileDistributor::multFileReceivedCb(), and DtAsyncFileDistributorRunnable::processFileReceived().
| bool DtFileDistributor::fileRequested | ( | const DtFomModuleRequestMsg & | msg | ) | [virtual] |
| unsigned int DtFileDistributor::fileSize | ( | MAKRti::DtString | fileName | ) | const |
References myFiles.
Referenced by fedFileUploaded(), and pushFedFile().
| FILE * DtFileDistributor::getTmpFile | ( | ) |
References myOpenFileHandles.
Referenced by fedFileUploaded().
| DtFileDistributor& DtFileDistributor::operator= | ( | const DtFileDistributor & | orig | ) | [private] |
| bool DtFileDistributor::pushFedFile | ( | DtConnectionMgr * | connMgr, |
| const MAKRti::DtString & | fileName, | ||
| const unsigned int | fileSize, | ||
| const char * | fileBuffer, | ||
| const DtFederateHandle | destination = 0 |
||
| ) | [virtual] |
pushFedFile
References DtMessageFactory< T_Message, T_MessageKind, T_NetworkHeader >::create(), DtFomModuleDistributionMsgKind, fileSize(), maxBlockSize, DtConnectionMgr::msgFactory(), myFederateHandle, myFedExHandle, myFedExName, NULL, DtConnectionMgr::sendStampedAndDelete(), DtFomModuleDistributionMsg::setBlock(), DtFomModuleDistributionMsg::setDestination(), DtRtiMsg::setFederateHandle(), DtRtiMsg::setFedEx(), DtFomModuleDistributionMsg::setFomModuleName(), DtFomModuleDistributionMsg::setFullFedExName(), DtFomModuleDistributionMsg::setSourceID(), and DtConnectionMgr::tick().
Referenced by DtFedExec::pushFomModuleToSingleFederate(), DtSynchronousFileDistributor::sendFedFile(), and DtSynchronousFileDistributor::tick().
| void DtFileDistributor::removeFile | ( | const MAKRti::DtString | fileName | ) | [virtual] |
Remove all knowledge of this file from myFiles.
References DtFileInformation::myFileOwned, and myFiles.
Referenced by removeFiles().
| void DtFileDistributor::removeFiles | ( | const std::vector< MAKRti::DtString > & | modules | ) | [virtual] |
Remove all knowledge of these file from myFiles.
References removeFile().
Referenced by DtFedexRemoveFileCmd::operator()().
| bool DtFileDistributor::requestsPending | ( | ) | const |
Are there outstanding requests to be handled?
Reimplemented in DtAsyncFileDistributorRunnable.
References myPendingRequests.
| bool DtFileDistributor::sendFedFile | ( | const std::vector< MAKRti::DtString > & | modules | ) | [virtual] |
Override sendFedFile upload fed files passed in.
Reimplemented in DtSynchronousFileDistributor.
References DtReadFile(), maxBlockSize, myFiles, DtFileInformation::myFomModFileName, NULL, and DtLibRTIUtil::openFedFile().
Referenced by DtSynchronousFileDistributor::sendFedFile(), and DtAsyncFileDistributorRunnable::sendFedFile().
| void DtFileDistributor::setCreatorFunction | ( | DtFileDistributorCreator | fn | ) | [static] |
References theCreator.
| void DtFileDistributor::setFedexHandle | ( | unsigned int | newHandle | ) |
References myFedExHandle.
Referenced by DtFedExec::createDistributor().
| 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.
References myFederateHandle.
Referenced by DtFedExec::createDistributor().
| DtFileInformation * DtFileDistributor::takeFedFile | ( | MAKRti::DtString | fileName | ) |
Take ownership of the file.
retVal will be zero if file not complete (or nonexistent)
References myFiles.
Referenced by DtAsyncFileDistributorRunnable::processTakeFileCmd().
int DtFileDistributor::myFederateHandle [protected] |
Referenced by fileReceived(), fileRequested(), DtSynchronousFileDistributor::pullEntireFedFile(), pushFedFile(), and setFedHandle().
int DtFileDistributor::myFedExHandle [protected] |
Referenced by DtSynchronousFileDistributor::pullEntireFedFile(), pushFedFile(), and setFedexHandle().
MAKRti::DtString DtFileDistributor::myFedExName [protected] |
Referenced by fileReceived(), fileRequested(), DtSynchronousFileDistributor::pullEntireFedFile(), and pushFedFile().
std::map<MAKRti::DtString, DtFileInformation*> DtFileDistributor::myFiles [protected] |
Map between files that have been uploaded to me and their 'file names'.
Referenced by fedFileBuff(), fedFilePtr(), fedFileReady(), fedFileUploaded(), fileReceived(), fileSize(), DtSynchronousFileDistributor::multFileReceivedCb(), DtAsyncFileDistributorRunnable::processFileReceived(), DtSynchronousFileDistributor::pullEntireFedFile(), removeFile(), DtSynchronousFileDistributor::sendFedFile(), DtAsyncFileDistributorRunnable::sendFedFile(), sendFedFile(), takeFedFile(), DtSynchronousFileDistributor::tick(), and ~DtFileDistributor().
std::map<MAKRti::DtString, FILE* > DtFileDistributor::myOpenFileHandles [protected] |
Referenced by getTmpFile(), and ~DtFileDistributor().
std::set<std::pair<DtFederateHandle, MAKRti::DtString> > DtFileDistributor::myPendingRequests [protected] |
DtFileDistributorCreator DtFileDistributor::theCreator = 0 [static, protected] |
Referenced by setCreatorFunction().