lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Container class that may be used to store information on class / object properties. More...
#include <property_collection.h>
Classes | |
class | inplace_builder |
Allows for fully inplace construction of whole property collections. More... | |
Public Types | |
typedef Description | property_desc |
Property description type. | |
typedef property_vector::const_iterator | iterator |
Iterator type. | |
typedef property_vector::const_iterator | const_iterator |
Iterator type. | |
Public Member Functions | |
property_collection () | |
Constructs an empty property collection. | |
template<class Iterator > | |
property_collection (Iterator begin, Iterator end) | |
Constructs a property collection inheriting the given set of properties. | |
template<class Range > | |
property_collection (const Range &range) | |
Constructs a property collection inheriting the given set of properties. | |
property_collection (inplace_builder<> &right) | |
Moves the contents of the given collection to this collection. | |
LEAN_INLINE property_collection & | operator= (inplace_builder<> &right) |
Moves the contents of the given collection to this collection. | |
LEAN_INLINE size_t | add (const property_desc &propertyDesc) |
Adds a property created from the given property description. | |
LEAN_INLINE const property_desc & | desc (size_t id) const |
Gets the property description for the given ID, access violation on failure. | |
LEAN_INLINE size_t | count () const |
Gets the number of properties stored by this collection. | |
LEAN_INLINE const property_desc * | data () const |
Gets a data pointer to the first property description. | |
LEAN_INLINE const property_desc * | data_end () const |
Gets a data pointer one past the last property description. | |
LEAN_INLINE const_iterator | begin () const |
Gets a const iterator to the first property description. | |
LEAN_INLINE const_iterator | end () const |
Gets a const iterator one past the last property description. | |
template<class Value > | |
LEAN_INLINE bool | set (Class &object, size_t id, const Value &value) const |
Assigns the given value to the property identified by the given id, fails silently returning false. | |
template<class Value > | |
LEAN_INLINE bool | set (Class &object, size_t id, const Value *values, size_t count) const |
Assigns the given values to the property identified by the given id, fails silently returning false. | |
template<class Value > | |
LEAN_INLINE bool | get (const Class &object, size_t id, Value &value) const |
Reads a value from the property identified by the given id, fails silently returning false. | |
template<class Value > | |
LEAN_INLINE bool | get (const Class &object, size_t id, Value *values, size_t count) const |
Reads values from the property identified by the given id, fails silently returning false. | |
Static Public Member Functions | |
static LEAN_INLINE inplace_builder | construct_inplace () |
Constructs a new temporary collection that may be filled using operator <<. | |
template<class Iterator > | |
static LEAN_INLINE inplace_builder | construct_inplace (Iterator begin, Iterator end) |
Constructs a new temporary collection that may be filled using operator <<. | |
template<class Range > | |
static LEAN_INLINE inplace_builder | construct_inplace (const Range &range) |
Constructs a new temporary collection that may be filled using operator <<. |
Container class that may be used to store information on class / object properties.