// 
// File:          TaoSolver_Component_Impl.hh
// Symbol:        TaoSolver.Component-v0.0.3
// Symbol Type:   class
// Babel Version: 0.10.2
// Description:   Server-side implementation for TaoSolver.Component
// 
// WARNING: Automatically generated; only changes within splicers preserved
// 
// babel-version = 0.10.2
// 

#ifndef included_TaoSolver_Component_Impl_hh
#define included_TaoSolver_Component_Impl_hh

#ifndef included_sidl_cxx_hh
#include "sidl_cxx.hh"
#endif
#ifndef included_TaoSolver_Component_IOR_h
#include "TaoSolver_Component_IOR.h"
#endif
// 
// Includes for all method dependencies.
// 
#ifndef included_LinearAlgebra_Factory_hh
#include "LinearAlgebra_Factory.hh"
#endif
#ifndef included_Optimize_OptimizationModel_hh
#include "Optimize_OptimizationModel.hh"
#endif
#ifndef included_Solver_TerminateReason_hh
#include "Solver_TerminateReason.hh"
#endif
#ifndef included_TaoSolver_Component_hh
#include "TaoSolver_Component.hh"
#endif
#ifndef included_gov_cca_CCAException_hh
#include "gov_cca_CCAException.hh"
#endif
#ifndef included_gov_cca_Services_hh
#include "gov_cca_Services.hh"
#endif
#ifndef included_sidl_BaseInterface_hh
#include "sidl_BaseInterface.hh"
#endif
#ifndef included_sidl_ClassInfo_hh
#include "sidl_ClassInfo.hh"
#endif


// DO-NOT-DELETE splicer.begin(TaoSolver.Component._includes)
#include "Solver_ProjectState.hh"
#include "Solver_OptimizationSolver.hh"
#include "OptimizationPorts_ModelPort.hh"
#include "OptimizationPorts_LAFactoryPort.hh"

#include "cca.h"
#include "stdPorts.h"
#include "dc/babel/babel-cca/server/ccaffeine_TypeMap.hh"
#include "parameters/parametersStar.h"
#include "port/portInterfaces.h"
#include "port/supportInterfaces.h"
// DO-NOT-DELETE splicer.end(TaoSolver.Component._includes)

namespace TaoSolver { 

  /**
   * Symbol "TaoSolver.Component" (version 0.0.3)
   */
  class Component_impl
  // DO-NOT-DELETE splicer.begin(TaoSolver.Component._inherits)
  //    : public virtual ParameterGetListener
  // DO-NOT-DELETE splicer.end(TaoSolver.Component._inherits)
  {

  private:
    // Pointer back to IOR.
    // Use this to dispatch back through IOR vtable.
    Component self;

    // DO-NOT-DELETE splicer.begin(TaoSolver.Component._implementation)
    gov::cca::Services myServices;
    Solver::ProjectState tao_environment;
    Solver::OptimizationSolver tao;
    OptimizationPorts::ModelPort model;
    OptimizationPorts::LAFactoryPort factory;

    ConfigurableParameterPort *cpp;
    //    BoolParameter *utest;
    //    bool dynTestDone;
    ConfigurableParameterPort *
    setupParameters(ConfigurableParameterFactory *cpf);


    // Actual parameter choices
    StringParameter *method;
    StringParameter *options;
    IntParameter *max_its;
    IntParameter *max_funcs;
    IntParameter *lmvm_lm;
    DoubleParameter *fatol;
    DoubleParameter *frtol;
    DoubleParameter *gatol;
    DoubleParameter *grtol;
    DoubleParameter *gttol;
    DoubleParameter *steptol;
    DoubleParameter *lmvm_initH;
    BoolParameter *taomonitor;
    BoolParameter *taoview;
    

  public:
    //    bool updateParameterPort(ConfigurableParameterPort *opp);



    // DO-NOT-DELETE splicer.end(TaoSolver.Component._implementation)

  private:
    // private default constructor (required)
    Component_impl() 
    {} 

  public:
    // sidl constructor (required)
    // Note: alternate Skel constructor doesn't call addref()
    // (fixes bug #275)
    Component_impl( struct TaoSolver_Component__object * s ) : self(s,
      true) { _ctor(); }

    // user defined construction
    void _ctor();

    // virtual destructor (required)
    virtual ~Component_impl() { _dtor(); }

    // user defined destruction
    void _dtor();

    // static class initializer
    static void _load();

  public:


    /**
     * Starts up a component presence in the calling framework.
     * @param Svc the component instance's handle on the framework world.
     * Contracts concerning Svc and setServices:
     * 
     * The component interaction with the CCA framework
     * and Ports begins on the call to setServices by the framework.
     * 
     * This function is called exactly once for each instance created
     * by the framework.
     * 
     * The argument Svc will never be nil/null.
     * 
     * Those uses ports which are automatically connected by the framework
     * (so-called service-ports) may be obtained via getPort during
     * setServices.
     */
    void
    setServices (
      /* in */ ::gov::cca::Services services
    )
    throw ( 
      ::gov::cca::CCAException
    );

    /**
     * user defined non-static method.
     */
    int32_t
    Create (
      /* in */ const ::std::string& method
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    Destroy() throw () 
    ;
    /**
     * user defined non-static method.
     */
    int32_t
    SetTolerances (
      /* in */ double fatol,
      /* in */ double frtol,
      /* in */ double catol,
      /* in */ double crtol
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    SolveApplication (
      /* in */ ::Optimize::OptimizationModel app
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    View() throw () 
    ;
    /**
     * user defined non-static method.
     */
    int32_t
    GetIterationData (
      /* out */ int32_t& iterate,
      /* out */ double& f,
      /* out */ double& gnorm,
      /* out */ double& cnorm,
      /* out */ double& xdiff,
      /* out */ ::Solver::TerminateReason& reason
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    GetMethod (
      /* out */ ::std::string& type
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    SetFunctionLowerBound (
      /* in */ double fmin
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    GetGradientTolerances (
      /* out */ double& gatol,
      /* out */ double& grtol,
      /* out */ double& gttol
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    SetGradientTolerances (
      /* in */ double gatol,
      /* in */ double grtol,
      /* in */ double gttol
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    SetMaximumFunctionEvaluations (
      /* in */ int32_t nfcn
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    SetMaximumIterates (
      /* in */ int32_t maxits
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    SetMethod (
      /* in */ const ::std::string& type
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    SetLAFactory (
      /* in */ ::LinearAlgebra::Factory factory
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    SetFromOptions() throw () 
    ;
    /**
     * user defined non-static method.
     */
    int32_t
    GetSolverHandle (
      /* out */ void*& handle
    )
    throw () 
    ;

    /**
     * user defined non-static method.
     */
    int32_t
    Initialize() throw () 
    ;
    /**
     * user defined non-static method.
     */
    int32_t
    Solve() throw () 
    ;
    /**
     * user defined non-static method.
     */
    int32_t
    Finalize() throw () 
    ;
  };  // end class Component_impl

} // end namespace TaoSolver

// DO-NOT-DELETE splicer.begin(TaoSolver.Component._misc)
// Put miscellaneous things here...
// DO-NOT-DELETE splicer.end(TaoSolver.Component._misc)

#endif
