Package com.opengamma.engine.function

Examples of com.opengamma.engine.function.FunctionDefinition


    final InMemoryFunctionRepository repo = FunctionRepositoryFactory.constructRepository(configuration);
    assertNotNull(repo);
    final Collection<FunctionDefinition> definitions = repo.getAllFunctions();
    assertNotNull(definitions);
    assertEquals(FunctionRepositoryFactory.INTRINSIC_FUNCTION_COUNT + 1, definitions.size());
    FunctionDefinition definition = null;
    for (final FunctionDefinition d : definitions) {
      if (d instanceof MockEmptyFunction) {
        assertNotNull(d.getUniqueId());
        definition = d;
      }
    }
    assertNotNull(definition);
    final FunctionCompilationContext context = new FunctionCompilationContext();
    context.setRawComputationTargetResolver(new DefaultComputationTargetResolver());
    final CompiledFunctionService cfs = new CompiledFunctionService(repo, new CachingFunctionRepositoryCompiler(), context);
    cfs.initialize();
    final CompiledFunctionRepository compiledRepo = cfs.compileFunctionRepository(System.currentTimeMillis());
    assertNotNull(compiledRepo.getDefinition(definition.getUniqueId()));
    final FunctionInvoker invoker = compiledRepo.getInvoker(definition.getUniqueId());
    assertNotNull(invoker);
    assertTrue(invoker instanceof MockEmptyFunction);
    assertSame(definition, invoker);
  }
View Full Code Here


      return null;
    }

    @Override
    public FunctionDefinition getFunctionDefinition() {
      return new FunctionDefinition() {

        @Override
        public CompiledFunctionDefinition compile(final FunctionCompilationContext context, final Instant atInstant) {
          throw new UnsupportedOperationException();
        }
View Full Code Here

        } else {
          return null;
        }
      }
    };
    final FunctionDefinition a_foo = new Function("A_foo");
    final FunctionDefinition a_bar = new Function("A_bar");
    final FunctionDefinition b_foo = new Function("B_foo");
    final FunctionDefinition b_bar = new Function("B_bar");
    final FunctionDefinition foo = new Function("foo");
    final FunctionDefinition bar = new Function("bar");
    assertNull(groups.getExclusionGroup(foo));
    assertNull(groups.getExclusionGroup(bar));
    final FunctionExclusionGroup afoo1 = groups.getExclusionGroup(a_foo);
    final FunctionExclusionGroup afoo2 = groups.getExclusionGroup(a_foo);
    assertEquals(afoo1, afoo2);
View Full Code Here

    MutableFudgeMsg msg = serializer.newMessage();
    serializer.addToMessage(msg, COMPUTATION_TARGET_FIELD, null, node.getComputationTarget());
    if (node.getFunction() != null) {
      msg.add(PARAMETERIZED_FUNCTION_UNIQUE_ID_FIELD, null, node.getFunction().getUniqueId());
      serializer.addToMessageWithClassHeaders(msg, FUNCTION_PARAMETERS_FIELD, null, node.getFunction().getParameters());
      FunctionDefinition functionDefinition = node.getFunction().getFunction().getFunctionDefinition();
      msg.add(FUNCTION_UNIQUE_ID_FIELD, functionDefinition.getUniqueId());
      msg.add(FUNCTION_SHORT_NAME_FIELD, functionDefinition.getShortName());
    }
    serializer.addToMessage(msg, INPUT_VALUES_FIELD, null, node.getInputValues());
    serializer.addToMessage(msg, OUTPUT_VALUES_FIELD, null, node.getOutputValues());
    serializer.addToMessage(msg, TERMINAL_OUTPUT_VALUES_FIELD, null, node.getTerminalOutputValues());
    return msg;
View Full Code Here

        return functionStart;
      }

      @Override
      public FunctionDefinition getFunctionDefinition() {
        return new FunctionDefinition() {

          @Override
          public CompiledFunctionDefinition compile(FunctionCompilationContext context, Instant atInstant) {
            return null;
          }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.function.FunctionDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.