Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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.9 2008/10/09 07:57:41 cparedes 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 00065 typedef Loki::SmartPtr<ArchiveHandler, 00066 Logging::RefCounted, 00067 Loki::AllowConversion, 00068 Loki::NoCheck, 00069 Loki::DefaultSPStorage> ArchiveHandlerSmartPtr; 00070 00071 00072 //-------------------------------------------------------------- 00082 ArchiveConsumer(ArchiveHandlerSmartPtr handler); 00083 00092 ArchiveConsumer(CORBA::ORB_ptr orb_p, 00093 ArchiveHandlerSmartPtr handler); 00094 00117 ArchiveConsumer(int argc, 00118 char *argv[], 00119 ArchiveHandlerSmartPtr handler); 00131 virtual void 00132 push_structured_event(const CosNotification::StructuredEvent &publishedEvent); 00133 00134 protected: 00135 //-------------------------------------------------------------- 00143 const char* 00144 getChannelKind(); 00145 00153 const char* 00154 getChannelDomain(); 00155 00156 00162 const char* 00163 getNotificationFactoryName() 00164 {return acscommon::ARCHIVE_NOTIFICATION_FACTORY_NAME;} 00165 00166 private: 00167 //-------------------------------------------------------------- 00176 void 00177 subscribeAllEvents(); 00178 00182 ArchiveHandlerSmartPtr handler_m; 00183 }; 00184 //------------------------------------------------------------------ 00185 }; 00186 00187 00188 00189 #endif

Generated on Thu Apr 30 02:30:49 2009 for ACS C++ API by doxygen 1.3.8