SmartPointer<IHandlerActivation> SlaveHandlerService::ActivateHandler(const SmartPointer<IHandlerActivation>& childActivation)
{
  const QString commandId = childActivation->GetCommandId();
  const IHandler::Pointer handler = childActivation->GetHandler();
  const Expression::Pointer childExpression = childActivation->GetExpression();
  Expression::Pointer expression = defaultExpression;
  if (childExpression.IsNotNull() && defaultExpression.IsNotNull())
  {
    const AndExpression::Pointer andExpression(new AndExpression());
    andExpression->Add(childExpression);
    andExpression->Add(defaultExpression);
    expression = andExpression;
  }
  else if (childExpression.IsNotNull())
  {
    expression = childExpression;
  }
  const int depth = childActivation->GetDepth() + 1;
  const IHandlerActivation::Pointer localActivation(
        new HandlerActivation(commandId, handler, expression, depth, this));

  return DoActivation(localActivation);
}
示例#2
0
NotExpression::NotExpression(Expression::Pointer expression)
{
  poco_assert(expression.IsNotNull());

  fExpression= expression;
}