Task.h

00001 #ifndef ERIS_TASK_H
00002 #define ERIS_TASK_H
00003 
00004 #include <sigc++/trackable.h>
00005 #include <sigc++/signal.h>
00006 
00007 #include <Eris/Types.h>
00008 #include <Atlas/Message/Element.h>
00009 
00010 namespace WFMath { class TimeDiff; }
00011 
00012 namespace Eris
00013 {
00014 
00015 class View;
00016 
00017 class Task : public sigc::trackable
00018 {
00019 public:
00020     virtual ~Task();
00021     
00024     const std::string& name() const
00025     { return m_name; }
00026     
00031     double progress() const
00032     { return m_progress; }
00033     
00036     bool isComplete() const;
00037     
00038     sigc::signal<void> Completed;
00039     
00040     sigc::signal<void> Cancelled;
00041     
00042     sigc::signal<void> Progressed;
00043 
00044 private:
00045     void progressChanged();
00046     
00047     friend class View; // so it can call updateProgress
00048     friend class Entity; // for constructor and updateFromAtlas
00049     
00053     Task(Entity* owner, const std::string& nm);
00054     
00055     void updateFromAtlas(const Atlas::Message::MapType& d);
00056     
00060     void updatePredictedProgress(const WFMath::TimeDiff& dt);
00061         
00062     const std::string m_name;
00063     Entity* m_owner;
00064     double m_progress;
00065     
00067     double m_progressRate; 
00068 };
00069 
00070 }
00071 
00072 #endif

Generated on Sun Aug 19 18:51:26 2007 for Eris by  doxygen 1.5.2