void execute( String etcpath ) { // create service manager ServiceManager sm; sm.setRootLogLevel( Logger::LogLevelDebug ); // add services sm.addService( new AWeeTarget() ); sm.addService( MindService::newService() ); sm.addPlatformServices(); // configure all sm.configureDefault( etcpath ); // execute services sm.execute(); }
int main(int argc, char** argv) { Node n; ServiceManager svcMgr; Discovery disc(Discovery::MDNS); disc.add(n); // set some random properties to query for ServiceDescription echoSvcDesc; echoSvcDesc.setProperty("host", Host::getHostId()); echoSvcDesc.setProperty("someString", "this is some random string with 123 numbers inside"); echoSvcDesc.setProperty("someNumber", "1"); EchoService* echoSvc = new EchoService(); svcMgr.addService(echoSvc, echoSvcDesc); PingService* pingSvc = new PingService(); svcMgr.addService(pingSvc); n.connect(&svcMgr); while(true) Thread::sleepMs(1000); }
void UiModule::initialize() { //omsg("UiModule initializing..."); myWidgetFactory = new ui::DefaultWidgetFactory(getEngine()); myUi = new ui::Container(getEngine()); myUi->setAutosize(false); myUi->setLayout(ui::Container::LayoutFree); myUi->setBlendMode(ui::Widget::BlendNormal); Config* cfg = getEngine()->getSystemManager()->getAppConfig(); //myLocalEventsEnabled = cfg->getBoolValue("config/ui/enableLocalEvents", true); myLocalEventsEnabled = true; bool wandPointerSwitcher = false; if(SystemManager::settingExists("config/ui")) { Setting& sUi = SystemManager::settingLookup("config/ui"); mysConfirmButton = Event::parseButtonName(Config::getStringValue("confirmButton", sUi, "Button3")); mysCancelButton = Event::parseButtonName(Config::getStringValue("cancelButton", sUi, "Button4")); mysClickButton = Event::parseButtonName(Config::getStringValue("clickButton", sUi, "Button1")); myGamepadInteractionEnabled = Config::getBoolValue("gamepadInteractionEnabled", sUi, myGamepadInteractionEnabled); myPointerInteractionEnabled = Config::getBoolValue("pointerInteractionEnabled", sUi, myPointerInteractionEnabled); wandPointerSwitcher = Config::getBoolValue("wandPointerSwitcher", sUi, false); } if(wandPointerSwitcher) { omsg("Wand Pointer Switcher enabled."); ServiceManager* sm = SystemManager::instance()->getServiceManager(); sm->addService(WandPointerSwitcher::New()); } //omsg("UiModule initialization OK"); }