// Copyright (C) 2019 by Joseph Mirabel, LAAS-CNRS.
//
// This file is part of the hpp-corbaserver.
//
// This software is provided "as is" without warranty of any kind,
// either expressed or implied, including but not limited to the
// implied warranties of fitness for a particular purpose.
//
// See the COPYING file for more information.

#ifndef HPP_CORE_PATHS_IDL
#define HPP_CORE_PATHS_IDL
#include <hpp/common.idl>

module hpp
{
  module core_idl {
  typedef unsigned long long size_t;
  interface PathVector;
  interface ConstraintSet;

  interface Path
  {
    HPP_EXPOSE_MEMORY_DEALLOCATION(Error)

    size_type outputSize () raises (Error);

    size_type outputDerivativeSize () raises (Error);

    value_type length () raises (Error);

    floatSeq initial () raises (Error);

    floatSeq end () raises (Error);

    ConstraintSet constraints () raises (Error);

    string str () raises (Error);

    floatSeq call (in value_type t, out boolean success) raises (Error);
    //-> eval

    floatSeq at (in value_type t, out boolean success) raises (Error);
    //* hpp::core::vector_t res (get()->outputSize());
    //* success = get()->at (t, res);
    //* return hpp::corbaServer::vectorToFloatSeq (res);

    floatSeq derivative (in value_type t, in short order) raises (Error);
    //* hpp::core::vector_t res (get()->outputDerivativeSize());
    //* get()->derivative (res, t, order);
    //* return hpp::corbaServer::vectorToFloatSeq (res);

    Path extract (in value_type tmin, in value_type tmax) raises (Error);

    PathVector asVector () raises (Error);
    //* hpp::core::PathPtr_t p = get();
    //* hpp::core::PathVectorPtr_t pv =
    //*   hpp::core::PathVector::create (p->outputSize(), p->outputDerivativeSize());
    //* pv->appendPath (p);
    //*
    //* return hpp::corbaServer::makeServant<hpp::core_idl::PathVector_ptr>
    //*   (server_, new PathVector (server_, pv));

    Path reverse () raises (Error);
  }; // interface Path

  interface PathVector : Path {
    size_t numberPaths () raises (Error);

    size_t rankAtParam (in value_type param, out value_type localParam) raises (Error);

    Path pathAtRank (in size_t rank) raises (Error);

    void appendPath (in Path p) raises (Error);

    void concatenate (in PathVector p) raises (Error);

    PathVector flatten () raises (Error);
    //* hpp::core::PathPtr_t p = get();
    //* hpp::core::PathVectorPtr_t pv =
    //*   HPP_DYNAMIC_PTR_CAST(hpp::core::PathVector, p);
    //* hpp::core::PathVectorPtr_t out =
    //*   hpp::core::PathVector::create (p->outputSize(), p->outputDerivativeSize());
    //* pv->flatten (out);
    //*
    //* return hpp::corbaServer::makeServant<hpp::core_idl::PathVector_ptr>
    //*   (server_, new PathVector (server_, out));
  }; // interface PathVector

  module path_idl {
    interface Hermite : Path {
    };
  }; // module path

  }; // module core
}; // module hpp
//* #include <hpp/core/path.hh>
//* #include <hpp/core/path-vector.hh>
//* #include <hpp/core/path/hermite.hh>
//* #include <hpp/core_idl/_constraints.hh>

#include <hpp/core_idl/_constraints.idl>

#endif // HPP_CORE_PATHS_IDL
