Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
src/Glyr/UpdateInterface.hh
Go to the documentation of this file.
00001 #ifndef FREYA_NP_UPDATEINTERFACE_HH
00002 #define FREYA_NP_UPDATEINTERFACE_HH
00003 
00004 #include "../MPD/Client.hh"
00005 #include <glyr/glyr.h>
00006 
00007 namespace Glyr 
00008 {
00009     class Stack;
00010 
00014     class UpdateInterface
00015     {
00016         friend class Glyr::Stack;
00017 
00018         public:
00019 
00020         UpdateInterface() :
00021             requestCounter(0),
00022             queueCounter(0)
00023         {}
00024 
00037         virtual void update(MPD::Client& client, mpd_idle event, MPD::NotifyData& data) = 0;
00038 
00047         virtual void on_deliver(GlyrMemCache * c) {}
00048 
00049         private:
00050 
00054         int requestCounter;
00058         int queueCounter;
00059 
00070         void deliver_internal(GlyrMemCache * c, Glib::Dispatcher * disp, bool deliver)
00071         {
00072             if(deliver) 
00073             {
00074                 on_deliver(c);
00075             }
00076             delete disp;
00077         }
00078     };
00079 }
00080 
00081 #endif /* end of include guard: FREYA_NP_UPDATEINTERFACE_HH */