CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ELsender.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageService_ELsender_h
2 #define FWCore_MessageService_ELsender_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // ELsender is a pure virtual (abstract) class to hold the object
7 // telling how a message is transported from the client to the
8 // server. That is, an ELcollected destination constructed
9 // from ELcollected ( const ELsender & mySender ) will call
10 // mysender.send(nbytes,data).
11 //
12 // The user-defined transport mechanism (at the client end and
13 // in the server process) must be responsible receiving that data
14 // and calling ELrecv(nbytes, data) or doing errlog(nbytes,data).
15 //
16 // A closely related global method is ELsend, defined in
17 // ELcollected.h. That is used for ELcollecteds which were
18 // not instatiated with an ELsender supplied.
19 //
20 // Usage:
21 //
22 // class MySender : public ELsender {
23 // public:
24 // void send (int nbytes, const char * data) {
25 // // ... code that moves the nbytes of data to the server
26 // }
27 // };
28 //
29 // // MySender could be more complex if necessary. For example it could be
30 // // constructed with some sort of address specifying where the server is.
31 //
32 // MySender ms;
33 // ELcollected remoteLog (ms);
34 //
35 // 3/16/00 mf FIle created.
36 // 8/30/02 web Add virtual destructor; fix comment on code guard #endif
37 //
38 // ----------------------------------------------------------------------
39 
40 namespace edm {
41 namespace service {
42 
43 // ----------------------------------------------------------------------
44 // ELsender:
45 // ----------------------------------------------------------------------
46 
47 class ELsender {
48 
49 public:
50 
51  // ----- Destructor:
52 
53  virtual ~ELsender() {}
54 
55 
56  // ----- Transmit a message to a server:
57 
58  virtual void send (int nbytes, const char * data) = 0;
59 
60  // ----- Capture of copy of this object:
61  // This is here to avoid any chance of tough-to-decipher
62  // misbehavior due to a user providing the sender but letting
63  // it go out of scope before it is used.
64 
65  virtual ELsender * clone() const = 0;
66 
67 }; // ELsender
68 
69 
70 } // end of namespace service
71 } // end of namespace edm
72 
73 
74 #endif // FWCore_MessageService_ELsender_h
virtual void send(int nbytes, const char *data)=0
virtual ELsender * clone() const =0
virtual ~ELsender()
Definition: ELsender.h:53
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82