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

Base of the DOM wrapper hierarchy. More...

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

+ Inheritance diagram for ome::common::xml::dom::Base< T >:

Public Types

typedef Base base_type
 Base type.
 
typedef T base_element_type
 Base element type (root type of the wrapped type).
 

Public Member Functions

 Base ()
 Constructor.
 
template<typename Deleter >
 Base (base_element_type *wrapped, Deleter del)
 Construct with initial wrapped value (managed). More...
 
 Base (base_element_type *wrapped)
 Construct with initial wrapped value (unmanaged). More...
 
virtual ~Base ()
 Destructor.
 
base_element_typeget ()
 Get wrapped base_element_type *. More...
 
const base_element_typeget () const
 Get wrapped base_element_type *. More...
 
 operator bool () const
 Check if the wrapped type is not null. More...
 
bool operator== (std::nullptr_t) const
 Check if the wrapped type is null. More...
 
bool operator!= (std::nullptr_t) const
 Check if the wrapped type is not null. More...
 
void reset ()
 Free the managed resource. More...
 

Protected Member Functions

virtual void null_check () const
 Check if the wrapped type is null. More...
 
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...
 
template<typename D >
D * assign_check (base_element_type *newbase)
 Check that a new wrapped value is of the correct derived type. More...
 

Private Attributes

std::shared_ptr< base_element_typebase
 Wrapped reference.
 

Detailed Description

template<typename T>
class ome::common::xml::dom::Base< T >

Base of the DOM wrapper hierarchy.

This contains the managed or unmanaged base pointer to the wrapped type.

Constructor & Destructor Documentation

◆ Base() [1/2]

template<typename T>
template<typename Deleter >
ome::common::xml::dom::Base< T >::Base ( base_element_type wrapped,
Deleter  del 
)
inlineexplicit

Construct with initial wrapped value (managed).

Parameters
wrappedthe value to wrap.
delthe deleter to clean up the wrapped value.

◆ Base() [2/2]

template<typename T>
ome::common::xml::dom::Base< T >::Base ( base_element_type wrapped)
inlineexplicit

Construct with initial wrapped value (unmanaged).

Parameters
wrappedthe value to wrap.

Member Function Documentation

◆ assign() [1/2]

template<typename T>
virtual void ome::common::xml::dom::Base< T >::assign ( const base_type wrapped)
inlineprotectedvirtual

◆ assign() [2/2]

template<typename T>
virtual void ome::common::xml::dom::Base< T >::assign ( std::shared_ptr< base_element_type > &  wrapped)
inlineprotectedvirtual

◆ assign_check()

template<typename T>
template<typename D >
D* ome::common::xml::dom::Base< T >::assign_check ( base_element_type newbase)
inlineprotected

Check that a new wrapped value is of the correct derived type.

Intended for use by derivied classes.

Parameters
newbasethe new value.
Returns
the value cast to the derived type.
Exceptions
astd::logic_error if not of the specified type.

◆ get() [1/2]

template<typename T>
base_element_type* ome::common::xml::dom::Base< T >::get ( )
inline

Get wrapped base_element_type *.

Note
May be null.
Returns
the wrapped base_element_type.

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

+ Here is the caller graph for this function:

◆ get() [2/2]

template<typename T>
const base_element_type* ome::common::xml::dom::Base< T >::get ( ) const
inline

Get wrapped base_element_type *.

Note
May be null.
Returns
the wrapped base_element_type.

◆ null_check()

template<typename T>
virtual void ome::common::xml::dom::Base< T >::null_check ( ) const
inlineprotectedvirtual

Check if the wrapped type is null.

Exceptions
astd::logic_error if null.

◆ operator bool()

template<typename T>
ome::common::xml::dom::Base< T >::operator bool ( ) const
inline

Check if the wrapped type is not null.

Returns
true if not null, false if null.

◆ operator!=()

template<typename T>
bool ome::common::xml::dom::Base< T >::operator!= ( std::nullptr_t  ) const
inline

Check if the wrapped type is not null.

Returns
true if not null, false if null.

◆ operator==()

template<typename T>
bool ome::common::xml::dom::Base< T >::operator== ( std::nullptr_t  ) const
inline

Check if the wrapped type is null.

Returns
true if null, false if not null.

◆ reset()

template<typename T>
void ome::common::xml::dom::Base< T >::reset ( )
inline

Free the managed resource.

The managed resource will be freed and made null.


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