ome-common 5.3.2

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 >:
[legend]
Collaboration diagram for ome::common::xml::dom::Wrapper< WrappedType, Parent >:
[legend]

## 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_type * | get ()
| Get wrapped element_type *. More...
const element_type * | get () const
| Get wrapped element_type *. More...
Wrapper & | operator= (const Wrapper &wrapped)
| Assign a Wrapper. More...
element_type & | operator* () noexcept
| Dereference to element_type. More...
const element_type & | operator* () const noexcept
| Dereference to const element_type. More...
element_type * | operator-> () noexcept
| Dereference to element_type. More...
const element_type * | operator-> () 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_type * | wrapped
| 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

  base | the 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

  base | the Wrapper to wrap.
  del | the 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

  base | the 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

  wrapped | the 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 | ( | ome::compat::shared_ptr< base_element_type > & | wrapped | ) |
| inlineprotectedvirtual

Assign a new wrapped value.

Parameters

  wrapped | the 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* | ( |  | ) |
| inlinenoexcept

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

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-> | ( |  | ) |
| inlinenoexcept

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

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

  wrapped | the 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:

- ome/common/xml/dom/Wrapper.h