diff --git a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControlThread.h b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControlThread.h index d8d6eb6b7702a73dd39d4b66ea214270a04c3927..7816d1e1bd1eff8a451462220cee38b183bbbf69 100644 --- a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControlThread.h +++ b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControlThread.h @@ -105,11 +105,6 @@ namespace armarx // /////////////////////////////////// Module interface /////////////////////////////////// // // //////////////////////////////////////////////////////////////////////////////////////// // public: - /** - * @brief Sets the \ref EmergencyStopState without updating the topic - * @param state The \ref EmergencyStopState to set - */ - void setEmergencyStopStateNoReportToTopic(EmergencyStopState state); /** * @brief Teturns he \ref ControlThread's thread id * @return The \ref ControlThread's thread id @@ -119,6 +114,13 @@ namespace armarx { return controlThreadId; } + private: + /** + * @brief Sets the \ref EmergencyStopState without updating the topic. + * For use in \ref RobotUnitEmergencyStopMaster. + * @param state The \ref EmergencyStopState to set + */ + void setEmergencyStopStateNoReportToTopic(EmergencyStopState state); // //////////////////////////////////////////////////////////////////////////////////////// // // ///////////////////////////////////// rt interface ///////////////////////////////////// // // //////////////////////////////////////////////////////////////////////////////////////// // @@ -285,6 +287,15 @@ namespace armarx std::size_t usPerDevUntilWarn; /// @brief An Error will be printed, if the execution time per ControlDev of a NJointController exceeds this parameter std::size_t usPerDevUntilError; + // //////////////////////////////////////////////////////////////////////////////////////// // + // /////////////////////////////////////// Attorneys ////////////////////////////////////// // + // //////////////////////////////////////////////////////////////////////////////////////// // + private: + /** + * \brief This class allows minimal access to private members of \ref ControlThread in a sane fashion for \ref Publisher. + * \warning !! DO NOT ADD ADDITIONAL FRIENDS IF YOU DO NOT KNOW WAHT YOU ARE DOING! IF YOU DO SOMETHING WRONG YOU WILL CAUSE UNDEFINED BEHAVIOUR !! + */ + friend class ControlThreadAttorneyForPublisher; }; } } diff --git a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleUnits.cpp b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleUnits.cpp index 9e912311f0a389f49853e8ba4d1e8b1a50b21806..600fa858c36e021b82b8ad49275997e5070707c3 100644 --- a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleUnits.cpp +++ b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleUnits.cpp @@ -36,6 +36,26 @@ #include "../RobotUnit.h" +namespace armarx +{ + namespace RobotUnitModule + { + /** + * \brief This class allows minimal access to private members of \ref ControlThread in a sane fashion for \ref RobotUnitEmergencyStopMaster. + * \warning !! DO NOT ADD ADDITIONAL FRIENDS IF YOU DO NOT KNOW WAHT YOU ARE DOING! IF YOU DO SOMETHING WRONG YOU WILL CAUSE UNDEFINED BEHAVIOUR !! + */ + class ControlThreadAttorneyForRobotUnitEmergencyStopMaster + { + friend class RobotUnitEmergencyStopMaster; + static void SetEmergencyStopStateNoReportToTopic(ControlThread* controlThreadModule, EmergencyStopState state) + { + controlThreadModule->setEmergencyStopStateNoReportToTopic(state); + } + }; + } +} + + namespace armarx { namespace RobotUnitModule @@ -59,7 +79,7 @@ namespace armarx { return; } - controlThreadModule->setEmergencyStopStateNoReportToTopic(state); + ControlThreadAttorneyForRobotUnitEmergencyStopMaster::SetEmergencyStopStateNoReportToTopic(controlThreadModule, state); emergencyStopTopic->reportEmergencyStopState(state); } virtual EmergencyStopState getEmergencyStopState(const Ice::Current& = GlobalIceCurrent) const final