AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant Class Reference

#include <ManagedGVariant.h>

Public Member Functions

 ~ManagedGVariant ()
 
 ManagedGVariant ()
 
 ManagedGVariant (GVariant *variant)
 
GVariant ** asOutputParameter ()
 
GVariant * get ()
 
std::string dumpToString (bool withAnnotations)
 
ManagedGVariant unbox ()
 
bool hasValue ()
 
void swap (ManagedGVariant &other)
 

Detailed Description

A wrapper std::shared class for GLib's GVariant objects. This class is not thread safe. This class does not increase the reference count of the variant, but will descrease it in destructor. Floating references are converted to normal ones effectively extending their lifetime to the lifetime of the ManagedGVariant instance.

Constructor & Destructor Documentation

◆ ~ManagedGVariant()

alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::~ManagedGVariant ( )
inline

Destructor

◆ ManagedGVariant() [1/2]

alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::ManagedGVariant ( )
inline

Default constructor

◆ ManagedGVariant() [2/2]

alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::ManagedGVariant ( GVariant *  variant)
inlineexplicit

A constructor attaching to an existing GVariant*. If variant is a floating reference, it will be converted to normal one, extending its lifetime to the lifetime of the ManagedGVariant instance.

Parameters
variantVariant to be attached.

Member Function Documentation

◆ asOutputParameter()

GVariant ** alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::asOutputParameter ( )
inline

Get a pointer to the internal GVariant* variable

Returns
A pointer to the internal variable holding the GVariant*. The pointer is valid while the ManagedGVariant instance is valid.

◆ dumpToString()

std::string alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::dumpToString ( bool  withAnnotations)
inline

Method that dumps the contents of the wrapped variant to a string. Returns "<NULL>" if no variant attached.

Parameters
withAnnotationstrue if type information should be added to the output
Returns
A string with the textual representation of the variant

◆ get()

GVariant * alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::get ( )
inline

Returns a raw GVariant* attached to this object

Returns
A raw GVariant* attached to this object. This pointer is valid as long as this ManagedGVariant instance if valid.

◆ hasValue()

bool alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::hasValue ( )
inline

A helper conversion operator to allow checking if object has any variant attached

Returns
true if variant is not null

◆ swap()

void alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::swap ( ManagedGVariant other)
inline

Swap the GVariant* values with another instance of ManagedGVariant.

Parameters
other

◆ unbox()

ManagedGVariant alexaClientSDK::bluetoothImplementations::blueZ::ManagedGVariant::unbox ( )
inline

A helper method to extract variant contained in the variant attached to the object. This method is useful when Parsing variant containers where child elements could be boxed into the wrapper variant.

Returns
A variant contained in the variant attached.

The documentation for this class was generated from the following file:

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0