oos::generic_view Class Reference

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< objectobject_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

oos::generic_view::generic_view ( const std::string &  type,
const object_store ostore,
bool  skip_siblings = false 
)
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
typeThe type of the object.
ostoreThe object_store containing the objects.
skip_siblingsIf true only objects of the concrete type are part of the view.

Member Function Documentation

object_pointer oos::generic_view::back ( ) const
inline

Return the very last object_ptr of the generic_view.

Returns
The last object_ptr of the view.
iterator oos::generic_view::begin ( )
inline

Return the begin of the generic_view.

Returns
The begin iterator.
const_iterator oos::generic_view::begin ( ) const
inline

Return the begin of the generic_view.

Returns
The begin iterator.
bool oos::generic_view::empty ( ) const
inline

Returns true if the generic_view is empty.

Returns
True if object_view is empty.
iterator oos::generic_view::end ( )
inline

Return the end of the generic_view.

Returns
The end iterator.
const_iterator oos::generic_view::end ( ) const
inline

Return the end of the generic_view.

Returns
The end iterator.
template<class Predicate >
const_iterator oos::generic_view::find_if ( Predicate  pred) const
inline

Find object which matches the given condition

Template Parameters
PredicateThe type for the find predicate
Parameters
predThe find predicate
Returns
The first iterator with the object matching the condition.
template<class Predicate >
iterator oos::generic_view::find_if ( Predicate  pred)
inline

Find object which matches the given condition

Template Parameters
PredicateThe type for the find predicate
Parameters
predThe find predicate
Returns
The first iterator with the object matching the condition.
object_pointer oos::generic_view::front ( ) const
inline

Return the very first object_ptr of the generic_view.

Returns
The first object_ptr of the view.
prototype_iterator oos::generic_view::node ( ) const
inline

Return the underlaying prototype node

Returns
The underlaying prototype node.
size_t oos::generic_view::size ( ) const
inline

Return the size of the generic_view.

Returns
The size of the generic_view.
void oos::generic_view::skip_siblings ( bool  skip)
inline

Sets the skip siblings flag.

When set to true all objects which are not of the concrete type are omitted.

Parameters
skipSkips siblings when true.

The documentation for this class was generated from the following file:
  • object/object_view.hpp