• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

bulkDataNTSenderFlow.h

Go to the documentation of this file.
00001 #ifndef _BULK_DATA_NT_SENDER_FLOW_H_
00002 #define _BULK_DATA_NT_SENDER_FLOW_H_
00003 /*******************************************************************************
00004 * ALMA - Atacama Large Millimiter Array
00005 * (c) European Southern Observatory, 2011
00006 *
00007 * This library is free software; you can redistribute it and/or
00008 * modify it under the terms of the GNU Lesser General Public
00009 * License as published by the Free Software Foundation; either
00010 * version 2.1 of the License, or (at your option) any later version.
00011 *
00012 * This library is distributed in the hope that it will be useful,
00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 * Lesser General Public License for more details.
00016 *
00017 * You should have received a copy of the GNU Lesser General Public
00018 * License along with this library; if not, write to the Free Software
00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020 *
00021 * "@(#) $Id: bulkDataNTSenderFlow.h,v 1.22 2013/01/08 11:39:40 bjeram Exp $"
00022 *
00023 * who       when      what
00024 * --------  --------  ----------------------------------------------
00025 * bjeram  2011-04-19  created
00026 */
00027 
00028 #ifndef __cplusplus
00029 #error This is a C++ include file and cannot be used from plain C
00030 #endif
00031 
00032 #include "bulkDataNTFlow.h"
00033 #include "bulkDataNTDDSPublisher.h"
00034 #include "bulkDataNTSenderStream.h"
00035 #include "bulkDataNTSenderFlowCallback.h"
00036 #include "bulkDataNTWriterListener.h"
00037 
00038 
00039 namespace AcsBulkdata
00040 {
00041 
00042 class BulkDataNTSenderStream;
00043 
00044 class BulkDataNTSenderFlow : public BulkDataNTFlow
00045 {
00046 public:
00047 
00056         BulkDataNTSenderFlow(BulkDataNTSenderStream *senderStream,
00057                                                 const char* flowName,
00058                                                 const SenderFlowConfiguration &sndCfg,
00059                                                 BulkDataNTSenderFlowCallback *cb,
00060                                                 bool releaseCB );
00061 
00065         virtual ~BulkDataNTSenderFlow();
00066 
00067 
00072         unsigned int getNumberOfReceivers();
00073 
00085         void startSend(ACE_Message_Block *param = 0);
00086 
00093         void startSend(const unsigned char *param, size_t len);
00094 
00101         void sendData(const unsigned char *buffer, size_t len);
00102 
00107         void stopSend();
00108 
00119         void dumpStatistics(ACE_Log_Priority level=LM_DEBUG);
00120 
00121 protected:
00122 
00123         typedef enum {StartState, DataRcvState, StopState, IgnoreDataState } SenderFlowStates;
00124         SenderFlowStates currentState_m; 
00125         static const char* state2String[]; 
00126 
00127         AcsBulkdata::BulkDataNTSenderStream *senderStream_m; 
00128 
00129         SenderFlowConfiguration senderFlowCfg_m; 
00130 
00131         BulkDataNTSenderFlowCallback *callback_m; 
00132         bool releaseCB_m; 
00133 
00134         AcsBulkdata::BulkDataNTDDSPublisher *ddsPublisher_m;  
00135         DDS::Topic *ddsTopic_m;  
00136         BulkDataNTWriterListener *writerReaderListener_m;  
00137         ACSBulkData::BulkDataNTFrameDataWriter *ddsDataWriter_m;  
00138 
00139         DDS::Duration_t ackTimeout_m;  
00140         void setACKsTimeout(double ACKsTimeout);  
00141 
00142         double throttling_m;
00143         double throttlingMinFrameTime_m; 
00144         void setThrottling(double throttling); 
00145 
00146         // should it go to upper class Publisher ?
00157         void writeFrame(ACSBulkData::DataType dataType,  const unsigned char *param=0, size_t len=0, unsigned int restFrameCount=0, bool waitForACKs=false);
00158 
00160         ACSBulkData::BulkDataNTFrame *frame_m;
00161 
00163         BulkDataNTSenderFlow();
00165         void operator=(const BulkDataNTSenderFlow&);
00167         BulkDataNTSenderFlow(const BulkDataNTSenderFlow&);
00168 };//class BulkDataSenderFlow
00169 
00170 };
00171 
00172 
00173 #endif 

Generated on Mon May 4 2015 08:27:43 for ACS-2015.4 C++ API by  doxygen 1.7.0