Init.h

Go to the documentation of this file.
00001 #ifndef __INIT_H__
00002 #define __INIT_H__
00003 
00004 /*
00005 
00006 $Header$
00007 
00008 */
00009 
00010 #include "Service.h"
00011 #include "Registry.h"
00012 #include "StringList.h"
00013 
00014 static const char *const NAME_INIT = "init";
00015 static const char *const MAN_INIT  = "\
00016 Service <service>init</service> is responsible for initial start of other services. \
00017 It uses <registry>init.services</registry> registry entry to obtain the list of services \
00018 to be started. This service starts automatically when the process starts. It is not \
00019 supposed to be started manually.\
00020 ";
00021 
00022 // Registry manuals.
00023 
00024 static const char *const MAN_INIT_SERVICES = "\
00025 <registry>StringList init.services()</registry>\n\n\
00026 Contains list of names of services to be started at the system startup. Service <service>init</service> \
00027 does not pass any parameters to these services. So, they have to handle this type \
00028 of starting.\
00029 ";
00030 
00031 using namespace std;
00032 
00033 class Init : public Service<Init>
00034 {
00035 
00036 friend class Service<Init>;
00037 
00038   PYLON_OBJECT
00039 
00040 public:
00041 
00042   inline
00043   static String NAME();
00044 
00045   inline
00046   static String MANUAL();
00047 
00048   inline
00049   static unsigned int instancesNumberLimit();
00050 
00051 protected:
00052 
00053   Init(const ValueList &params);
00054   virtual ~Init();
00055 
00056 private:
00057 
00058   REGISTRY(StringList, services, StringList(), MAN_INIT_SERVICES);
00059 
00060   StringList _services;
00061 };
00062 
00063 inline
00064 String Init::NAME()
00065 {
00066   return NAME_INIT;
00067 }
00068 
00069 inline
00070 String Init::MANUAL()
00071 {
00072   return MAN_INIT;
00073 }
00074 
00075 inline
00076 unsigned int Init::instancesNumberLimit()
00077 {
00078   return 1;
00079 }
00080 
00081 #endif

Generated on Thu Sep 6 20:11:25 2007 for Pylon Application Platform by  doxygen 1.5.1