VisualIB  1.0
IBExpress library for making use of Borland IBExpress outside of C++Builder
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
VIB::ArrayProperty< T, A > Class Template Reference

ArrayProperty extends Property with an array access operator, for properties which behave like C arrays or collections. More...

#include <VIBProperties.h>

Inheritance diagram for VIB::ArrayProperty< T, A >:
VIB::Property< T >

Public Member Functions

 ArrayProperty ()
 Default constructor, you must initialize get and set later.
 
 ArrayProperty (const Getter &pGet, const Setter &pSet)
 Provide get and set callbacks at instantiation.
 
operator[] (int i)
 Array access operator.
 
- Public Member Functions inherited from VIB::Property< T >
 Property ()
 Default constructor, you must initialize get and set later.
 
 Property (const Getter &pGet, const Setter &pSet)
 Full constructor.
 
void initCallbacks (const Getter &pGet, const Setter &pSet)
 Late-initialize the callbacks, or change their values at runtime.
 
 operator T ()
 Cast operator, invokes get() and returns its value.
 
Property< T > & operator= (const T &nv)
 Assignment operator, invokes set with the provided value, returns this object.
 
operator-> ()
 Invokes get, assuming it returns a pointer that can be used with the deref-access arrow operator.
 

Additional Inherited Members

- Protected Types inherited from VIB::Property< T >
typedef std::function< T(void)> Getter
 The type of a Property Getter method.
 
typedef std::function< void(const
T &)> 
Setter
 The type of a Property Setter method.
 
- Protected Attributes inherited from VIB::Property< T >
Getter get
 The getter method; typically, a this-capturing lambda function.
 
Setter set
 The setter method; typically, a this-capturing lambda function.
 

Detailed Description

template<typename T, typename A>
class VIB::ArrayProperty< T, A >

ArrayProperty extends Property with an array access operator, for properties which behave like C arrays or collections.

It is possible to use this recursively to create multidimensional property arrays.

Template Parameters
TBasic type or structure/class type to wrap.
Parameters
ABasic type or structure/class type of elements in the array.

Constructor & Destructor Documentation

template<typename T, typename A>
VIB::ArrayProperty< T, A >::ArrayProperty ( const Getter pGet,
const Setter pSet 
)
inline

Provide get and set callbacks at instantiation.

Parameters
[in]pGetPointer to a getter function; typically, a this-capturing lambda.
[in]pSetPointer to a setter function; typically, a this-capturing lambda.

Member Function Documentation

template<typename T, typename A>
A VIB::ArrayProperty< T, A >::operator[] ( int  i)
inline

Array access operator.

Calls the getter callback of this object, and then invokes the underlying object's operator [] using the input index. It must return template type A.

Parameters
[in]iIndex of the item in the array to obtain.

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