Stay organized with collections
Save and categorize content based on your preferences.
ndk::SpAIBinder
#include <binder_auto_utils.h>
Represents one strong pointer to an AIBinder object.
Summary
Constructors and Destructors
|
SpAIBinder()
Default constructor.
|
SpAIBinder(AIBinder *binder)
Takes ownership of one strong refcount of binder.
|
SpAIBinder(std::nullptr_t)
Convenience operator for implicitly constructing an SpAIBinder from nullptr.
|
SpAIBinder(const SpAIBinder & other)
This will delete the underlying object if it exists.
|
~SpAIBinder()
This deletes the underlying object if it exists.
|
Public functions
|
get() const
|
AIBinder *
This returns the underlying binder object for transactions.
|
getR()
|
AIBinder **
This allows the value in this class to be set from beneath it.
|
operator=(const SpAIBinder & other)
|
This takes ownership of a binder from another AIBinder object but it does not affect the ownership of that other object.
|
set(AIBinder *binder)
|
void
Takes ownership of one strong refcount of binder.
|
Public functions
SpAIBinder
SpAIBinder(
AIBinder *binder
)
Takes ownership of one strong refcount of binder.
SpAIBinder
SpAIBinder(
std::nullptr_t
)
Convenience operator for implicitly constructing an SpAIBinder from nullptr.
This is not explicit because it is not taking ownership of anything.
SpAIBinder
SpAIBinder(
const SpAIBinder & other
)
This will delete the underlying object if it exists.
See operator=.
get
AIBinder * get() const
This returns the underlying binder object for transactions.
If it is used to create another SpAIBinder object, it should first be incremented.
getR
AIBinder ** getR()
This allows the value in this class to be set from beneath it.
If you call this method and then change the value of T*, you must take ownership of the value you are replacing and add ownership to the object that is put in here.
Recommended use is like this: SpAIBinder a; // will be nullptr SomeInitFunction(a.getR()); // value is initialized with refcount
Other usecases are discouraged.
operator=
SpAIBinder & operator=(
const SpAIBinder & other
)
This takes ownership of a binder from another AIBinder object but it does not affect the ownership of that other object.
set
void set(
AIBinder *binder
)
Takes ownership of one strong refcount of binder.
~SpAIBinder
~SpAIBinder()
This deletes the underlying object if it exists.
See set.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-17 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-17 UTC."],[],[],null,["# ndk::SpAIBinder Class Reference\n\nndk::SpAIBinder\n===============\n\n\n`#include \u003cbinder_auto_utils.h\u003e`\n\nRepresents one strong pointer to an AIBinder object.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SpAIBinder](#classndk_1_1_sp_a_i_binder_1aa622544f836d321f9aba78d175984555)`()` Default constructor. ||\n| [SpAIBinder](#classndk_1_1_sp_a_i_binder_1a29c0c128dbf1b2a53798abbdf531c359)`(AIBinder *binder)` Takes ownership of one strong refcount of binder. ||\n| [SpAIBinder](#classndk_1_1_sp_a_i_binder_1a0a1ecf84003c0f5be4451a0264456eac)`(std::nullptr_t)` Convenience operator for implicitly constructing an [SpAIBinder](/ndk/reference/classndk/1-1-sp-a-i-binder#classndk_1_1_sp_a_i_binder) from nullptr. ||\n| [SpAIBinder](#classndk_1_1_sp_a_i_binder_1aaf18ae344fffedd557aee0812f09cc0f)`(const `[SpAIBinder](/ndk/reference/classndk/1-1-sp-a-i-binder#classndk_1_1_sp_a_i_binder)` & other)` This will delete the underlying object if it exists. ||\n| [~SpAIBinder](#classndk_1_1_sp_a_i_binder_1a999a01ab374ef8e70960b251b77804dc)`()` This deletes the underlying object if it exists. ||\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [get](#classndk_1_1_sp_a_i_binder_1acbaf60c7be6237f6104a079eb9f55433)`() const ` | `AIBinder *` This returns the underlying binder object for transactions. |\n| [getR](#classndk_1_1_sp_a_i_binder_1a4f2eafb716262236e2dc500df6998610)`()` | `AIBinder **` This allows the value in this class to be set from beneath it. |\n| [operator=](#classndk_1_1_sp_a_i_binder_1ad4904a9d8a70a2ca2078daf9321b7d2d)`(const `[SpAIBinder](/ndk/reference/classndk/1-1-sp-a-i-binder#classndk_1_1_sp_a_i_binder)` & other)` | [SpAIBinder](/ndk/reference/classndk/1-1-sp-a-i-binder#classndk_1_1_sp_a_i_binder)` &` This takes ownership of a binder from another AIBinder object but it does not affect the ownership of that other object. |\n| [set](#classndk_1_1_sp_a_i_binder_1a7d8049d65e6c8531a727fc7d72ee6b3d)`(AIBinder *binder)` | `void` Takes ownership of one strong refcount of binder. |\n\nPublic functions\n----------------\n\n### SpAIBinder\n\n```text\n SpAIBinder()\n``` \nDefault constructor. \n\n### SpAIBinder\n\n```scdoc\n SpAIBinder(\n AIBinder *binder\n)\n``` \nTakes ownership of one strong refcount of binder. \n\n### SpAIBinder\n\n```scdoc\n SpAIBinder(\n std::nullptr_t\n)\n``` \nConvenience operator for implicitly constructing an [SpAIBinder](/ndk/reference/classndk/1-1-sp-a-i-binder#classndk_1_1_sp_a_i_binder) from nullptr.\n\nThis is not explicit because it is not taking ownership of anything. \n\n### SpAIBinder\n\n```gdscript\n SpAIBinder(\n const SpAIBinder & other\n)\n``` \nThis will delete the underlying object if it exists.\n\nSee operator=. \n\n### get\n\n```gdscript\nAIBinder * get() const \n``` \nThis returns the underlying binder object for transactions.\n\nIf it is used to create another [SpAIBinder](/ndk/reference/classndk/1-1-sp-a-i-binder#classndk_1_1_sp_a_i_binder) object, it should first be incremented. \n\n### getR\n\n```scdoc\nAIBinder ** getR()\n``` \nThis allows the value in this class to be set from beneath it.\n\nIf you call this method and then change the value of T\\*, you must take ownership of the value you are replacing and add ownership to the object that is put in here.\n\nRecommended use is like this: [SpAIBinder](/ndk/reference/classndk/1-1-sp-a-i-binder#classndk_1_1_sp_a_i_binder) a; // will be nullptr SomeInitFunction(a.getR()); // value is initialized with refcount\n\nOther usecases are discouraged. \n\n### operator=\n\n```gdscript\nSpAIBinder & operator=(\n const SpAIBinder & other\n)\n``` \nThis takes ownership of a binder from another AIBinder object but it does not affect the ownership of that other object. \n\n### set\n\n```scdoc\nvoid set(\n AIBinder *binder\n)\n``` \nTakes ownership of one strong refcount of binder. \n\n### \\~SpAIBinder\n\n```text\n ~SpAIBinder()\n``` \nThis deletes the underlying object if it exists.\n\nSee set."]]