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

IoDDSStreamItr.h

Go to the documentation of this file.
00001 
00002 // $Id: IoDDSStreamItr.h,v 1.13 2007/08/24 05:37:46 schubert Exp $
00003 //
00004 // IoDataStreamItr for data servered by the data dispatcher
00005 //
00006 // messier@huhepl.harvard.edu
00008 #ifndef IODDSSTREAMITR_H
00009 #define IODDSSTREAMITR_H
00010 #ifndef IODATASTREAMITR_H
00011 #include <string>
00012 using namespace std;
00013 
00014 #include "IoModules/IoDataStreamItr.h"
00015 #endif
00016 #ifndef DDS_H
00017 #include "Dispatcher/DDS.h"
00018 #endif
00019 
00020 class DDSClient;
00021 
00022 class IoDDSStreamItr : public IoDataStreamItr
00023 {
00024 public:
00025   IoDDSStreamItr(const char* server, unsigned int port = DDS::kPort,
00026                  unsigned int nretry = 0, unsigned int retrydelay = 1,
00027                  DDS::EClientType = DDS::kUnknownClientType,
00028                  string clientname = "");
00029   ~IoDDSStreamItr();
00030   
00031   // IoDataStreamItr interface required implementation
00032   bool        IsValid()   const { return ( fDDSClient ) ? true : false; }
00033   const char* GetFormat() const { return "dds"; }
00034   int  LoadRecords(MomNavigator* m);
00035   int  Increment(int n=1, MomNavigator* m=0);
00036   int  Decrement(int n=1, MomNavigator* m=0);
00037   JobCResult GoTo(const VldContext& vld, MomNavigator* m=0);
00038 
00039   // IoDataStreamItr interface overridden implementation
00040   int  GoToEOF();
00041   int  Streams(const char* streamlist);
00042   int  Select(const char* stream, const char* selection, bool isRequired=false);
00043   void SetTimeOut(unsigned int seconds);
00044  
00045   // Specialized methods for this class
00046   void  SetClientType(DDS::EClientType clienttype);
00047   void  SetClientName(string clientname);
00048   void AddFile(const char* filename, int at = -1, 
00049                const char* streamlist = "*");  
00050   const char* GetCurrentFile(const char* streamlist = "*") const;
00051   JobCResult GoToFile(const char* filename, const char* streamlist = "*");
00052   JobCResult GoToFile(int i, const char* streamlist = "*");
00053   JobCResult NextFile(int n = 1, const char* streamlist = "*");
00054   JobCResult PrevFile(int n = 1, const char* streamlist = "*");
00055   void RemoveFile(const char* filename = "*", 
00056                   const char* streamlist = "*"); 
00057   std::ostream& ListFile(std::ostream& ostream, const char* streamlist = "*") const;
00058   
00059   int  SetMaxSyncDelay(unsigned int seconds);
00060   int  SetDataSource(unsigned int datasource);
00061   int  SetKeepUpMode(unsigned int keepupmode);
00062   int  SetOffLine(bool offLine = true); 
00063   int  Subscribe();
00064 
00065   int  GetPort() const { return fPort; }
00066   DDS::EClientType  GetClientType() const { return fClientType; }
00067   string  GetClientName() const { return fClientName; }
00068   bool IsModified() const { return fModified; }
00069 
00070 private:
00071   void InitDDSClient();
00072   void ShutdownDDSClient();
00073   
00074   unsigned int fPort;       // Port number to connect to
00075   unsigned int fTimeOut;    // Time out in seconds
00076   unsigned int fMaxRetry;   // Max number of times to retry if connect fails
00077   unsigned int fRetryDelay; // Delay between connect retries (seconds)
00078   DDSClient*   fDDSClient;  // dispatcher client
00079   bool         fModified;   // client subscription is modified
00080   DDS::EClientType fClientType; // client type used for identification
00081   string       fClientName; // optional client name uesd for identification
00082 };
00083 
00084 #endif
00085 

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