MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
asynchronousFileDistributor.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2007 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: asynchronousFileDistributor.h,v $ $Revision: 1.9 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtAsyncFileDistributorRunnable_H_
13 #define DtAsyncFileDistributorRunnable_H_
14 
15 
16 #include "fileDistributor.h"
18 #include <vlutil/vlRunnable.h>
19 #include <vlutil/vlThread.h>
20 #include "vlThreadSafeQueue.h"
21 #include <vlutil/vlThreadSafe.h>
22 #include "vlThreadedObject.h"
23 #include "fedex.h"
24 
28 
29 
34 {
35 
36 public:
37 
40 
43 
44 
45  //Event processing.
46 
47  virtual std::auto_ptr<DtDistributorThreadEvent> getNextEvent();
48 
49  virtual void postCommand( std::auto_ptr<DtFedExecDistribFunctor> cmd);
50 
51  virtual void setOnExitHandler( const DtDistributorThreadEvent& fn );
52 
53  //Register/ Unregister event calls:
54  virtual void registerUploadFedFileToExecEvent( const DtDistribFunctor& fn );
55  virtual void registerFedFileRequestsEvent( const DtDistribFunctor& fn );
56  virtual void registerRequestedModulesArrivedEvent( const DtDistribFunctor& fn );
57  virtual void registerTakeFileEvent( const DtDistribFunctor& fn );
58  virtual void registerPushFedFileToFederatesEvent( const DtDistribFunctor& fn );
59  virtual void registerPushFedFileToSingleFederateEvent( const DtDistribFunctor& fn );
60 
61 
62 public:
63 
65  virtual void run();
66 
67  static DtAsyncFileDistributorRunnable* create( DtFedExec* parent );
68 
69  virtual void requestFedFileUploadToExec( const unsigned long initiatingFedID,
70  const std::vector<DtString>* modules);
71  virtual bool sendFedFile(const std::vector<DtString>& modules, DtFederateHandle recipient);
72 
74  virtual void fedFileUploaded(const DtString fileUploaded);
75 
76  void processTakeFileCmd(std::map<DtString, DtFileInformation*>);
77 
78  void processPushFedFileToAllFederates(DtString name, int size, const char* buff, unsigned long destination);
79  void processFileRequested( const DtFomModuleRequestMsg& cmd );
80  void processFileReceived( const DtFomModuleDistributionMsg& cmd );
81 
82 
84  bool requestsPending() const;
85 
86 private:
90 
91 
92 private:
93 
95 
96 protected:
97 
98  typedef std::list<DtDistributorThreadEvent*> DtDistributorThreadEventList;
99 
100 protected:
101  void signalFrontEnd() const;
102  bool executeCommand();
103  void processInternalCommands();
104  void changeCallbackEvents( const DtDistribFunctorChangeRequest& fn );
105  void clearEventList( rtiMsgList& theEventList );
106  bool myStopped;
107 
108 protected:
109  std::auto_ptr<DtFedExecDistribFunctor> mySignal;
110  std::auto_ptr<DtDistributorThreadEvent> myOnExitEvent;
111 
113 
115 
117 
126 
127 
128  typedef std::pair< DtDistributorThreadEvent*, bool> DtMsgFunctorIsMomMsgPair;
129 
130 
131 
132 };
133 
134 #endif

Document ID: Generated on Mon Mar 21 09:41:37 EDT 2016 from SVN revision 163228
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)