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

DDSChildServer.h

Go to the documentation of this file.
00001 #ifndef DDSCHILDSERVER_H
00002 #define DDSCHILDSERVER_H
00003 
00005 //                                                                          //
00006 // DDSChildServer                                                           //
00007 //                                                                          //
00008 // Package: DDS (Data Dispatcher System).                                   //
00009 //                                                                          //
00010 // S. Kasahara 5/2001                                                       //
00011 // Based in part on ideas from the LHCb OTT online monitoring system.       //
00012 //                                                                          //
00014 #include <iosfwd> // ostream forward decl.
00015 #ifndef __CINT__
00016 #include <sys/types.h>  // defines pid_t type
00017 #endif
00018 #include "TInetAddress.h"
00019 #include "TMessage.h"
00020 #include "Persistency/PerInputStreamManager.h"
00021 
00022 #include "Dispatcher/DDS.h"
00023 
00024 class TSocket;
00025 class MomNavigator;
00026 class DDSChildServer;
00027 class DDSSubscription;
00028 class DDSFileHandler;
00029 
00030 std::ostream& operator << (std::ostream& ms, DDSChildServer* cs);
00031 
00032 class DDSChildServer {
00033 
00034 public:
00035   // Typedefs and enumerations.
00036 
00037   // Constructor and destructor.
00038   DDSChildServer (Int_t sockfd, Int_t maxinactive);   
00039   virtual ~DDSChildServer ();       
00040 
00041   // State testing member functions.
00042   bool IsValid () const { return (fTSocket != (TSocket*)0) ? true : false; }
00043   std::ostream& Print(std::ostream& ms) const;
00044 
00045   // State changing member functions.
00046   Int_t Run();                      
00047 
00048 private:
00049 
00050   // Private member functions.
00051   void Get();       // load current entry from stream manager
00052   void GoToFile();  // advance to user-specified file
00053   bool IsClientConnected() const;  // status of client-server socket connection
00054   void Next();      // send next entry satisfying subscription
00055   void Shutdown();  // shutdown the child server
00056   void Subscribe(); // receive and process new subscription 
00057 
00058   // Data members.
00059   TSocket*  fTSocket;          // pointer to connected socket
00060   DDSSubscription* fSubscription; // client subscription
00061   DDSFileHandler* fFileHandler; // pointer to file handler
00062   bool      fShutdown;         // if true child server will be shutdown  
00063   int       fPid;              // process id of this child 
00064   // while properly this should be of type "pid_t" (defined in <sys/types.h>)
00065   // this value is set by gSystem->GetPid() which returns an "int" 
00066   // and ROOTCINT can't handle pid_t on IRIX6.5 with current compiler flags
00067   MomNavigator *fMom;          // pointer to container for retrieved objects
00068   TMessage* fMessageIn;        // message buffer for received message objects
00069   TMessage  fMessageOut;       // message buffer for outgoing objects
00070   PerInputStreamManager fInputStreamManager; // manager for input streams 
00071   TInetAddress fServerAddress; // child server internet address
00072   TInetAddress fClientAddress; // client internet address
00073   Int_t     fMaxInactive;  // limit of client inactivity,def is 21600 sec    
00074   ClassDef(DDSChildServer,0)  // MINOS Data Dispatcher System Child Server
00075 
00076 };
00077 
00078 #endif                                    // DDSCHILDSERVER_H
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 

Generated on Mon Feb 15 11:06:36 2010 for loon by  doxygen 1.3.9.1