25 #ifndef TBX_VIEWVALUE_H
26 #define TBX_VIEWVALUE_H
47 virtual T
value(
unsigned int index)
const = 0;
72 virtual T
value(
unsigned int index)
const {
return _collection[index];}
87 T (I::*_method)()
const;
95 _collection(collection), _method(method) {}
101 virtual T
value(
unsigned int index)
const
103 return (((*_collection)[index]).*_method)();
119 T (I::*_method)()
const;
127 _collection(collection), _method(method) {}
133 virtual T
value(
unsigned int index)
const
135 return (((*_collection)[index])->*_method)();
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
virtual T value(unsigned int index) const
Return value for given index.
Definition: viewvalue.h:72
Base class to provide a value of a given type for an item view.
Definition: viewvalue.h:40
MethodItemViewValue(C *collection, T(I::*method)() const)
Construct for the given collection with the given data retrieval method.
Definition: viewvalue.h:94
virtual T value(unsigned int index) const =0
Provide the value for the view.
MethodItemPtrViewValue(C *collection, T(I::*method)() const)
Construct for the given collection with the given data retrieval method.
Definition: viewvalue.h:126
Convenience template to return an item of a collection as the value for a view.
Definition: viewvalue.h:59
IndexItemViewValue(const C &collection)
Construct with collection to index.
Definition: viewvalue.h:67
Convenience template to return a member of the class in a collection as the value for a view.
Definition: viewvalue.h:84
virtual T value(unsigned int index) const
Get the value for the index by calling the method from the constructor on the object.
Definition: viewvalue.h:101
Convenience template to return a member of the class in a collection of pointers as the value for a v...
Definition: viewvalue.h:116
virtual T value(unsigned int index) const
Get the value for the index by calling the method from the constructor on the object.
Definition: viewvalue.h:133