00001
00002
00003
00004
00005
00006
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
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
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
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;
00075 unsigned int fTimeOut;
00076 unsigned int fMaxRetry;
00077 unsigned int fRetryDelay;
00078 DDSClient* fDDSClient;
00079 bool fModified;
00080 DDS::EClientType fClientType;
00081 string fClientName;
00082 };
00083
00084 #endif
00085