matador::object_view< T > Class Template Reference

Create a view for a concrete serializable type. More...

#include <object_view.hpp>

Public Types

typedef object_view_iterator< T > iterator
 
typedef const_object_view_iterator< T > const_iterator
 
typedef object_ptr< T > pointer
 

Public Member Functions

 object_view (object_store &store, bool skip_siblings=false)
 Creates an object_view.
 
 object_view (const object_view &x)
 Copy construct a view.
 
 object_view (object_view &&x) noexcept
 Copy move constructor.
 
object_viewoperator= (const object_view &x)
 Copy assign view.
 
object_viewoperator= (object_view &&x) noexcept
 Assignment move constructor.
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
pointer front () const
 
pointer back () const
 
bool empty () const
 
size_t size () const
 
void skip_siblings (bool skip)
 Sets the skip siblings flag.
 
template<class Predicate >
const_iterator find_if (Predicate pred) const
 
template<class Predicate >
iterator find_if (Predicate pred)
 
const prototype_nodenode () const
 

Detailed Description

template<class T>
class matador::object_view< T >

Create a view for a concrete serializable type.

Template Parameters
TThe type of the object_view.

The object_view class creates a view over an serializable type. 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

◆ const_iterator

template<class T >
typedef const_object_view_iterator<T> matador::object_view< T >::const_iterator

Shortcut to the const_iterator type

◆ iterator

template<class T >
typedef object_view_iterator<T> matador::object_view< T >::iterator

Shortcut to the iterator type

◆ pointer

template<class T >
typedef object_ptr<T> matador::object_view< T >::pointer

Shortcut to serializable pointer

Constructor & Destructor Documentation

◆ object_view() [1/3]

template<class T >
matador::object_view< T >::object_view ( object_store store,
bool  skip_siblings = false 
)
inlineexplicit

Creates an object_view.

Creates an object_view over the given template type T within the given object_store. When the skip_siblings flag is true, the view only has serializable of type T.

Parameters
storeThe object_store containing the objects.
skip_siblingsIf true only objects of concrete type T are part of the view.

◆ object_view() [2/3]

template<class T >
matador::object_view< T >::object_view ( const object_view< T > &  x)
inline

Copy construct a view.

Parameters
xobject_view to be copied

◆ object_view() [3/3]

template<class T >
matador::object_view< T >::object_view ( object_view< T > &&  x)
inlinenoexcept

Copy move constructor.

Parameters
xobject_view to be moved

Member Function Documentation

◆ back()

template<class T >
pointer matador::object_view< T >::back ( ) const
inline

Return the very last pointer of the object_view.

Returns
The last pointer of the view.

◆ begin() [1/2]

template<class T >
iterator matador::object_view< T >::begin ( )
inline

Return the begin of the object_view.

Returns
The begin iterator.

◆ begin() [2/2]

template<class T >
const_iterator matador::object_view< T >::begin ( ) const
inline

Return the begin of the object_view.

Returns
The begin iterator.

◆ empty()

template<class T >
bool matador::object_view< T >::empty ( ) const
inline

Returns true if the object_view is empty.

Returns
True if object_view is empty.

◆ end() [1/2]

template<class T >
iterator matador::object_view< T >::end ( )
inline

Return the end of the object_view.

Returns
The end iterator.

◆ end() [2/2]

template<class T >
const_iterator matador::object_view< T >::end ( ) const
inline

Return the end of the object_view.

Returns
The end iterator.

◆ find_if() [1/2]

template<class T >
template<class Predicate >
iterator matador::object_view< T >::find_if ( Predicate  pred)
inline

Find serializable which matches the given condition

Template Parameters
PredicateThe type for the find predicate
Parameters
predThe find predicate
Returns
The first iterator with the serializable matching the condition.

◆ find_if() [2/2]

template<class T >
template<class Predicate >
const_iterator matador::object_view< T >::find_if ( Predicate  pred) const
inline

Find serializable which matches the given condition

Template Parameters
PredicateThe type for the find predicate
Parameters
predThe find predicate
Returns
The first iterator with the serializable matching the condition.

◆ front()

template<class T >
pointer matador::object_view< T >::front ( ) const
inline

Return the very first pointer of the object_view.

Returns
The first pointer of the view.

◆ node()

template<class T >
const prototype_node * matador::object_view< T >::node ( ) const
inline

Return the underlaying prototype node

Returns
The underlaying prototype node.

◆ operator=() [1/2]

template<class T >
object_view & matador::object_view< T >::operator= ( const object_view< T > &  x)
inline

Copy assign view.

Parameters
xobject_view to be copied
Returns
Reference to this object_view

◆ operator=() [2/2]

template<class T >
object_view & matador::object_view< T >::operator= ( object_view< T > &&  x)
inlinenoexcept

Assignment move constructor.

Parameters
xobject_view to be moved
Returns
Reference to this object_view

◆ size()

template<class T >
size_t matador::object_view< T >::size ( ) const
inline

Return the size of the object_view.

Returns
The size of the object_view.

◆ skip_siblings()

template<class T >
void matador::object_view< T >::skip_siblings ( bool  skip)
inline

Sets the skip siblings flag.

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

Parameters
skipSkips siblings when true.

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