MetaQuery.h

00001 #ifndef ERIS_META_QUERY_H
00002 #define ERIS_META_QUERY_H
00003 
00004 #include <Eris/BaseConnection.h>
00005 #include <Eris/Poll.h>
00006 
00007 #include <wfmath/timestamp.h>
00008 #include <skstream/skstream.h>
00009 
00010 namespace Eris {
00011 
00012 class Meta;     
00013 
00022 class MetaQuery : public BaseConnection
00023 {
00024 public: 
00025         MetaQuery(Meta *svr, const std::string &host, unsigned int index);
00026         virtual ~MetaQuery();
00027         
00029         long getQueryNo() const
00030         { return _queryNo; }
00031 
00033         const std::string& getHost() const
00034         { return _host; }
00035         
00036     unsigned int getServerIndex() const
00037     { return m_serverIndex; }
00038         
00040         long getElapsed();
00041 
00042         bool isReady(PollData &data) const
00043         {return data.isReady(_stream);}
00044                 
00045     bool isComplete() const
00046     { return m_complete; }
00047         
00048         friend class Meta;
00049 protected:
00050     void setComplete();
00051     
00053         virtual void onConnect();
00054         virtual void handleFailure(const std::string &msg);
00055     virtual void handleTimeout(const std::string& msg);
00056     
00057     void onQueryTimeout();
00058 
00059         const std::string _host;        
00060         Meta* _meta;                    
00061     
00062         long _queryNo;          
00063     WFMath::TimeStamp _stamp;   
00064     unsigned int m_serverIndex;
00065     bool m_complete;
00066 };
00067 
00068 
00069 } // of namespace 
00070 
00071 #endif

Generated on Tue Feb 7 13:20:24 2006 for Eris by  doxygen 1.4.6