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

DDSClient.h

Go to the documentation of this file.
00001 #ifndef DDSCLIENT_H
00002 #define DDSCLIENT_H
00003 
00005 //                                                                          //
00006 // DDSClient                                                                //
00007 //                                                                          //
00008 // Package: DDS (Data Dispatcher System).                                   //
00009 //                                                                          //
00010 // S. Kasahara 5/2001                                                       //
00011 // This class is the interface to be used by the client to receive          //
00012 // near-online data from the data dispatcher server.                        //
00013 //                                                                          //
00015 #include <iosfwd> // ostream forward decl
00016 #include "TInetAddress.h"
00017 #include "TMessage.h"
00018 #include "Dispatcher/DDS.h"
00019 
00020 class TSocket;
00021 class MomNavigator;
00022 class DDSClient;
00023 class DDSSubscription;
00024 class DDSClientId;
00025 class DDSPSStatus;
00026 
00027 std::ostream& operator << (std::ostream& ms, DDSClient* cs);
00028 
00029 class DDSClient {
00030 
00031 public:
00032   // Typedefs and enumerations.
00033 
00034   // Constructor and destructor.
00035   DDSClient (const char* serverhost, UInt_t serverport = 0, 
00036              DDS::EMessageType initmsg = DDS::kData,
00037              DDS::EClientType type = DDS::kUnknownClientType,
00038              std::string clientname = "");   
00039   virtual ~DDSClient ();       
00040 
00041   // State testing member functions.
00042   DDS::EMessageType GetStatus() const { return fStatus; }
00043   const DDSPSStatus* GetPSStatus() const { return fPSStatus; }
00044   const DDSClientId* GetClientId() const { return fClientId; }
00045   DDSSubscription* GetSubscription() const { return fSubscription; }
00046   bool IsValid () const { return (fTSocket != (TSocket*)0) ? true : false; }
00047   std::ostream& Print(std::ostream& ms) const;
00048 
00049   // State changing member functions
00050   DDS::EMessageType GoToFile(std::string filename, 
00051                              std::string& returnedfilename);
00052   DDS::EMessageType GoToNextFile(std::string& returnedfilename);
00053   DDS::EMessageType Next(MomNavigator*& mom,UInt_t waittime=120,UInt_t advanceby=1); // request next entry
00054   DDS::EMessageType Shutdown();     // shutdown the child server
00055   DDS::EMessageType Subscribe();    // submit subscription
00056 
00057 private:
00058 
00059   // Private member functions.
00060   DDS::EMessageType SendMessage();  //  Send new request to server
00061 
00062   // Data members.
00063   DDS::EMessageType fStatus; // status of connection with server
00064   TSocket*  fTSocket;    // pointer to connected socket
00065   DDSSubscription* fSubscription; // client's subscription
00066   TMessage* fMessageIn;  // message buffer for received message objects
00067   TMessage  fMessageOut; // message buffer for outgoing message objects
00068   TInetAddress fClientAddress;  // internet address of client
00069   TInetAddress fServerAddress;  // internet address of server
00070   DDSClientId* fClientId; // client id
00071   DDSPSStatus* fPSStatus; // ps status received in response to kStatus request
00072 
00073   ClassDef(DDSClient,0)  // MINOS Data Dispatcher System Client
00074 };
00075 
00076 #endif                                    // DDSCLIENT_H
00077 
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089 
00090 

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