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

acsncArchiveConsumer.h

Go to the documentation of this file.
00001 #ifndef acsnc_archive_consumer_H
00002 #define acsnc_archive_consumer_H
00003 /*******************************************************************************
00004 * ALMA - Atacama Large Millimiter Array
00005 * (c) UNSPECIFIED - FILL IN, 2005 
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: acsncArchiveConsumer.h,v 1.11 2009/08/07 19:57:38 javarias Exp $"
00022 *
00023 * who       when      what
00024 * --------  --------  ----------------------------------------------
00025 * dfugate  2005-04-12  created
00026 */
00027 
00028 /************************************************************************
00029  *
00030  *----------------------------------------------------------------------
00031  */
00032 
00033 #ifndef __cplusplus
00034 #error This is a C++ include file and cannot be used from plain C
00035 #endif
00036 
00037 #include "acsncConsumer.h"
00038 #include <string>
00039 
00040 #include <lokiSmartPtr.h>
00041 #include <loggingBaseLog.h>
00042 
00043 namespace nc {
00044     //------------------------------------------------------------------
00045     class ArchiveConsumer : public Consumer
00046     {
00047       public:
00048         
00053         class ArchiveHandler {
00054             
00055           public:
00056             
00057             virtual void
00058             receive(ACS::Time          timeStamp, 
00059                     const std::string& device,
00060                     const std::string& parameter,
00061                     const CORBA::Any& value) = 0;
00062 
00063             virtual ~ArchiveHandler(){}
00064         };
00065         
00067         typedef Loki::SmartPtr<ArchiveHandler, 
00068                                Logging::RefCounted, 
00069                                Loki::AllowConversion,
00070                                Loki::NoCheck,
00071                                Loki::DefaultSPStorage> ArchiveHandlerSmartPtr;
00072         
00073         
00074         //--------------------------------------------------------------
00084         ArchiveConsumer(ArchiveHandlerSmartPtr handler);
00085         
00094         ArchiveConsumer(CORBA::ORB_ptr orb_p,
00095                         ArchiveHandlerSmartPtr handler);
00096         
00119         ArchiveConsumer(int argc, 
00120                         char *argv[],
00121                         ArchiveHandlerSmartPtr handler);
00133         virtual void 
00134         push_structured_event(const CosNotification::StructuredEvent &publishedEvent);
00135         
00136       protected:
00137         //--------------------------------------------------------------
00145         const char* 
00146         getChannelKind();
00147         
00155         const char*
00156         getChannelDomain();
00157 
00158 
00164         const char*
00165         getNotificationFactoryName()
00166             {return acscommon::ARCHIVE_NOTIFICATION_FACTORY_NAME;}
00167 
00168       private:
00169         //--------------------------------------------------------------
00178         void 
00179         subscribeAllEvents();
00180 
00184         ArchiveHandlerSmartPtr handler_m;
00185     };
00186     //------------------------------------------------------------------
00187 };
00188 
00189 
00190 
00191 #endif 

Generated on Thu Jan 12 2012 23:13:50 for ACS-10.0 C++ API by  doxygen 1.7.0