C++/Tree Mapping Runtime Library
Public Types | List of all members
idref< C, B, T > Class Template Reference

Class corresponding to the XML Schema IDREF built-in type. More...

#include <types.hxx>

Inheritance diagram for idref< C, B, T >:

Public Types

typedef T ref_type
 Referenced type.
 

Constructors

typedef void(idref::* bool_convertible) ()
 Opaque type that can be evaluated as true or false.
 
 idref (const C *s)
 Initialize an instance with a copy of a C string.
 
 idref (const C *s, std::size_t n)
 Initialize an instance with a character array.
 
 idref (std::size_t n, C c)
 Initialize an instance with multiple copies of the same character.
 
 idref (const std::basic_string< C > &s)
 Initialize an instance with a copy of a standard string.
 
 idref (const std::basic_string< C > &s, std::size_t pos, std::size_t n=std::basic_string< C >::npos)
 Initialize an instance with a copy of a substring.
 
 idref (const idref &x, flags f=0, container *c=0)
 Copy constructor.
 
virtual idref_clone (flags f=0, container *c=0) const
 Copy the instance polymorphically.
 
template<typename S >
 idref (istream< S > &s, flags f=0, container *c=0)
 Create an instance from a data representation stream.
 
 idref (const xercesc::DOMElement &e, flags f=0, container *c=0)
 Create an instance from a DOM element.
 
 idref (const xercesc::DOMAttr &a, flags f=0, container *c=0)
 Create an instance from a DOM Attribute.
 
 idref (const std::basic_string< C > &s, const xercesc::DOMElement *e, flags f=0, container *c=0)
 Create an instance from a string fragment.
 
idrefoperator= (C c)
 Assign a character to the instance.
 
idrefoperator= (const C *s)
 Assign a C string to the instance.
 
idrefoperator= (const std::basic_string< C > &s)
 Assign a standard string to the instance.
 
idrefoperator= (const idref &x)
 Copy assignment operator.
 
const ref_typeoperator-> () const
 Call referenced object.
 
ref_typeoperator-> ()
 Call referenced object.
 
const ref_typeoperator* () const
 Dereference referenced object.
 
ref_typeoperator* ()
 Dereference referenced object.
 
const ref_typeget () const
 Get a constant pointer to the referenced object.
 
ref_typeget ()
 Get a pointer to the referenced object.
 
 operator bool_convertible () const
 Implicit conversion to boolean type.
 

Detailed Description

template<typename C, typename B, typename T>
class xsd::cxx::tree::idref< C, B, T >

Class corresponding to the XML Schema IDREF built-in type.

The idref class publicly inherits from and has the same set of constructors as std::basic_string. It therefore can be used as std::string (or std::wstring if you are using wchar_t as the character type).

The idref class also provides an autopointer-like interface for resolving referenced objects. By default the object is returned as type (mapping for anyType) but statically-typed idref can be created using the XML Schema extension. See the C++/Tree Mapping User Manual for more information.

Constructor & Destructor Documentation

◆ idref() [1/10]

template<typename C , typename B , typename T >
idref ( const C *  s)
inline

Initialize an instance with a copy of a C string.

Parameters
sA C string to copy.

◆ idref() [2/10]

template<typename C , typename B , typename T >
idref ( const C *  s,
std::size_t  n 
)
inline

Initialize an instance with a character array.

Parameters
sA character array to copy.
nA number of character to copy.

◆ idref() [3/10]

template<typename C , typename B , typename T >
idref ( std::size_t  n,
c 
)
inline

Initialize an instance with multiple copies of the same character.

Parameters
nA number of copies to create.
cA character to copy.

◆ idref() [4/10]

template<typename C , typename B , typename T >
idref ( const std::basic_string< C > &  s)
inline

Initialize an instance with a copy of a standard string.

Parameters
sA standard string to copy.

◆ idref() [5/10]

template<typename C , typename B , typename T >
idref ( const std::basic_string< C > &  s,
std::size_t  pos,
std::size_t  n = std::basic_string<C>::npos 
)
inline

Initialize an instance with a copy of a substring.

Parameters
sA standard string to copy the substring from.
posAn index of the first character to copy from.
nA number of characters to copy.

◆ idref() [6/10]

template<typename C , typename B , typename T >
idref ( const idref< C, B, T > &  x,
flags  f = 0,
container c = 0 
)
inline

Copy constructor.

Parameters
xAn instance to make a copy of.
fFlags to create the copy with.
cA pointer to the object that will contain the copy.

For polymorphic object models use the _clone function instead.

◆ idref() [7/10]

template<typename C , typename B , typename T >
template<typename S >
idref ( istream< S > &  s,
flags  f = 0,
container c = 0 
)

Create an instance from a data representation stream.

Parameters
sA stream to extract the data from.
fFlags to create the new instance with.
cA pointer to the object that will contain the new instance.

◆ idref() [8/10]

template<typename C , typename B , typename T >
idref ( const xercesc::DOMElement &  e,
flags  f = 0,
container c = 0 
)

Create an instance from a DOM element.

Parameters
eA DOM element to extract the data from.
fFlags to create the new instance with.
cA pointer to the object that will contain the new instance.

◆ idref() [9/10]

template<typename C , typename B , typename T >
idref ( const xercesc::DOMAttr &  a,
flags  f = 0,
container c = 0 
)

Create an instance from a DOM Attribute.

Parameters
aA DOM attribute to extract the data from.
fFlags to create the new instance with.
cA pointer to the object that will contain the new instance.

◆ idref() [10/10]

template<typename C , typename B , typename T >
idref ( const std::basic_string< C > &  s,
const xercesc::DOMElement *  e,
flags  f = 0,
container c = 0 
)

Create an instance from a string fragment.

Parameters
sA string fragment to extract the data from.
eA pointer to DOM element containing the string fragment.
fFlags to create the new instance with.
cA pointer to the object that will contain the new instance.

Member Function Documentation

◆ _clone()

template<typename C , typename B , typename T >
virtual idref * _clone ( flags  f = 0,
container c = 0 
) const
virtual

Copy the instance polymorphically.

Parameters
fFlags to create the copy with.
cA pointer to the object that will contain the copy.
Returns
A pointer to the dynamically allocated copy.

This function ensures that the dynamic type of the instance is used for copying and should be used for polymorphic object models instead of the copy constructor.

◆ operator=() [1/4]

template<typename C , typename B , typename T >
idref & operator= ( c)
inline

Assign a character to the instance.

The resulting idref has only one character.

Parameters
cA character to assign.
Returns
A reference to the instance.

◆ operator=() [2/4]

template<typename C , typename B , typename T >
idref & operator= ( const C *  s)
inline

Assign a C string to the instance.

The resulting idref contains a copy of the C string.

Parameters
sA C string to assign.
Returns
A reference to the instance.

◆ operator=() [3/4]

template<typename C , typename B , typename T >
idref & operator= ( const std::basic_string< C > &  s)
inline

Assign a standard string to the instance.

The resulting idref contains a copy of the standard string.

Parameters
sA standard string to assign.
Returns
A reference to the instance.

◆ operator=() [4/4]

template<typename C , typename B , typename T >
idref & operator= ( const idref< C, B, T > &  x)
inline

Copy assignment operator.

Parameters
xAn instance to assign.
Returns
A reference to the instance.

◆ operator->() [1/2]

template<typename C , typename B , typename T >
const ref_type * operator-> ( ) const
inline

Call referenced object.

Returns
A constant pointer to the referenced object.

References idref< C, B, T >::get().

◆ operator->() [2/2]

template<typename C , typename B , typename T >
ref_type * operator-> ( )
inline

Call referenced object.

Returns
A pointer to the referenced object.

References idref< C, B, T >::get().

◆ operator*() [1/2]

template<typename C , typename B , typename T >
const ref_type & operator* ( ) const
inline

Dereference referenced object.

Returns
A constant C++ reference to the referenced object.

References idref< C, B, T >::get().

◆ operator*() [2/2]

template<typename C , typename B , typename T >
ref_type & operator* ( )
inline

Dereference referenced object.

Returns
A C++ reference to the referenced object.

References idref< C, B, T >::get().

◆ get() [1/2]

template<typename C , typename B , typename T >
const ref_type * get ( ) const
inline

Get a constant pointer to the referenced object.

Returns
A constant pointer to the referenced object or 0 if the object of this type is not found.

Referenced by idref< C, B, T >::operator*(), idref< C, B, T >::operator*(), idref< C, B, T >::operator->(), and idref< C, B, T >::operator->().

◆ get() [2/2]

template<typename C , typename B , typename T >
ref_type * get ( )
inline

Get a pointer to the referenced object.

Returns
A pointer to the referenced object or 0 if the object of this type is not found.

◆ operator bool_convertible()

template<typename C , typename B , typename T >
operator bool_convertible ( ) const
inline

Implicit conversion to boolean type.

Returns
True if the referenced object is found, false otherwise.

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

Copyright © 2005-2023 Code Synthesis.