- Main Page
- Namespaces
- Classes
- Files

- Search for |

# service.h

    00001 // "service.h"
    00002
    00003 // (c) OPAC Team, LIFL, August 2005
    00004
    00005 /*
    00006    Contact: paradiseo-help@lists.gforge.inria.fr
    00007 */
    00008
    00009 #ifndef __service_h
    00010 #define __service_h
    00011
    00012 #include "communicable.h"
    00013 #include "thread.h"
    00014
    00015 typedef unsigned SERVICE_ID;
    00016
    00017 class Service : public Communicable {
    00018
    00019 public :
    00020
    00021   void setOwner (Thread & __owner);
    00022
    00023   Thread * getOwner ();
    00024
    00025   void requestResourceRequest (unsigned __how_many = 1);
    00026   void packResourceRequest ();
    00027
    00028   virtual void packData ();
    00029   virtual void unpackData ();
    00030
    00031   virtual void execute ();
    00032
    00033   virtual void packResult ();
    00034   virtual void unpackResult ();
    00035
    00036   virtual void notifySendingData ();
    00037   virtual void notifySendingResourceRequest ();
    00038   virtual void notifySendingAllResourceRequests ();
    00039
    00040 private :
    00041
    00042   Thread * owner; /* Owner thread (i.e. 'uses' that service) */
    00043
    00044   unsigned num_sent_rr; /* Number of RR not really sent (i.e. still in the sending queue)*/
    00045
    00046 };
    00047
    00048 extern Service * getService (SERVICE_ID __key);
    00049
    00050 #endif