ALResourceManager API

NAOqi Core - Overview | API | Tutorial


Namespace : AL

#include <alproxies/alresourcemanagerproxy.h>

Methods

bool ALResourceManagerProxy::areResourcesFree(const std::vector<std::string>& resourceNames)

True if resources free

Parameters:
  • resourceNames – Resource names
Returns:

True if all the specified resources are free

bool ALResourceManagerProxy::areResourcesOwnedBy(const std::vector<std::string>& resourceNameList, const std::string& ownerName)

True if all the specified resources are owned by the owner

Parameters:
  • resourceNameList – Resource name
  • ownerName – Owner pointer with hierarchy
Returns:

True if all the specify resources are owned by the owner

void ALResourceManagerProxy::createResource(const std::string& resourceName, const std::string& parentResourceName)

Create a resource

Parameters:
  • resourceName – Resource name to create
  • parentResourceName – Parent resource name or empty string for root resource
void ALResourceManagerProxy::deleteResource(const std::string& resourceName, const bool& deleteChildResources)

Delete a root resource

Parameters:
  • resourceName – Resource name to delete
  • deleteChildResources – Delete child resources if true
void ALResourceManagerProxy::enableStateResource(const std::string& resourceName, const bool& enabled)

Enable or disable a state resource

Parameters:
  • resourceName – The name of the resource that you wish enable of disable. e.g. Standing
  • enabled – True to enable, false to disable
bool ALResourceManagerProxy::isInGroup(const std::string& resourceGroupName, const std::string& resourceName)

True if a resource is in another parent resource

Parameters:
  • resourceGroupName – Group name. Ex: Arm
  • resourceName – Resource name
Returns:

void ALResourceManagerProxy::releaseLocalResource(const std::string& resourceName, const boost::shared_ptr<AL::ALOwner>& ownerName)

Release local resource

Parameters:
  • resourceName – Resource name
  • ownerName – Existing owner name
void ALResourceManagerProxy::releaseResource(const std::string& resourceName, const std::string& ownerName)

Release resource

Parameters:
  • resourceName – Resource name
  • ownerName – Existing owner name
void ALResourceManagerProxy::releaseResources(const std::vector<std::string>& resourceNames, const std::string& ownerName)

Release resources list

Parameters:
  • resourceNames – Resource names
  • ownerName – Owner name
void ALResourceManagerProxy::waitForLocalResource(const std::string& resourceName, const boost::shared_ptr<AL::ALOwner>& ownerPtr, const std::string& callbackName, const int& timeoutSeconds)

Waits for local resource, using a pointer to the owner

Parameters:
  • resourceName – Resource name
  • ownerPtr – Owner smart pointer. Object that inherit ALOwner
  • callbackName – The name of the method called when another owner wants the resource
  • timeoutSeconds – Timeout in seconds
void ALResourceManagerProxy::waitForLocalResources(const std::vector<std::string>& resourceNameList, const boost::shared_ptr<AL::ALOwner>& owner, const std::string& callbackName, const int& timeoutSeconds)

Wait for local resources

Parameters:
  • resourceNameList – Resources name
  • owner – Owner pointer with hierarchy. Object that inherit ALHierarchyOwner and redefine isParent method to give hierarchy information
  • callbackName – callback name
  • timeoutSeconds – Timeout in seconds
void ALResourceManagerProxy::waitForLocalResourcesTree(const std::vector<std::string>& resourceName, const boost::shared_ptr<AL::ALHierarchyOwner>& treeOwnerPtr, const std::string& callbackName, const int& timeoutSeconds)

Wait for resource tree. Parent and children are not in conflict. Local function

Parameters:
  • resourceName – Resource name
  • treeOwnerPtr – Owner pointer with tree hierarchy
  • callbackName – callback name
  • timeoutSeconds – Timeout in seconds
void ALResourceManagerProxy::waitForResource(const std::string& resourceName, const std::string& ownerName, const std::string& callbackName, const int& timeoutSeconds)

Wait resource

Parameters:
  • resourceName – Resource name
  • ownerName – Owner name
  • callbackName – callback name
  • timeoutSeconds – Timeout in seconds
void ALResourceManagerProxy::declareEvent(const std::string& eventName, const std::string& extractorName)

Declares an event to allow future subscriptions to the event

Parameters:
  • eventName – The name of the event
  • extractorName – The name of the extractor capable of creating the event
void ALResourceManagerProxy::getData(const std::string& key)

Gets the value of a key-value pair stored in memory

Parameters:
  • key – Name of the value
Returns:

The data as an ALValue. This can often be cast transparently into the original type.

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.

Parameters:
  • key – Name of the value
  • deprecatedParameter – DEPRECATED - This parameter has no effect, but is left for compatibility reason.
Returns:

The data as an ALValue

void ALResourceManagerProxy::getDataList(const std::string& filter)

Gets a list of all key names that contain a given string

Parameters:
  • filter – A string used as the search term
Returns:

A list of all the data key names that contain the given string.

void ALResourceManagerProxy::getDataListName()

Gets the key names for all the key-value pairs in memory

Returns:A list containing the keys in memory