MAK RTIspy API Documentation for HLA 1.3
multicastDiscoveryMgr.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2005 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: multicastDiscoveryMgr.h,v $ $Revision: 1.13 $ $State: Exp $
00007 *********************************************************************/
00010 
00011 #ifndef DtMulitcastDiscoveryMgr_H_
00012 #define DtMulitcastDiscoveryMgr_H_
00013 
00014 #include "multicastDiscoveryMsg.h"
00015 #include "rtiMsConfig.h"
00016 #include <vlutil/vlUtil.h>
00017 #include <vlutil/vlTime.h>
00018 #include <vlutil/vlInetAddr.h>
00019 #include <utility>
00020 
00021 class DtRIDParameters;
00022 class DtUdpMsgSocket;
00023 
00033 class DT_DLL_LRC DtMulitcastDiscoveryMgr
00034 {
00035 private:
00037    DtMulitcastDiscoveryMgr();
00038 
00039 public:
00041    typedef std::pair< MAKRti::DtInetAddr, unsigned int > DtMcastResponderId;
00042 
00043 
00045    DtMulitcastDiscoveryMgr( const DtRIDParameters* params,
00046                             DtMulticastDiscoveryMsg::DtDiscoveryTarget targetType,
00047                             bool isResponder = false,
00048                             bool allowMultipleResponders = false );
00050    virtual ~DtMulitcastDiscoveryMgr();
00051 
00053    virtual bool init();
00054 
00057    virtual DtMcastResponderId discover();
00058 
00060    virtual bool responderAlreadyExists();
00061 
00064    virtual bool tick(float timeToWait);
00065 
00066    virtual inline MAKRti::DtInetAddr hostAddr() const;
00067 
00068 protected:
00069 
00070 
00072    virtual DtMcastResponderId requestAddress(float timeToWait);
00073 
00074 protected:
00075 
00076    bool                   myIsResponder;
00077    bool                   myAllowMultipleResponders;
00078    DtMulticastDiscoveryMsg::DtDiscoveryTarget myDiscoveryTargetType;
00079    const DtRIDParameters* myParams;
00080    MAKRti::DtClock        myClock;
00081    DtUdpMsgSocket*        mySocket;
00082 
00084    DtMcastResponderId     myMcastResponderId;
00085 
00087    DtMcastResponderId     myHostId;
00088 
00089 };
00090 
00091 inline MAKRti::DtInetAddr DtMulitcastDiscoveryMgr::hostAddr() const
00092 {
00093    return myHostId.first;
00094 }
00095 
00096 #endif //! DtMulitcastDiscoveryMgr_H_
00097 

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)