00001 #ifndef FWCore_MessageService_ELsender_h 00002 #define FWCore_MessageService_ELsender_h 00003 00004 // ---------------------------------------------------------------------- 00005 // 00006 // ELsender is a pure virtual (abstract) class to hold the object 00007 // telling how a message is transported from the client to the 00008 // server. That is, an ELcollected destination constructed 00009 // from ELcollected ( const ELsender & mySender ) will call 00010 // mysender.send(nbytes,data). 00011 // 00012 // The user-defined transport mechanism (at the client end and 00013 // in the server process) must be responsible receiving that data 00014 // and calling ELrecv(nbytes, data) or doing errlog(nbytes,data). 00015 // 00016 // A closely related global method is ELsend, defined in 00017 // ELcollected.h. That is used for ELcollecteds which were 00018 // not instatiated with an ELsender supplied. 00019 // 00020 // Usage: 00021 // 00022 // class MySender : public ELsender { 00023 // public: 00024 // void send (int nbytes, const char * data) { 00025 // // ... code that moves the nbytes of data to the server 00026 // } 00027 // }; 00028 // 00029 // // MySender could be more complex if necessary. For example it could be 00030 // // constructed with some sort of address specifying where the server is. 00031 // 00032 // MySender ms; 00033 // ELcollected remoteLog (ms); 00034 // 00035 // 3/16/00 mf FIle created. 00036 // 8/30/02 web Add virtual destructor; fix comment on code guard #endif 00037 // 00038 // ---------------------------------------------------------------------- 00039 00040 namespace edm { 00041 namespace service { 00042 00043 // ---------------------------------------------------------------------- 00044 // ELsender: 00045 // ---------------------------------------------------------------------- 00046 00047 class ELsender { 00048 00049 public: 00050 00051 // ----- Destructor: 00052 00053 virtual ~ELsender() {} 00054 00055 00056 // ----- Transmit a message to a server: 00057 00058 virtual void send (int nbytes, const char * data) = 0; 00059 00060 // ----- Capture of copy of this object: 00061 // This is here to avoid any chance of tough-to-decipher 00062 // misbehavior due to a user providing the sender but letting 00063 // it go out of scope before it is used. 00064 00065 virtual ELsender * clone() const = 0; 00066 00067 }; // ELsender 00068 00069 00070 } // end of namespace service 00071 } // end of namespace edm 00072 00073 00074 #endif // FWCore_MessageService_ELsender_h