Creates a generic view of a concrete object type. More...
#include <object_view.hpp>
Public Types | |
typedef object_view_iterator < object > | iterator |
typedef const_object_view_iterator < object > | const_iterator |
typedef object_ptr< object > | object_pointer |
Public Member Functions | |
generic_view (const std::string &type, const object_store &ostore, bool skip_siblings=false) | |
Creates an generic_view. More... | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
object_pointer | front () const |
object_pointer | back () const |
bool | empty () const |
size_t | size () const |
void | skip_siblings (bool skip) |
Sets the skip siblings flag. More... | |
template<class Predicate > | |
const_iterator | find_if (Predicate pred) const |
template<class Predicate > | |
iterator | find_if (Predicate pred) |
prototype_iterator | node () const |
Detailed Description
Creates a generic view of a concrete object type.
The generic_view class creates a generic view over an object type without casting the object to the concrete type. The class deals with the base class oos::object. When creating it is possible to have the view only over the given type or over the complete subset of objects including child objects.
Member Typedef Documentation
typedef const_object_view_iterator<object> oos::generic_view::const_iterator |
Shortcut to the const_iterator type
typedef object_view_iterator<object> oos::generic_view::iterator |
Shortcut to the iterator type
Shortcut to object pointer
Constructor & Destructor Documentation
|
inline |
Creates an generic_view.
Creates an generic_view over the given object type provided by the type string within the given object_store. When the skip_siblings flag is true, the view only has object of the given type.
- Parameters
-
type The type of the object. ostore The object_store containing the objects. skip_siblings If true only objects of the concrete type are part of the view.
Member Function Documentation
|
inline |
Return the very last object_ptr of the generic_view.
- Returns
- The last object_ptr of the view.
|
inline |
Return the begin of the generic_view.
- Returns
- The begin iterator.
|
inline |
Return the begin of the generic_view.
- Returns
- The begin iterator.
|
inline |
Returns true if the generic_view is empty.
- Returns
- True if object_view is empty.
|
inline |
Return the end of the generic_view.
- Returns
- The end iterator.
|
inline |
Return the end of the generic_view.
- Returns
- The end iterator.
|
inline |
Find object which matches the given condition
- Template Parameters
-
Predicate The type for the find predicate
- Parameters
-
pred The find predicate
- Returns
- The first iterator with the object matching the condition.
|
inline |
Find object which matches the given condition
- Template Parameters
-
Predicate The type for the find predicate
- Parameters
-
pred The find predicate
- Returns
- The first iterator with the object matching the condition.
|
inline |
Return the very first object_ptr of the generic_view.
- Returns
- The first object_ptr of the view.
|
inline |
Return the underlaying prototype node
- Returns
- The underlaying prototype node.
|
inline |
Return the size of the generic_view.
- Returns
- The size of the generic_view.
|
inline |
Sets the skip siblings flag.
When set to true all objects which are not of the concrete type are omitted.
- Parameters
-
skip Skips siblings when true.
The documentation for this class was generated from the following file:
- object/object_view.hpp