MAK RTIspy API Documentation for HLA Evolved
smSocket__rti__.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2005 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: smSocket__rti__.h,v $ $Revision: 1.13 $ $State: Exp $
00007 *********************************************************************/
00008 #ifndef smSocket_H_
00009 #define smSocket_H_
00010 
00015 
00016 #include <vlutil/vlUtil.h>
00017 #include <vlutil/vlInetAddr.h>
00018 #include <udpMsgSocket.h>
00019 #include "vlShmSubscribableMessageQueue__rti__.h"
00020 
00021 #if DT_HAVE_STD_H
00022 #include <std.h>
00023 #endif
00024 
00025 #include <stdio.h>
00026 #include <sys/types.h>
00027 #include <vector>
00028 
00029 #ifdef DtUSE_UTILITIES_NAMESPACE
00030 namespace DtUSE_UTILITIES_NAMESPACE
00031 {
00032 #endif
00033 
00042 
00043 class DT_DLL_LRC DtSmSocket__rti__ : public DtUdpMsgSocket
00044 {
00045   public:
00046     DtSmSocket__rti__(const char * sharename, DtBoost::shared_ptr<DtMsgHeaderReader> hdrReader);
00047 
00048     virtual ~DtSmSocket__rti__();
00049 
00052     virtual bool initializeSmQueue(DtU32 id = DtSM_INVALID_SUBSCRIBER_ID,
00053                                    bool forceSubscribe = false);
00059     virtual bool initializeSmQueue(DtU32 numBuckets, DtU32 payloadSize,
00060                                    DtU32 id = DtSM_INVALID_SUBSCRIBER_ID,
00061                                    bool forceSubscribe = false);
00062 
00071     virtual int sendMessage(caddr_t msg, size_t msgSize, bool deleteAfterSend,
00072        const DtInetAddr& notUsed = DtInetAddr::inaddrAny());
00073 
00076     virtual bool flush();
00077 
00080     virtual void openSocket(const DtInetEndpoint& dest,
00081        DtU32 flags = DtDefaultSockOpts, DtU16 localPort = 0,
00082        DtInetDevice* hostIf = NULL);
00083     virtual void enableBundling(size_t maxBundleSize);
00084     virtual void disableBundling();
00085     virtual void enableCompression(DtU8 compressionLevel);
00086     virtual void disableCompression();
00087     virtual bool joinMulticastGroup( const DtInetAddr& grpAddr, 
00088        DtInetDevice* device = NULL );
00089     virtual bool joinMulticastGroup( const DtInetEndpoint& grpEndpoint, 
00090        DtInetDevice* device = NULL );
00091     virtual bool dropMulticastGroup( const DtInetAddr& grpAddr, 
00092        DtInetDevice* device = NULL );
00093     virtual bool dropMulticastGroup( const DtInetEndpoint& grpEndpoint, 
00094        DtInetDevice* device = NULL );
00095     virtual bool setMcastTtlOption( DtU32 ttl );
00096     virtual void setRetryOnSend(unsigned int numRetries, double waitPeriod);
00097 
00098     virtual DtSmSubscribableMessageQueue__rti__ * msgQueue() const;
00099     virtual bool isOpen() const;
00100 
00103     virtual int   subscribe(DtU32 id = DtSM_INVALID_SUBSCRIBER_ID);
00104     virtual void  unsubscribe(DtU32 id);
00105 
00109     virtual bool  shutdownQueue(bool ruthless = false);
00110     virtual int   subscriberCount() const;
00111     
00112   protected:
00113 
00115     virtual int recv(caddr_t *buffptr, DtInetEndpoint* ep);
00116 
00117     MAKRti::DtString                      mySharedMemName;
00118     DtSmSubscribableMessageQueue__rti__ * mySmMsgQueue;
00119 
00120   protected:
00122     DtSmSocket__rti__(const DtSmSocket__rti__ &);
00123 
00125     DtSmSocket__rti__ &operator=(const DtSmSocket__rti__ &);
00126 
00127 };
00128 
00129 #ifdef DtUSE_UTILITIES_NAMESPACE
00130 } 
00131 #endif
00132 
00133 #endif //! smSocket_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)