Skip to content
Snippets Groups Projects
  • Julian Tusch's avatar
    48b492c4
    changes: · 48b492c4
    Julian Tusch authored
    - formatting, cleanup
    - moved update skill into FluxioSkill
    - implemented core mutex functionality
    - improved return value and error handling
    - added armarx warning messages
    - store root profile defaults as stringified json in fluxio values
    48b492c4
    History
    changes:
    Julian Tusch authored
    - formatting, cleanup
    - moved update skill into FluxioSkill
    - implemented core mutex functionality
    - improved return value and error handling
    - added armarx warning messages
    - store root profile defaults as stringified json in fluxio values
SkillManagerComponentPluginUser.h 5.27 KiB
#pragma once

#include <RobotAPI/interface/skills/SkillManagerInterface.h>

#include "SkillManagerComponentPlugin.h"

namespace armarx::plugins
{
    class SkillManagerComponentPlugin; // forward declaration
}

namespace armarx
{
    class SkillManagerComponentPluginUser :
        virtual public ManagedIceObject,
        virtual public skills::manager::dti::SkillManagerInterface
    {
    public:
        SkillManagerComponentPluginUser();

        void addProvider(const skills::manager::dto::ProviderInfo& providerInfo,
                         const Ice::Current& current) override;

        void removeProvider(const skills::manager::dto::ProviderID& provider,
                            const Ice::Current& current) override;

        skills::manager::dto::SkillStatusUpdate
        executeSkill(const skills::manager::dto::SkillExecutionRequest& info,
                     const Ice::Current& current) override;

        skills::manager::dto::SkillExecutionID
        executeSkillAsync(const skills::manager::dto::SkillExecutionRequest& skillExecutionRequest,
                          const Ice::Current& current) override;

        skills::provider::dto::ParameterUpdateResult
        updateSkillParameters(const skills::manager::dto::SkillExecutionID& executionId,
                              const aron::data::dto::DictPtr& params,
                              const Ice::Current& current) override;

        void updateStatusForSkill(const skills::provider::dto::SkillStatusUpdate& update,
                                  const skills::callback::dto::ProviderID& id,
                                  const Ice::Current& current) override;

        skills::provider::dto::AbortSkillResult
        abortSkill(const skills::manager::dto::SkillExecutionID& id,
                   const Ice::Current& current) override;

        skills::provider::dto::AbortSkillResult
        abortSkillAsync(const skills::manager::dto::SkillExecutionID& id,
                        const Ice::Current& current) override;


        skills::manager::dto::SkillDescriptionMap
        getSkillDescriptions(const Ice::Current& current) override;

        IceUtil::Optional<skills::manager::dto::SkillDescription>
        getSkillDescription(const skills::manager::dto::SkillID& id,
                            const Ice::Current& current) override;

        IceUtil::Optional<skills::manager::dto::SkillStatusUpdate>
        getSkillExecutionStatus(const skills::manager::dto::SkillExecutionID& executionId,
                                const Ice::Current& current) override;

        skills::manager::dto::SkillStatusUpdateMap
        getSkillExecutionStatuses(const Ice::Current& current) override;

        //****************************//
        //** Fluxio related methods **//
        //****************************//
        skills::manager::dto::FluxioSkillList getSkillList(const Ice::Current& current) override;

        IceUtil::Optional<skills::manager::dto::FluxioSkill>
        getSkill(const std::string& id, const Ice::Current& current) override;

        bool updateSkill(const std::string& userId,
                         const skills::manager::dto::FluxioSkill& skill,
                         const Ice::Current& current) override;

        void removeSkill(const std::string& id, const Ice::Current& current) override;

        bool getSkillMutex(const std::string& skillId,
                           const std::string& userId,
                           const Ice::Current& current) override;

        void deleteSkillMutex(const std::string& skillId,
                              const std::string& userId,
                              const Ice::Current& current) override;

        void removeSkillParameter(const std::string& userId,
                                  const std::string& skillId,
                                  const std::string& parameterId,
                                  const Ice::Current& current) override;

        skills::manager::dto::FluxioProfileList
        getProfileList(const Ice::Current& current) override;

        IceUtil::Optional<skills::manager::dto::FluxioProfile>
        getProfile(const std::string& id, const Ice::Current& current) override;

        skills::manager::dto::FluxioProfile
        createProfile(const skills::manager::dto::FluxioProfile& profile,
                      const Ice::Current& current) override;

        void updateProfile(const skills::manager::dto::FluxioProfile& profile,
                           const Ice::Current& current) override;

        skills::manager::dto::FluxioProviderList
        getProviderList(const Ice::Current& current) override;

        IceUtil::Optional<skills::manager::dto::FluxioProvider>
        getProvider(const std::string& id, const Ice::Current& current) override;

        IceUtil::Optional<skills::manager::dto::FluxioSkillList>
        getSkillsOfProvider(const std::string& id, const Ice::Current& current) override;

        IceUtil::Optional<skills::manager::dto::FluxioSkill>
        addSkillToProvider(const std::string& userId,
                           const std::string& providerId,
                           const skills::manager::dto::FluxioSkill& skill,
                           const Ice::Current& current) override;

    private:
        armarx::plugins::SkillManagerComponentPlugin* plugin = nullptr;
    };
} // namespace armarx