MAK RTIspy API Documentation for HLA 1.3
federateCounterProcessor.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2005 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: federateCounterProcessor.h,v $ $Revision: 1.4 $ $State: Exp $
00007 *********************************************************************/
00010 
00011 #ifndef DtFederateCounterProcessor_H_
00012 #define DtFederateCounterProcessor_H_
00013 
00014 #include "forwarderNode.h"
00015 #include "forwarderCounterMsg.h"
00016 #include "routeMap.h"
00017 #include "rtiMsConfig.h"
00018 
00019 #include <vlutil/vlUtil.h>
00020 #include <map>
00021 #include <set>
00022 
00023 class DtFederateCounterFilter;
00024 class DtRtiExecDisconnectFilter;
00025 
00043 class DT_DLL_FORWARDER DtFederateCounterProcessor
00044 {
00045 public:
00047    typedef bool (DtFederateCounterProcessor::* CounterMsgHandlerMemberCb)(
00048       const DtInetAddrAndPort& src, const DtForwarderCounterMsg& msg  );
00049    typedef bool (DtFederateCounterProcessor::* DestinationProcessingMemberCb)(
00050       const DtInetAddrAndPort& src, DtForwarderPort::DtAddressPortList& destinations );
00051 
00053    DtFederateCounterProcessor( DtBoost::shared_ptr<DtForwarderNode> parent );
00054    
00056    virtual ~DtFederateCounterProcessor();
00057 
00059    virtual bool gotMsgToOutPort( const DtInetAddrAndPort& src,
00060                                  const DtForwarderCounterMsg& msg );
00061 
00064    virtual bool processCounterMsgDestinations ( const DtInetAddrAndPort& src, 
00065       DtForwarderPort::DtAddressPortList& destinations );
00066 
00067 public:
00068 
00070    static int lostConnection( const MAKRti::DtString& connName,
00071       unsigned int connID, const DtInetAddrAndPort& connAddr, void* usr );
00072 
00073 protected:
00074 
00076    virtual int lostConnection( const MAKRti::DtString& connName,
00077       unsigned int connID, const DtInetAddrAndPort& connAddr );
00078    
00080    virtual void sendResponseMsg( const DtInetAddrAndPort& destination,
00081       unsigned int federateCount, const DtInetAddrAndPort* addr = 0 );
00082 
00085    virtual void requestDownstreamCount( const DtInetAddrAndPort& destination );   
00086    virtual void requestDownstreamCount( const DtInetAddrAndPort& destination,
00087                                         const DtRouteMap::DtAddressPortList& destinations );
00088 
00090    virtual bool processInToOutMsg( const DtInetAddrAndPort& src,
00091       const DtForwarderCounterMsg& msg );
00092    
00094    virtual bool processLanToOutMsg( const DtInetAddrAndPort& src,
00095       const DtForwarderCounterMsg& msg );
00096 
00097    
00098 protected:
00099 
00101    class PendingRequest
00102    {
00103    public:
00104       PendingRequest() :
00105          currentCount( 0 ),
00106          destinationAddress(),
00107          sourceAddress(),
00108          pendingOutResponses() {}
00109          
00110       PendingRequest( const DtInetAddrAndPort& src, const DtInetAddrAndPort& dest,
00111                       const DtRouteMap::DtAddressPortList& expectedOutResponses ) :
00112          currentCount( 0 ),
00113          destinationAddress( dest ),
00114          sourceAddress( src ),
00115          pendingOutResponses( expectedOutResponses ) {}
00116          
00117       unsigned int                  currentCount;
00118       DtInetAddrAndPort             destinationAddress;
00119       DtInetAddrAndPort             sourceAddress;
00120       DtRouteMap::DtAddressPortList pendingOutResponses;
00121    };
00122 
00123    typedef std::map< DtInetAddrAndPort, PendingRequest > DtDestToRequestMap;
00124    
00125 protected:
00126 
00127    DtBoost::shared_ptr<DtForwarderNode> myParent;
00128    DtFederateCounterFilter* myMsgToOutFilter;
00129 
00131    DtDestToRequestMap       myPendingRequests;
00132    
00133 };
00134 
00135 #endif //! DtFederateCounterProcessor_H_
00136 

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)