Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

krocard
Copy link
Contributor

@krocard krocard commented Oct 28, 2015

CElementHandle can be used by applications to directly control an element part of the parameter tree. CElementHandle objects can be created by calling the platform connector class new createElementHandle() functionality.

Element handle objects are owned by the application so it's its responsibility to destroy them through a "delete" operation.

The following functionalities are available in CElementHandle class:

  • getting element's name
  • getting element's path in parameter hierarchy tree
  • getting element's memory size in bytes
  • determining if element is rogue
  • getting the structure of the element (expanded version of the structure)
  • getting/setting the element's settings in XML format
  • getting/setting the element's settings in binary format

Notes:

  • setting the element's settings in binary shall be done cautiously: no check is made as to the data integrity, meaning the operation could result in inconsistent parameter states where some parameter values are out of range or invalid wrt their type
  • setting the element's settings will fail if the element is not rogue (belong to a domain or one of its descendent does)
  • if a tuning application has set the auto sync mode to off, the changes applied through CElementHandle will be forward-synchronized when the auto sync mode is set back to on or when the "sync" remote command is executed.
  • when the tuning mode is on, calls to setAsXML() and setAsBytes() will fail silently (do nothing but return success)
  • The handle is not tested !

   

@dawagner
Copy link
Contributor

👎 review done.

@tcahuzax
Copy link
Contributor

👎 reviews done

benaware and others added 3 commits October 28, 2015 17:23
CConfigurableElement::isRogue() method was only suitable for parameters,
not for elements. If an element did not belong to any domain, but one of
its descendent did, this method would have mistakenly returned true.

This error was not detected up to now for this method was only used with
parameters (leaf elements in parameter tree).

Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com>
Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Handles have non const method, thus their reference
on PF elements should not be const.

It used to work because the only method called `access`
was const even when setting a value.

Give a non const value to ParameterHandle constructor.
It will be used in a future Handle that will call non
const methods.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
mayFailCall is a function that takes a method and
arguments and calls the method, transforming
the error code in exception.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
@dawagner dawagner changed the title Element handle [review] Element handle Oct 28, 2015
@krocard krocard force-pushed the element-handle branch 3 times, most recently from c3e0b3f to 0963b08 Compare October 29, 2015 13:33
@krocard krocard added this to the Version 3.1 milestone Oct 30, 2015
@dawagner
Copy link
Contributor

👎 review done

krocard and others added 4 commits November 3, 2015 17:43
Add a static_assert to detect incorrect method usage.

Without it, an error would still occur but might be harder to debug.
Use a human readable error message instead.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Extract a `getSettingsAsBytes` and `setSettingsAsBytes`
method from the corresponding remote command handling.

This permits to access elements a bytes from a c++ interface
without duplicating the code.

Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
This patch pulls the mapping functionality up by one class: it is now
available as part of CConfigurableElement interface.

CConfigurableElementWithMapping is no more necessary so it's been removed.

This patchs allows accessing he mapping functionalities from a
configurable element without the need to know its actual nature (instance
configurable element or subsystem).

Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com>
Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
CElementHandle can be used by applications to directly control an element
part of the parameter tree. CElementHandle objects can be created by calling
the platform connector class new createElementHandle() functionality.
Element handle objects are owned by the application so it's its
responsibility to destroy them through a "delete" operation.

The following functionalities are available in CElementHandle class:
    - getting element's name
    - getting element's path in parameter hierarchy tree
    - getting element's memory size in bytes
    - determining if element is rogue
    - getting the structure of the element (expanded version of the
      structure)
    - getting/setting the element's settings in XML format
    - getting/setting the element's settings in binary format

Notes:
    - setting the element's settings in binary shall be done cautiously:
      no check is made as to the data integrity, meaning the operation
      could result in inconsistent parameter states where some
      parameter values are out of range or invalid wrt their type
    - setting the element's settings will fail if the element is not rogue
      (belong to a domain or one of its descendent does)
    - if a tuning application has set the auto sync mode to off, the
      changes applied through CElementHandle will be forward-synchronized
      when the auto sync mode is set back to on or when the "sync" remote
      command is executed.
    - when the tuning mode is on, calls to setAsXML() and setAsBytes() will
      fail silently (do nothing but return true meaning success)

Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com>
Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
@krocard
Copy link
Contributor Author

krocard commented Nov 3, 2015

main change is: krocard@0f29ce1

@krocard
Copy link
Contributor Author

krocard commented Nov 3, 2015

:shipit:

dawagner added a commit that referenced this pull request Nov 3, 2015
Element handle

CElementHandle can be used by applications to directly control an element part of the parameter tree.

CElementHandle objects can be created by calling the platform connector class new createElementHandle() functionality.
@dawagner dawagner merged commit 5c20c1f into intel:serialization_api Nov 3, 2015
@dawagner dawagner changed the title [review] Element handle Element handle Nov 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants