ome-common  5.5.0
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ome::common::xml::dom::Wrapper< WrappedType, Parent > Class Template Reference

Xerces DOM class wrapper. More...

#include <ome/common/xml/dom/Wrapper.h>

+ Inheritance diagram for ome::common::xml::dom::Wrapper< WrappedType, Parent >:
+ Collaboration diagram for ome::common::xml::dom::Wrapper< WrappedType, Parent >:

Public Types

typedef Parent parent_type
 Parent type.
 
typedef parent_type::base_type base_type
 Base type.
 
typedef parent_type::base_element_type base_element_type
 Base element type.
 
typedef WrappedType element_type
 Wrapped Xerces element type.
 

Public Member Functions

 Wrapper ()
 Constructor.
 
 Wrapper (const base_type &base)
 Copy construct a Wrapper. More...
 
template<typename Deleter >
 Wrapper (typename parent_type::base_element_type *base, Deleter del)
 Construct a Wrapper from a base_element_type * (managed). More...
 
 Wrapper (typename parent_type::base_element_type *base)
 Construct a Wrapper from a base_element_type * (unmanaged). More...
 
 ~Wrapper ()
 Destructor.
 
element_typeget ()
 Get wrapped element_type *. More...
 
const element_typeget () const
 Get wrapped element_type *. More...
 
Wrapperoperator= (const Wrapper &wrapped)
 Assign a Wrapper. More...
 
element_typeoperator* ()
 Dereference to element_type. More...
 
const element_typeoperator* () const
 Dereference to const element_type. More...
 
element_typeoperator-> ()
 Dereference to element_type. More...
 
const element_typeoperator-> () const
 Dereference to const element_type. More...
 

Protected Member Functions

virtual void assign (const base_type &wrapped)
 Assign a new wrapped value. More...
 
virtual void assign (std::shared_ptr< base_element_type > &wrapped)
 Assign a new wrapped value. More...
 

Private Attributes

element_typewrapped
 The wrapped type.
 

Detailed Description

template<typename WrappedType, typename Parent>
class ome::common::xml::dom::Wrapper< WrappedType, Parent >

Xerces DOM class wrapper.

The wrapper behaves as though is the wrapped DOM type; it can be dereferenced using the "*" or "->" operators to obtain a reference or pointer to the wrapped object. It can also be cast to a pointer to the wrapped object, so can substitute for it directly.

The purpose of this wrapper is to manage the lifetime of DOM types, which would otherwise require manual memory management.

Constructor & Destructor Documentation

◆ Wrapper() [1/3]

template<typename WrappedType, typename Parent>
ome::common::xml::dom::Wrapper< WrappedType, Parent >::Wrapper ( const base_type base)
inline

Copy construct a Wrapper.

Parameters
basethe base type to copy (must be an element_type).

◆ Wrapper() [2/3]

template<typename WrappedType, typename Parent>
template<typename Deleter >
ome::common::xml::dom::Wrapper< WrappedType, Parent >::Wrapper ( typename parent_type::base_element_type *  base,
Deleter  del 
)
inlineexplicit

Construct a Wrapper from a base_element_type * (managed).

Parameters
basethe Wrapper to wrap.
delthe deleter to clean up the wrapped value

◆ Wrapper() [3/3]

template<typename WrappedType, typename Parent>
ome::common::xml::dom::Wrapper< WrappedType, Parent >::Wrapper ( typename parent_type::base_element_type *  base)
inlineexplicit

Construct a Wrapper from a base_element_type * (unmanaged).

Parameters
basethe Wrapper to wrap.

Member Function Documentation

◆ assign() [1/2]

template<typename WrappedType, typename Parent>
virtual void ome::common::xml::dom::Wrapper< WrappedType, Parent >::assign ( const base_type wrapped)
inlineprotectedvirtual

Assign a new wrapped value.

Parameters
wrappedthe new value.

Reimplemented in ome::common::xml::dom::Wrapper< xercesc::DOMElement, Node >, and ome::common::xml::dom::Wrapper< xercesc::DOMDocument, Node >.

Referenced by ome::common::xml::dom::Wrapper< xercesc::DOMDocument, Node >::operator=(), and ome::common::xml::dom::Wrapper< xercesc::DOMDocument, Node >::Wrapper().

+ Here is the caller graph for this function:

◆ assign() [2/2]

template<typename WrappedType, typename Parent>
virtual void ome::common::xml::dom::Wrapper< WrappedType, Parent >::assign ( std::shared_ptr< base_element_type > &  wrapped)
inlineprotectedvirtual

Assign a new wrapped value.

Parameters
wrappedthe new value.

Reimplemented in ome::common::xml::dom::Wrapper< xercesc::DOMElement, Node >, and ome::common::xml::dom::Wrapper< xercesc::DOMDocument, Node >.

◆ get() [1/2]

template<typename WrappedType, typename Parent>
element_type* ome::common::xml::dom::Wrapper< WrappedType, Parent >::get ( )
inline

Get wrapped element_type *.

Note
May be null.
Returns
the wrapped element_type.

Referenced by ome::common::xml::dom::Node::appendChild(), ome::common::xml::dom::writeDocument(), and ome::common::xml::dom::writeNode().

+ Here is the caller graph for this function:

◆ get() [2/2]

template<typename WrappedType, typename Parent>
const element_type* ome::common::xml::dom::Wrapper< WrappedType, Parent >::get ( ) const
inline

Get wrapped element_type *.

Note
May be null.
Returns
the wrapped element_type.

◆ operator*() [1/2]

template<typename WrappedType, typename Parent>
element_type& ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator* ( )
inline

Dereference to element_type.

Returns
the wrapped element_type.

◆ operator*() [2/2]

template<typename WrappedType, typename Parent>
const element_type& ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator* ( ) const
inline

Dereference to const element_type.

Returns
the wrapped element_type.

◆ operator->() [1/2]

template<typename WrappedType, typename Parent>
element_type* ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator-> ( )
inline

Dereference to element_type.

Returns
the wrapped element_type.

◆ operator->() [2/2]

template<typename WrappedType, typename Parent>
const element_type* ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator-> ( ) const
inline

Dereference to const element_type.

Returns
the wrapped element_type.

◆ operator=()

template<typename WrappedType, typename Parent>
Wrapper& ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator= ( const Wrapper< WrappedType, Parent > &  wrapped)
inline

Assign a Wrapper.

Parameters
wrappedthe Wrapper to assign.
Returns
the Wrapper.

Referenced by ome::common::xml::dom::Document::operator=().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: