missing implementation

This commit is contained in:
Fischlurch 2008-11-30 07:56:00 +01:00 committed by Christian Thaeter
parent 98005b10ae
commit 98b3fcbad8
5 changed files with 15 additions and 10 deletions

View file

@ -74,9 +74,6 @@ namespace lumiera {
LifecycleHook (Symbol eventLabel, Hook callbackFun);
/** for chained calls (add multiple callbacks) */
LifecycleHook& add (Hook callbackFun);
/** alternative, static interface for registering a callback */
static void add (Symbol eventLabel, Hook callbackFun);

View file

@ -35,8 +35,8 @@
*/
#ifndef LUMIERA_LIFECYCLE_H
#define LUMIERA_LIFECYCLE_H
#ifndef LUMIERA_LIFECYCLEREGISTRY_H
#define LUMIERA_LIFECYCLEREGISTRY_H
#include <map>
#include <set>

View file

@ -21,6 +21,7 @@
* *****************************************************/
#include "include/lifecycle.h"
#include "lumiera/appstate.hpp"
#include "lib/lifecycleregistry.hpp"
@ -88,10 +89,10 @@ namespace lumiera {
LifecycleHook::LifecycleHook (Symbol eventLabel, Callback callbackFun)
{
this->add (eventLabel,callbackFun);
add (eventLabel,callbackFun);
}
LifecycleHook&
void
LifecycleHook::add (Symbol eventLabel, Callback callbackFun)
{
bool isNew = AppState::instance().lifecycleHooks_->enroll (eventLabel,callbackFun);
@ -100,7 +101,13 @@ namespace lumiera {
callbackFun(); // when this code executes,
// then per definition we are already post "basic init"
// (which happens in the AppState ctor); thus fire it immediately
return *this;
}
void
trigger (Symbol eventLabel)
{
AppState::lifecycle (eventLabel);
}

View file

@ -172,9 +172,9 @@ out: caught lumiera::Error: LUMIERA_ERROR_EXTERNAL:failure in external service (
out: caught std::runtime_error: test-5
out: caught std::exception. (unspecific)
out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7).....will rethrow as error::State
out: caught lumiera::Error: LUMIERA_ERROR_STATE:unforseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7).
out: caught lumiera::Error: LUMIERA_ERROR_STATE:unforeseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7).
out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::State
out: 2nd intermediate handler caught: LUMIERA_ERROR_STATE:unforseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::Config
out: 2nd intermediate handler caught: LUMIERA_ERROR_STATE:unforeseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::Config
out: caught lumiera::Error: LUMIERA_ERROR_CONFIG:misconfiguration -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).
END

View file

@ -24,6 +24,7 @@
#include "common/test/suite.hpp"
#include "common/test/testoption.hpp"
#include "lumiera/appstate.hpp"
#include "include/lifecycle.h"
using lumiera::AppState;
using lumiera::ON_GLOBAL_INIT;