MAK RTIspy API Documentation for HLA 1.3
List of all members | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
DtAsyncFileDistributorRunnable Class Reference

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

+ Inheritance diagram for DtAsyncFileDistributorRunnable:
+ Collaboration diagram for DtAsyncFileDistributorRunnable:

Public Member Functions

 DtAsyncFileDistributorRunnable (DtFedExec *parent)
 Fedex Constructor.
virtual ~DtAsyncFileDistributorRunnable ()
 Destructor.
virtual std::auto_ptr
< DtDistributorThreadEvent
getNextEvent ()
virtual void postCommand (std::auto_ptr< DtFedExecDistribFunctor > cmd)
virtual void setOnExitHandler (const DtDistributorThreadEvent &fn)
virtual void registerUploadFedFileToExecEvent (const DtDistribFunctor &fn)
virtual void registerFedFileRequestsEvent (const DtDistribFunctor &fn)
virtual void registerRequestedModulesArrivedEvent (const DtDistribFunctor &fn)
virtual void registerTakeFileEvent (const DtDistribFunctor &fn)
virtual void registerPushFedFileToFederatesEvent (const DtDistribFunctor &fn)
virtual void registerPushFedFileToSingleFederateEvent (const DtDistribFunctor &fn)
virtual void run ()
 Thread Functions.
virtual void requestFedFileUploadToExec (const unsigned long initiatingFedID, const std::vector< DtString > *modules)
virtual bool sendFedFile (const std::vector< DtString > &modules, DtFederateHandle recipient)
virtual void fedFileUploaded (const DtString fileUploaded)
 Called when Fom Module received successfully.
void processTakeFileCmd (std::map< DtString, DtFileInformation * >)
void processPushFedFileToAllFederates (DtString name, int size, const char *buff, unsigned long destination)
void processFileRequested (const DtFomModuleRequestMsg &cmd)
void processFileReceived (const DtFomModuleDistributionMsg &cmd)
bool requestsPending () const
 Are there outstanding requests to be handled?
- Public Member Functions inherited from DtFileDistributor
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)

Static Public Member Functions

static
DtAsyncFileDistributorRunnable
create (DtFedExec *parent)
- Static Public Member Functions inherited from DtFileDistributor
static void setCreatorFunction (DtFileDistributorCreator fn)

Protected Types

typedef std::list
< DtDistributorThreadEvent * > 
DtDistributorThreadEventList
typedef std::pair
< DtDistributorThreadEvent
*, bool > 
DtMsgFunctorIsMomMsgPair
- Protected Types inherited from DtFileDistributor
typedef std::list< DtRtiMsg * > rtiMsgList

Protected Member Functions

void signalFrontEnd () const
bool executeCommand ()
void processInternalCommands ()
void changeCallbackEvents (const DtDistribFunctorChangeRequest &fn)
void clearEventList (rtiMsgList &theEventList)
- Protected Member Functions inherited from DtFileDistributor
 DtFileDistributor (const int fedExHandle, const int federateHandle, const MAKRti::DtString &fedExName)
 Constructor.
virtual ~DtFileDistributor ()
 Destructor.

Protected Attributes

bool myStopped
std::auto_ptr
< DtFedExecDistribFunctor
mySignal
std::auto_ptr
< DtDistributorThreadEvent
myOnExitEvent
DtThreadSafeQueue
< DtDistributorThreadEvent
myPendingCommands
DtThreadSafeQueue
< DtDistributorThreadEvent
myEventQueue
DtThreadSafeQueue
< DtDistributorThreadEvent
myInternalCmdQueue
DtDistributorThreadEventList myRequestedModuleArrivedEvents
 Registered event functors.
DtDistributorThreadEventList myTakeFileEvents
DtDistributorThreadEventList myFedFileRequestedEvents
DtDistributorThreadEventList myFedFileReceivedEvents
DtDistributorThreadEventList myPushFedFileToAllFederatesEvents
DtDistributorThreadEventList myPushFedFileToSingleFederateEvents
DtDistributorThreadEventList myUploadRequestEvents
- Protected Attributes inherited from DtFileDistributor
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

Private Member Functions

 DtAsyncFileDistributorRunnable ()
 DtAsyncFileDistributorRunnable (const DtAsyncFileDistributorRunnable &orig)
DtAsyncFileDistributorRunnableoperator= (const DtAsyncFileDistributorRunnable &orig)

Private Attributes

DtFedExecmyFedEx

Additional Inherited Members

- Static Protected Attributes inherited from DtFileDistributor
static DtFileDistributorCreator theCreator = 0

Detailed Description

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

Member Typedef Documentation

Constructor & Destructor Documentation

DtAsyncFileDistributorRunnable::DtAsyncFileDistributorRunnable ( DtFedExec parent)

Fedex Constructor.

DtAsyncFileDistributorRunnable::~DtAsyncFileDistributorRunnable ( )
virtual

Destructor.

References myStopped.

DtAsyncFileDistributorRunnable::DtAsyncFileDistributorRunnable ( )
private

Referenced by create().

DtAsyncFileDistributorRunnable::DtAsyncFileDistributorRunnable ( const DtAsyncFileDistributorRunnable orig)
private

Member Function Documentation

void DtAsyncFileDistributorRunnable::changeCallbackEvents ( const DtDistribFunctorChangeRequest fn)
protected
void DtAsyncFileDistributorRunnable::clearEventList ( rtiMsgList theEventList)
protected
DtAsyncFileDistributorRunnable * DtAsyncFileDistributorRunnable::create ( DtFedExec parent)
static
bool DtAsyncFileDistributorRunnable::executeCommand ( )
protected
void DtAsyncFileDistributorRunnable::fedFileUploaded ( const DtString  fileUploaded)
virtual

Called when Fom Module received successfully.

References myEventQueue, myRequestedModuleArrivedEvents, and DtThreadSafeQueue< T >::push_back().

Referenced by processFileReceived().

std::auto_ptr< DtDistributorThreadEvent > DtAsyncFileDistributorRunnable::getNextEvent ( )
virtual
DtAsyncFileDistributorRunnable& DtAsyncFileDistributorRunnable::operator= ( const DtAsyncFileDistributorRunnable orig)
private
void DtAsyncFileDistributorRunnable::postCommand ( std::auto_ptr< DtFedExecDistribFunctor cmd)
virtual
void DtAsyncFileDistributorRunnable::processFileReceived ( const DtFomModuleDistributionMsg cmd)
void DtAsyncFileDistributorRunnable::processFileRequested ( const DtFomModuleRequestMsg cmd)
void DtAsyncFileDistributorRunnable::processInternalCommands ( )
protected
void DtAsyncFileDistributorRunnable::processPushFedFileToAllFederates ( DtString  name,
int  size,
const char *  buff,
unsigned long  destination 
)
void DtAsyncFileDistributorRunnable::processTakeFileCmd ( std::map< DtString, DtFileInformation * >  files)
void DtAsyncFileDistributorRunnable::registerFedFileRequestsEvent ( const DtDistribFunctor fn)
virtual
void DtAsyncFileDistributorRunnable::registerPushFedFileToFederatesEvent ( const DtDistribFunctor fn)
virtual
void DtAsyncFileDistributorRunnable::registerPushFedFileToSingleFederateEvent ( const DtDistribFunctor fn)
virtual
void DtAsyncFileDistributorRunnable::registerRequestedModulesArrivedEvent ( const DtDistribFunctor fn)
virtual
void DtAsyncFileDistributorRunnable::registerTakeFileEvent ( const DtDistribFunctor fn)
virtual
void DtAsyncFileDistributorRunnable::registerUploadFedFileToExecEvent ( const DtDistribFunctor fn)
virtual
void DtAsyncFileDistributorRunnable::requestFedFileUploadToExec ( const unsigned long  initiatingFedID,
const std::vector< DtString > *  modules 
)
virtual
bool DtAsyncFileDistributorRunnable::requestsPending ( ) const

Are there outstanding requests to be handled?

Reimplemented from DtFileDistributor.

References DtFileDistributor::myPendingRequests.

void DtAsyncFileDistributorRunnable::run ( )
virtual
bool DtAsyncFileDistributorRunnable::sendFedFile ( const std::vector< DtString > &  modules,
DtFederateHandle  recipient 
)
virtual
void DtAsyncFileDistributorRunnable::setOnExitHandler ( const DtDistributorThreadEvent fn)
virtual
void DtAsyncFileDistributorRunnable::signalFrontEnd ( ) const
protected

References mySignal.

Referenced by executeCommand().

Member Data Documentation

DtThreadSafeQueue<DtDistributorThreadEvent> DtAsyncFileDistributorRunnable::myEventQueue
protected
DtFedExec* DtAsyncFileDistributorRunnable::myFedEx
private
DtDistributorThreadEventList DtAsyncFileDistributorRunnable::myFedFileReceivedEvents
protected
DtDistributorThreadEventList DtAsyncFileDistributorRunnable::myFedFileRequestedEvents
protected
DtThreadSafeQueue<DtDistributorThreadEvent> DtAsyncFileDistributorRunnable::myInternalCmdQueue
protected
std::auto_ptr<DtDistributorThreadEvent> DtAsyncFileDistributorRunnable::myOnExitEvent
protected

Referenced by changeCallbackEvents(), and run().

DtThreadSafeQueue<DtDistributorThreadEvent> DtAsyncFileDistributorRunnable::myPendingCommands
protected

Referenced by executeCommand(), and postCommand().

DtDistributorThreadEventList DtAsyncFileDistributorRunnable::myPushFedFileToAllFederatesEvents
protected
DtDistributorThreadEventList DtAsyncFileDistributorRunnable::myPushFedFileToSingleFederateEvents
protected

Referenced by changeCallbackEvents().

DtDistributorThreadEventList DtAsyncFileDistributorRunnable::myRequestedModuleArrivedEvents
protected

Registered event functors.

Referenced by changeCallbackEvents(), and fedFileUploaded().

std::auto_ptr<DtFedExecDistribFunctor> DtAsyncFileDistributorRunnable::mySignal
protected

Referenced by signalFrontEnd().

bool DtAsyncFileDistributorRunnable::myStopped
protected
DtDistributorThreadEventList DtAsyncFileDistributorRunnable::myTakeFileEvents
protected
DtDistributorThreadEventList DtAsyncFileDistributorRunnable::myUploadRequestEvents
protected

Referenced by changeCallbackEvents().


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

Document ID: Generated on Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)