.. _alresourcemanager-api: ALResourceManager API ===================== :ref:`Overview ` | API | :ref:`Tutorial ` Namespace : **AL** .. code-block:: cpp #include Method list ----------- .. cpp:class:: ALResourceManagerProxy * Methods: * :cpp:func:`ALResourceManagerProxy::areResourcesFree` * :cpp:func:`ALResourceManagerProxy::areResourcesOwnedBy` * :cpp:func:`ALResourceManagerProxy::createResource` * :cpp:func:`ALResourceManagerProxy::deleteResource` * :cpp:func:`ALResourceManagerProxy::enableStateResource` * :cpp:func:`ALResourceManagerProxy::isInGroup` * :cpp:func:`ALResourceManagerProxy::releaseLocalResource` * :cpp:func:`ALResourceManagerProxy::releaseResource` * :cpp:func:`ALResourceManagerProxy::releaseResources` * :cpp:func:`ALResourceManagerProxy::waitForLocalResource` * :cpp:func:`ALResourceManagerProxy::waitForLocalResources` * :cpp:func:`ALResourceManagerProxy::waitForLocalResourcesTree` * :cpp:func:`ALResourceManagerProxy::waitForResource` * :cpp:func:`ALResourceManagerProxy::declareEvent` * :cpp:func:`ALResourceManagerProxy::getData` * :cpp:func:`ALResourceManagerProxy::getDataList` * :cpp:func:`ALResourceManagerProxy::getDataListName` .. seealso:: * :ref:`Methods inherited from ALModule ` Methods ------- .. cpp:function:: bool ALResourceManagerProxy::areResourcesFree(const std::vector& resourceNames) True if resources free :param resourceNames: Resource names :return: True if all the specified resources are free .. cpp:function:: bool ALResourceManagerProxy::areResourcesOwnedBy( const std::vector& resourceNameList, const std::string& ownerName ) True if all the specified resources are owned by the owner :param resourceNameList: Resource name :param ownerName: Owner pointer with hierarchy :return: True if all the specify resources are owned by the owner .. cpp:function:: void ALResourceManagerProxy::createResource( const std::string& resourceName, const std::string& parentResourceName ) Create a resource :param resourceName: Resource name to create :param parentResourceName: Parent resource name or empty string for root resource .. cpp:function:: void ALResourceManagerProxy::deleteResource( const std::string& resourceName, const bool& deleteChildResources ) Delete a root resource :param resourceName: Resource name to delete :param deleteChildResources: Delete child resources if true .. cpp:function:: void ALResourceManagerProxy::enableStateResource( const std::string& resourceName, const bool& enabled ) Enable or disable a state resource :param resourceName: The name of the resource that you wish enable of disable. e.g. Standing :param enabled: True to enable, false to disable .. cpp:function:: bool ALResourceManagerProxy::isInGroup( const std::string& resourceGroupName, const std::string& resourceName ) True if a resource is in another parent resource :param resourceGroupName: Group name. Ex: Arm :param resourceName: Resource name :return: .. cpp:function:: void ALResourceManagerProxy::releaseLocalResource( const std::string& resourceName, const boost::shared_ptr& ownerName ) Release local resource :param resourceName: Resource name :param ownerName: Existing owner name .. cpp:function:: void ALResourceManagerProxy::releaseResource( const std::string& resourceName, const std::string& ownerName ) Release resource :param resourceName: Resource name :param ownerName: Existing owner name .. cpp:function:: void ALResourceManagerProxy::releaseResources( const std::vector& resourceNames, const std::string& ownerName ) Release resources list :param resourceNames: Resource names :param ownerName: Owner name .. cpp:function:: void ALResourceManagerProxy::waitForLocalResource( const std::string& resourceName, const boost::shared_ptr& ownerPtr, const std::string& callbackName, const int& timeoutSeconds ) Waits for local resource, using a pointer to the owner :param resourceName: Resource name :param ownerPtr: Owner smart pointer. Object that inherit ALOwner :param callbackName: The name of the method called when another owner wants the resource :param timeoutSeconds: Timeout in seconds .. cpp:function:: void ALResourceManagerProxy::waitForLocalResources( const std::vector& resourceNameList, const boost::shared_ptr& owner, const std::string& callbackName, const int& timeoutSeconds ) Wait for local resources :param resourceNameList: Resources name :param owner: Owner pointer with hierarchy. Object that inherit ALHierarchyOwner and redefine isParent method to give hierarchy information :param callbackName: callback name :param timeoutSeconds: Timeout in seconds .. cpp:function:: void ALResourceManagerProxy::waitForLocalResourcesTree( const std::vector& resourceName, const boost::shared_ptr& treeOwnerPtr, const std::string& callbackName, const int& timeoutSeconds ) Wait for resource tree. Parent and children are not in conflict. Local function :param resourceName: Resource name :param treeOwnerPtr: Owner pointer with tree hierarchy :param callbackName: callback name :param timeoutSeconds: Timeout in seconds .. cpp:function:: void ALResourceManagerProxy::waitForResource( const std::string& resourceName, const std::string& ownerName, const std::string& callbackName, const int& timeoutSeconds ) Wait resource :param resourceName: Resource name :param ownerName: Owner name :param callbackName: callback name :param timeoutSeconds: Timeout in seconds .. cpp:function:: void ALResourceManagerProxy::declareEvent( const std::string& eventName, const std::string& extractorName ) Declares an event to allow future subscriptions to the event :param eventName: The name of the event :param extractorName: The name of the extractor capable of creating the event .. cpp:function:: void ALResourceManagerProxy::getData( const std::string& key ) Gets the value of a key-value pair stored in memory :param key: Name of the value :return: The data as an ALValue. This can often be cast transparently into the original type. .. cpp:function:: void ALResourceManagerProxy::getData( const std::string& key, const int& deprecatedParameter ) DEPRECATED - Gets the value of a key-value pair stored in memory. Please use the version of this method with no second parameter. :param key: Name of the value :param deprecatedParameter: DEPRECATED - This parameter has no effect, but is left for compatibility reason. :return: The data as an ALValue .. cpp:function:: void ALResourceManagerProxy::getDataList( const std::string& filter ) Gets a list of all key names that contain a given string :param filter: A string used as the search term :return: A list of all the data key names that contain the given string. .. cpp:function:: void ALResourceManagerProxy::getDataListName( ) Gets the key names for all the key-value pairs in memory :return: A list containing the keys in memory