00001 #ifndef _BULKDATANT_RECEIVER_IMPL_H 00002 #define _BULKDATANT_RECEIVER_IMPL_H 00003 /******************************************************************************* 00004 * ALMA - Atacama Large Millimiter Array 00005 * (c) European Southern Observatory, 2002 00006 * Copyright by ESO (in the framework of the ALMA collaboration) 00007 * and Cosylab 2002, All rights reserved 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2.1 of the License, or (at your option) any later version. 00013 * 00014 * This library is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this library; if not, write to the Free Software 00021 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 * 00023 * 00024 * "@(#)" 00025 * 00026 * who when what 00027 * -------- -------- ---------------------------------------------- 00028 * oat 30/03/04 created 00029 */ 00030 00031 /************************************************************************ 00032 * 00033 *---------------------------------------------------------------------- 00034 */ 00035 00036 #ifndef __cplusplus 00037 #error This is a C++ include file and cannot be used from plain C 00038 #endif 00039 00040 #include <baci.h> 00041 #include <baciCharacteristicComponentImpl.h> 00042 #include <maciHelper.h> 00043 #include <maciContainerServices.h> 00044 00045 #include "ACSBulkDataStatus.h" 00046 00047 #include "bulkDataReceiverS.h" 00048 00049 #include "bulkDataNTConfigurationParser.h" 00050 #include "bulkDataNTReceiverStream.h" 00051 00052 00075 template<class TCallback> 00076 class BulkDataNTReceiverImpl : public baci::CharacteristicComponentImpl, 00077 public virtual POA_bulkdata::BulkDataReceiver 00078 { 00079 public: 00080 00086 BulkDataNTReceiverImpl(const ACE_CString& name,maci::ContainerServices* containerServices); 00087 00091 virtual ~BulkDataNTReceiverImpl(); 00092 00093 virtual void initialize(); 00094 00095 virtual void cleanUp(); 00096 00097 AcsBulkdata::BulkDataNTReceiverStream<TCallback> * getReceiverStream(const char *streamName); 00098 00110 virtual void openReceiver() ; 00111 00112 virtual void openReceiverStream(const char *stream_name); 00113 00117 bulkdata::BulkDataReceiverConfig * getReceiverConfig(); 00118 00122 virtual void closeReceiver(); 00123 00124 virtual void closeReceiverStream(const char *stream_name); 00125 00130 // stream + flow name 00131 virtual ACSErr::Completion *getCbStatus(CORBA::ULong flowNumber){ printf("getCbStatus not implemnted yet. \n"); return 0;} 00132 00137 // stream + flow name 00138 virtual void setTimeout(CORBA::ULong flowNumber, CORBA::ULong timeout){} 00139 00143 //get rid of 00144 virtual void setRecvName(const char *recvName); 00145 00149 virtual void subscribeNotification(ACS::CBvoid_ptr notifCb){} 00150 00159 void fwdData2UserCB(CORBA::Boolean enable){} 00160 00161 protected: 00162 00163 00164 private: 00165 00166 // map<name, stream> 00167 typedef std::map<std::string, AcsBulkdata::BulkDataNTReceiverStream<TCallback> *> StreamMap; 00168 00169 // Map that stores the actualy stream objects that are actually created 00170 StreamMap receiverStreams_m; 00171 00172 // Map that stores the configuration read from the CDB 00173 std::map<std::string, BulkDataConfigurationParser::ReceiverCfg> recvConfigMap_m; 00174 00175 maci::ContainerServices *containerServices_p; 00176 00177 AcsBulkdata::BulkDataNTReceiverStream<TCallback>* createReceiverStream(const char *stream_name, std::map<std::string, BulkDataConfigurationParser::ReceiverCfg>::iterator &it); 00178 00179 void closeStream(typename StreamMap::iterator &it); 00180 }; 00181 00182 #include "bulkDataNTReceiverImpl.i" 00183 00184 #endif