MAK RTIspy API Documentation for HLA 1516
rtiSmSocket.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2005 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: rtiSmSocket.h,v $ $Revision: 1.8 $ $State: Exp $
00007 *********************************************************************/
00008 #ifndef rtiSmSocket_H_
00009 #define rtiSmSocket_H_
00010 
00015 
00016 #include <smSocket__rti__.h>
00017 #include "smSubscribableMessageQueue.h"
00018 
00027 
00028 class DT_DLL_LRC DtRtiSmSocket : public DtSmSocket__rti__
00029 {
00030 public:
00031    DtRtiSmSocket(const char * sharename, DtBoost::shared_ptr<DtMsgHeaderReader> hdrReader);
00032 
00033    virtual ~DtRtiSmSocket();
00034 
00038     virtual bool initializeSmQueue(DtU32 id = DtSM_INVALID_SUBSCRIBER_ID,
00039                                    bool forceSubscribe = false);
00045     virtual bool initializeSmQueue(DtU32 numBuckets, DtU32 payloadSize,
00046                                    bool reliableQueue,
00047                                    DtU32 id = DtSM_INVALID_SUBSCRIBER_ID,
00048                                    bool forceSubscribe = false);
00049 
00052     virtual int sendMessage(caddr_t msg, size_t msgSize, bool deleteAfterSend,
00053        unsigned int flags, const DtInetAddr& destAddr = DtInetAddr::inaddrAny());
00054 
00057    virtual bool flush();
00058 
00062    virtual int getMsgTransportInfo(DtInetAddr *addr, DtU32 *transAndPriority);
00063 
00065    virtual DtSmSubscribableMessageQueue__rti__ * msgQueue() const;
00066 
00068    virtual bool queueIsReliable() const;
00069 
00074 
00077    virtual int waitForMessages(MAKRti::DtTime waitTime = 0.0);
00078 
00081    virtual int waitUntilFull(MAKRti::DtTime waitTime = 0.0);
00082 
00086    virtual void setReceiveMask( DtU32 rcvMask );
00087 
00092    virtual void setAnonFilter( bool onOrOff );
00093 
00095    virtual DtInetSockState state() const;
00096 
00097 protected:
00098    
00099    MAKRti::DtString                mySharedMemName;
00100    DtRtiSubscribableMessageQueue * myRtiSmMsgQueue;
00101    DtU32                           myRecvMask;
00102    bool                            myAnonFilterEnabled;
00103 
00105    class DtRtiSmSocketBundleBuff;
00106    friend class DtRtiSmSocketBundleBuff;
00107    typedef std::vector<char> Buffer;
00108    
00109    class DtRtiSmSocketBundleBuff
00110    {
00111    public:
00112       DtRtiSmSocketBundleBuff() {};
00113       ~DtRtiSmSocketBundleBuff() {};
00114       unsigned int     bbFlags;
00115       Buffer bbBuff;
00116    };
00117 
00118    
00119    typedef std::map< MAKRti::DtInetAddr, DtRtiSmSocketBundleBuff > RtiBufferMap;
00120    RtiBufferMap myRtiBufferMap;
00121 
00123    DtInetSockState myState;
00124 
00125 protected:
00127    DtRtiSmSocket(const DtRtiSmSocket &);
00128 
00130    DtRtiSmSocket &operator=(const DtRtiSmSocket &);
00131 
00132    virtual int recv(caddr_t *buffptr, DtInetEndpoint* ep);
00133 
00134    virtual bool filterAnonMsgs( caddr_t buffptr, DtU32 msgSenderId );
00135 
00136 };
00137 
00138 #endif //! rtiSmSocket_H_

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)