Init.cpp

Go to the documentation of this file.
00001 /*
00002 
00003 $Header$
00004 
00005 */
00006 
00007 #include "Core.h"
00008 #include "Error.h"
00009 
00010 #include "Init.h"
00011 
00012 // Protected methods.
00013 
00014 Init::Init(const ValueList &params) : Service<Init>(params)
00015 {
00016   BIND(services);
00017 
00018   StringList names;
00019   int res;
00020 
00021   if (FAILED(res = REGISTRY_GET(Init, services, names))) {
00022     failure(ERROR_BACKTRACE(res));
00023     return;
00024   }
00025 
00026   unsigned int i = 0, size = names.size();
00027 
00028   if (size == 0) {
00029     failure(ERROR(SERVICE_MSG_INVALID_PARAMS, CSTRING(NAME())));
00030     return;
00031   }
00032 
00033   while (i < size) {
00034     if (names[i].empty()) {
00035       failure(ERROR(SERVICE_MSG_INVALID_PARAMS, CSTRING(NAME())));
00036       return;
00037     }
00038     DEBUG("Starting service '%s'.", CSTRING(names[i]));
00039 
00040     if (FAILED(res = CORE()->spawn(names[i]))) {
00041       failure(ERROR_BACKTRACE(res));
00042       return;
00043     }
00044 
00045     ++i;
00046   }
00047 }
00048 
00049 Init::~Init()
00050 {
00051 }

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