Note: I did this as a way to understand how the Linux code works, and to play with the idea I'd used for a similar job in Mac code. If we feel like this isn't actually an improvement, I'm happy to let it be!
Wrap each AtspiNode's managed AtspiAccessible in a std::shared_ptr
Add AtspiInterface<T> as a superclass for all the Atspi[Type]Interface classes.
Uses std::shared_ptr to manage references to wrapped objects, unref-ing when the Interface object goes out of scope
This means we don't need to worry about whether a particular query_interface method returns a reference to the existing object or a new object
Add some convenience wrappers around std::unique_ptr to call the appropriate free/unref function, used for accessing data on AtspiAccessible interfaces
Note: I did this as a way to understand how the Linux code works, and to play with the idea I'd used for a similar job in Mac code. If we feel like this isn't actually an improvement, I'm happy to let it be!
AtspiNode
's managedAtspiAccessible
in astd::shared_ptr
AtspiInterface<T>
as a superclass for all the Atspi[Type]Interface classes.std::shared_ptr
to manage references to wrapped objects, unref-ing when theInterface
object goes out of scopequery_interface
method returns a reference to the existing object or a new objectstd::unique_ptr
to call the appropriatefree
/unref
function, used for accessing data onAtspiAccessible
interfaces