Go to the documentation of this file.00001 #ifndef archive_event_supplier_H
00002 #define archive_event_supplier_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __cplusplus
00031 #error This is a C++ include file and cannot be used from plain C
00032 #endif
00033
00038 #include <lokiSingleton.h>
00039 #include <baciC.h>
00040
00041 #include <basencSupplier.h>
00042 #include <ACSErrTypeCORBA.h>
00043 #include <acsncErrType.h>
00044 #include <archiveeventsExport.h>
00045
00054 class ArchiveSupplier : public BaseSupplier
00055 {
00056 public:
00060 ArchiveSupplier();
00061
00065 virtual ~ArchiveSupplier();
00066
00081 template <class T>
00082 void
00083 sendEvent(CORBA::Short priority,
00084 ACS::Time timeStamp,
00085 const std::string& component,
00086 const std::string& property,
00087 T value,
00088 const std::string& container="")
00089 {
00090 CORBA::Any any;
00091 any <<= value;
00092
00093 try{
00094 this->send_event(priority,
00095 timeStamp,
00096 component,
00097 property,
00098 any,
00099 container);
00100 }
00101 catch(ACSErrTypeCORBA::CORBAReferenceNilExImpl& ex1)
00102 {
00103 acsncErrType::PublishEventFailureExImpl
00104 ex2 (__FILE__, __LINE__, "ArchiveSupplier::send_event");
00105 ex2.setEventName("archiving_event");
00106 ex2.setChannelName(channelName_mp);
00107 throw ex2;
00108 }
00109 catch(ACSErrTypeCORBA::NarrowFailedExImpl& ex1)
00110 {
00111 acsncErrType::PublishEventFailureExImpl
00112 ex2 (__FILE__, __LINE__, "ArchiveSupplier::send_event");
00113 ex2.setEventName("archiving_event");
00114 ex2.setChannelName(channelName_mp);
00115 throw ex2;
00116 }
00117 catch(ACSErrTypeCORBA::FailedToResolveServiceExImpl& ex1)
00118 {
00119 acsncErrType::PublishEventFailureExImpl
00120 ex2 (__FILE__, __LINE__, "ArchiveSupplier::send_event");
00121 ex2.setEventName("archiving_event");
00122 ex2.setChannelName(channelName_mp);
00123 throw ex2;
00124 }
00125 }
00126
00141 void
00142 send_event(CORBA::Short priority,
00143 ACS::Time timeStamp,
00144 const std::string& component,
00145 const std::string& property,
00146 CORBA::Any value,
00147 const std::string& container);
00148
00149 protected:
00150
00154 virtual const char*
00155 getNotificationFactoryName()
00156 {return acscommon::ARCHIVE_NOTIFICATION_FACTORY_NAME;}
00157
00161 virtual const char*
00162 getEventType()
00163 { return ""; }
00164
00165 };
00166
00171 #ifdef __CYGWIN__
00172 template class ARCHIVEEVENTS_Export Loki::SingletonHolder<ArchiveSupplier,
00173 Loki::CreateUsingNew,
00174 Loki::PhoenixSingleton,
00175 Loki::SingleThreaded>;
00176 #endif
00177 typedef Loki::SingletonHolder<ArchiveSupplier,
00178 Loki::CreateUsingNew,
00179 Loki::PhoenixSingleton,
00180 Loki::SingleThreaded> ArchiveSupplierSingleton;
00181
00182 #endif