bioformats  5.1.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* () noexcept
 Dereference to element_type. More...
 
const element_typeoperator* () const noexcept
 Dereference to const element_type. More...
 
element_typeoperator-> () noexcept
 Dereference to element_type. More...
 
const element_typeoperator-> () const noexcept
 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 (ome::compat::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

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).
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
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

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:

template<typename WrappedType, typename Parent>
virtual void ome::common::xml::dom::Wrapper< WrappedType, Parent >::assign ( ome::compat::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 >.

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:

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.
template<typename WrappedType, typename Parent>
element_type& ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator* ( )
inlinenoexcept

Dereference to element_type.

Returns
the wrapped element_type.
template<typename WrappedType, typename Parent>
const element_type& ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator* ( ) const
inlinenoexcept

Dereference to const element_type.

Returns
the wrapped element_type.
template<typename WrappedType, typename Parent>
element_type* ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator-> ( )
inlinenoexcept

Dereference to element_type.

Returns
the wrapped element_type.
template<typename WrappedType, typename Parent>
const element_type* ome::common::xml::dom::Wrapper< WrappedType, Parent >::operator-> ( ) const
inlinenoexcept

Dereference to const element_type.

Returns
the wrapped element_type.
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: