SetStartCalled(true);
}
+void ConfigObject::PreActivate(void)
+{
+ CONTEXT("Setting 'active' to true for object '" + GetName() + "' of type '" + GetReflectionType()->GetName() + "'");
+
+ ASSERT(!IsActive());
+ SetActive(true, true);
+}
+
void ConfigObject::Activate(bool runtimeCreated)
{
CONTEXT("Activating object '" + GetName() + "' of type '" + GetReflectionType()->GetName() + "'");
Start(runtimeCreated);
ASSERT(GetStartCalled());
- ASSERT(!IsActive());
- SetActive(true, true);
if (GetHAMode() == HARunEverywhere)
SetAuthority(true);
void Register(void);
void Unregister(void);
+ void PreActivate(void);
void Activate(bool runtimeCreated = false);
void Deactivate(bool runtimeRemoved = false);
void SetAuthority(bool authority);
}
}
- if (!silent)
- Log(LogInformation, "ConfigItem", "Triggering Start signal for config items");
-
for (const ConfigItem::Ptr& item : newItems) {
if (!item->m_Object)
continue;
if (object->IsActive())
continue;
+#ifdef I2_DEBUG
+ Log(LogDebug, "ConfigItem")
+ << "Setting 'active' to true for object '" << object->GetName() << "' of type '" << object->GetReflectionType()->GetName() << "'";
+#endif /* I2_DEBUG */
+ upq.Enqueue(boost::bind(&ConfigObject::PreActivate, object));
+ }
+
+ upq.Join();
+
+ if (upq.HasExceptions()) {
+ upq.ReportExceptions("ConfigItem");
+ return false;
+ }
+
+ if (!silent)
+ Log(LogInformation, "ConfigItem", "Triggering Start signal for config items");
+
+ for (const ConfigItem::Ptr& item : newItems) {
+ if (!item->m_Object)
+ continue;
+
+ ConfigObject::Ptr object = item->m_Object;
+
#ifdef I2_DEBUG
Log(LogDebug, "ConfigItem")
<< "Activating object '" << object->GetName() << "' of type '" << object->GetReflectionType()->GetName() << "'";