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

bdNTMasterImplTest.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * ALMA - Atacama Large Millimiter Array
00003 * (c) European Southern Observatory, 2011
00004 *
00005 * This library is free software; you can redistribute it and/or
00006 * modify it under the terms of the GNU Lesser General Public
00007 * License as published by the Free Software Foundation; either
00008 * version 2.1 of the License, or (at your option) any later version.
00009 *
00010 * This library is distributed in the hope that it will be useful,
00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 * Lesser General Public License for more details.
00014 *
00015 * You should have received a copy of the GNU Lesser General Public
00016 * License along with this library; if not, write to the Free Software
00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00018 *
00019 * "@(#) $Id: bdNTReceiverImplTest.cpp,v 1.7 2012/07/11 08:46:26 bjeram Exp $"
00020 *
00021 * who       when      what
00022 * --------  --------  ----------------------------------------------
00023 * bjeram  2011-04-19  created
00024 */
00025 #include "bulkDataNTReceiverImpl.h"
00026 #include "bulkDataNTCallback.h"
00027 #include <iostream>
00028 
00029 class  TestCB:  public BulkDataNTCallback
00030 {
00031 public:
00032         int cbStart(unsigned char* userParam_p, unsigned  int size)
00033         {
00034                 ACS_SHORT_LOG((LM_INFO, "=>cbStart[%s/%s]: got %d: %s", recvName_m.c_str(), flowName_m.c_str(), size, userParam_p));
00035                 //std::cout << "=>cbStart[" << recvName_m << "/" << flowName_m << "]: got " << size << " :";
00036 
00037                 return 0;
00038         }
00039 
00040         int cbReceive(unsigned char* userParam_p, unsigned  int size)
00041         {
00042                 //std::cout << "=>cbReceive[" << recvName_m << "/" << flowName_m << "]: got " << size << " :";
00043                 ACS_SHORT_LOG((LM_INFO, "=>cbStart[%s/%s]: got %d.", recvName_m.c_str(), flowName_m.c_str(), size));
00044 
00045                  return 0;
00046         }
00047 
00048         int cbStop()
00049         {
00050                 //std::cout << "=>cbStop[" << recvName_m << "/" << flowName_m << "]" << std::endl;
00051                 ACS_SHORT_LOG((LM_INFO, "=>cbStop[%s/%s]", recvName_m.c_str(), flowName_m.c_str()));
00052                 return 0;
00053         }
00054 
00055 };
00056 
00057 
00058 class BulkDataNTMasterImpl : public BulkDataNTReceiverImpl<TestCB>
00059 {
00060   public:
00061 
00062         BulkDataNTMasterImpl(const ACE_CString& name,maci::ContainerServices* containerServices);
00063 
00064     virtual ~BulkDataNTMasterImpl();
00065 
00066     virtual void initialize();
00067 
00068     virtual void cleanUp();
00069 
00070     virtual void openReceiver();
00071     virtual void closeReceiver();
00072   protected:
00073     // we have two parsers: one for sender and one for receiver. It might be enough just one, but we need to mix Sender and REceiver in XML
00074     AcsBulkdata::BulkDataConfigurationParser *sndCfgParser_m;
00075     AcsBulkdata::BulkDataConfigurationParser *rcvCfgParser_m;
00076 
00077     ReceiverStreamConfiguration*  rcvStrCfg_m;
00078     ReceiverFlowConfiguration *rcvFlowCfg_m;
00079     SenderStreamConfiguration*  sndStrCfg_m;
00080     SenderFlowConfiguration *sndFlowCfg_m;
00081 
00082     AcsBulkdata::BulkDataNTReceiverStream<TestCB> *rcvStream1_m, *rcvStream2_m;
00083     BulkDataNTReceiverFlow *rcvFlow1_m, *rcvFlow2_m;
00084 
00085     AcsBulkdata::BulkDataNTSenderStream *sndStream1_m, *sndStream2_m;
00086     BulkDataNTSenderFlow *sndFlow1_m, *sndFlow2_m;
00087 };//BulkDataNTMasterImpl

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