Class SimulatedControllerPtr


  • public class SimulatedControllerPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • SimulatedControllerPtr

        public SimulatedControllerPtr​(long cPtr,
                                      boolean cMemoryOwn)
      • SimulatedControllerPtr

        public SimulatedControllerPtr()
        Default constructor yielding a NULL-pointer.
      • SimulatedControllerPtr

        public SimulatedControllerPtr​(SimulatedController ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • getControllerName

        public java.lang.String getControllerName()
        get the name of this controller
        Returns:
        name of this controller
      • update

        public void update​(Simulator.UpdateInfo info,
                           State state)
        updates/steps the controller with time step dt. It will update
        the state state accordingly
        Parameters:
        info - [in] update information related to the time step.
        state - [in/out] the current state
      • reset

        public void reset​(State state)
        reset the controller to the applied state
        Parameters:
        state - [in] the state to reset to
      • getControllerHandle

        public ControllerPtr getControllerHandle​(SimulatorPtr sim)
        get the controller handle eg. statefull handle, associated with this simulated
        controller
        Returns:
      • getControllerModel

        public ControllerModelPtr getControllerModel()
        get the controllermodel of this simulated controller
        Returns:
      • setEnabled

        public void setEnabled​(boolean enabled)
        disable or enable this controller
        Parameters:
        enabled -
      • isEnabled

        public boolean isEnabled()
        true if this controller is enabled
        Returns:
      • registerIn

        public void registerIn​(State state)
        initialize this stateless data to a specific state
        Parameters:
        state - [in] the state in which to register the data.

        Note: the data will be registered in the state structure of the state
        and any copies or other instances of the state will therefore also
        contain the added states.
      • registerIn

        public void registerIn​(StateStructurePtr state)
        register this stateless object in a statestructure.
      • unregister

        public void unregister()
        unregisters all state data of this stateless object
      • getStateStructure

        public StateStructurePtr getStateStructure()
        Get the state structure.
        Returns:
        the state structure.
      • isRegistered

        public boolean isRegistered()
        Check if object has registered its state.
        Returns:
        true if registered, false otherwise.