Share via


TBoundProperty<PropertyType> (Compact 2013)

3/28/2014

This C++ template class represents a property that is a common data type, such as an integer or Boolean value.

Syntax

template<typename PropertyType>
class TBoundProperty : public TBoundPropertyBase<PropertyType, PropertyType>

Inheritance Hierarchy

TBoundPropertyBase<PropertyType,StoreType>

     TBoundProperty<PropertyType>

Parameters

  • PropertyType
    Data type of the property value that this class represents.

Members

The following table lists overloaded operators for this class.

Overloaded Operators

Overloaded operator

Description

TBoundProperty.operator&()

Determines the memory address of an instance of the TBoundProperty<PropertyType> class.

TBoundProperty.operator<(TBoundProperty&)

Determines whether the value contained in a TBoundProperty<PropertyType> object is less than a value in another TBoundProperty<PropertyType> object in a C++ expression.

TBoundProperty.bool operator<=(TBoundProperty&)

Determines whether the value contained in a TBoundProperty<PropertyType> object is less than or equal to a value in another TBoundProperty<PropertyType> object in a C++ expression.

TBoundProperty.operator>(TBoundProperty&)

Determines whether the value encapsulated in a TBoundProperty<PropertyType> object is greater than a value in another TBoundProperty<PropertyType> object in a C++ expression.

TBoundProperty.bool operator>=(TBoundProperty&)

Determines whether the value contained in a TBoundProperty<PropertyType> object is greater than or equal to a value in another TBoundProperty<PropertyType> object in a C++ expression.

TBoundProperty.operator==(TBoundProperty&)

Determines whether the value contained in a TBoundProperty<PropertyType> object and a value in another TBoundProperty<PropertyType> object are equal to each other in a C++ expression.

TBoundProperty.operator!=(TBoundProperty& value)

Determines whether the value contained in a TBoundProperty<PropertyType> object and a value contained in another TBoundProperty<PropertyType> object are different values.

TBoundProperty.operator PropertyType()

Converts a TBoundProperty<PropertyType> object to type PropertyType.

TBoundProperty.bool operator<(PropertyType&)

Determines whether the value contained in the TBoundProperty<PropertyType> object is less than another PropertyType value in a C++ expression.

TBoundProperty.operator<=(PropertyType&)

Determines whether a value contained in a TBoundProperty<PropertyType> object is less than or equal to another PropertyType value in a C++ expression.

TBoundProperty.operator>(PropertyType&)

Determines whether the value contained in a TBoundProperty<PropertyType> object is greater than another PropertyType value in a C++ expression.

TBoundProperty.bool operator>=(PropertyType&)

Determines whether a value contained in a TBoundProperty<PropertyType> object is greater than or equal to another PropertyType value in a C++ expression.

TBoundProperty.operator=(const PropertyType&)

Assigns the PropertyType value of the operand on the right to the TBoundProperty<PropertyType> value of the operand on the left in a C++ expression.

TBoundProperty.operator==(PropertyType&)

Determines whether a value contained in a TBoundProperty<PropertyType> object is equal to another PropertyType value in a C++ expression.

TBoundProperty.bool operator!=(PropertyType&)

Determines whether the value contained in a TBoundProperty<PropertyType> object and another PropertyType value are different.

Thread Safety

Members of this class are not thread safe when you obtain or set its property value by using inherited methods such as TBoundPropertyBase.Get or TBoundPropertyBase.Set(const PropertyType&). When you access the value of a property, implement single threading and block other operations until the update is finished. For example, use XRAutoCriticalSection.

Remarks

By using a TBoundProperty<PropertyType> object to represent a property, you can register it with a TPropertyBag<Derived> object and use TPropertyBag.GetValue(const WCHAR *,XRValue *) and TPropertyBag.SetValue(const WCHAR *,XRValue *) to access and modify the property. Then, you can use its property name to populate a UI element with the value of the property; for example, by calling IXRFrameworkElement::SetBinding.

To specify the property bag that owns the property, call the inherited method iXRPropertyBinding.SetOwner(iXRPropertyBagBinding *).

The TBoundProperty<PropertyType> class provides overloaded operators that you can use in C++ expressions. When you use overloaded operators, you can use either a TBoundProperty<PropertyType> object or its PropertyType data type as the operand on the right.

Note

The values of the inherited template parameters StoreType and PropertyType are identical in a TBoundProperty<PropertyType> object, which is used only for encapsulating common types such as integers or Boolean values that do not require reference counting.

For properties that are object types that require reference counting, use TBoundPointerProperty<PropertyType>.

For properties that are text strings of type BSTR, use TBoundProperty<BSTR>.

Requirements

Header

XRPropertyBag.h

See Also

Reference

Classes for Populating UI Elements with Data
TPropertyBag<Derived>
TBoundPropertyBase<PropertyType,StoreType>