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

bulkDataNTDDSLoggable.h

Go to the documentation of this file.
00001 #ifndef BULKDATA_NT_DDS_LOGGABLE
00002 #define BULKDATA_NT_DDS_LOGGABLE
00003 
00004 /*******************************************************************************
00005 * ALMA - Atacama Large Millimiter Array
00006 * (c) European Southern Observatory, 2011
00007 *
00008 * This library is free software; you can redistribute it and/or
00009 * modify it under the terms of the GNU Lesser General Public
00010 * License as published by the Free Software Foundation; either
00011 * version 2.1 of the License, or (at your option) any later version.
00012 *
00013 * This library is distributed in the hope that it will be useful,
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 * Lesser General Public License for more details.
00017 *
00018 * You should have received a copy of the GNU Lesser General Public
00019 * License along with this library; if not, write to the Free Software
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00021 *
00022 * "@(#) $Id: bulkDataNTDDSLoggable.h,v 1.4 2012/04/25 12:28:53 bjeram Exp $"
00023 *
00024 * who       when      what
00025 * --------  --------  ----------------------------------------------
00026 * bjeram  2011-04-19  created
00027 */
00028 
00029 
00030 #include <loggingLoggable.h>
00031 #include <logging.h>
00032 
00033 #define BDNT_LISTENER_USER_ERR(call)                                                                            \
00034     try { call;                                                                                                                                         \
00035     }catch(const ACSErr::ACSbaseExImpl &ex){                                                                            \
00036         UserCallbackErrorCompletion ucb(ex, __FILE__, __LINE__, __FUNCTION__);          \
00037         ucb.setCall("#call");                                                                                                           \
00038         ucb.setStreamFlowName(topicName_m.c_str());                                                                     \
00039         callback_mp->onError(ucb);                                                                                                      \
00040     }catch(const std::exception &stdex){                                                                                        \
00041         ACSErrTypeCommon::StdExceptionExImpl ex(__FILE__, __LINE__, __FUNCTION__);  \
00042         ex.setWhat(stdex.what());                                                                                                       \
00043         UserCallbackErrorCompletion ucb(ex, __FILE__, __LINE__, __FUNCTION__);          \
00044         ucb.setCall("#call");                                                                                                           \
00045         ucb.setStreamFlowName(topicName_m.c_str());                                                                     \
00046         callback_mp->onError(ucb);                                                                                                      \
00047     }catch(...){                                                                                                                                        \
00048         ACSErrTypeCommon::UnknownExImpl ex(__FILE__, __LINE__, __FUNCTION__);           \
00049         UserCallbackErrorCompletion ucb(ex, __FILE__, __LINE__, __FUNCTION__);          \
00050         ucb.setCall("#call");                                                                                                           \
00051         ucb.setStreamFlowName(topicName_m.c_str());                                                                     \
00052         callback_mp->onError(ucb);                                                                                                      \
00053     }
00054 
00055 
00063 class BulkDataNTDDSLoggable
00064   : public Logging::Loggable
00065 {
00066 public:
00067   //Constructor
00068           BulkDataNTDDSLoggable (const std::string &loggerName) :       Logging::Loggable(loggerName){}
00069 
00070   //destructor
00071   virtual ~BulkDataNTDDSLoggable ();
00072 
00075   void initalizeLogging();
00076 
00078  virtual Logging::Logger::LoggerSmartPtr getLogger ();
00079 
00080   static LoggingProxy *logger_mp; //we need separate logger, because we are in separate thread  ...
00081   // ... other is one logger for all DDS reader thread
00082   static unsigned int loggerInitCount_m; // we need to count how many time we call LoggerProxy::init
00083 };
00084 
00085 #endif //BULKDATA_NT_DDS_LOGGABLE

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