C++/Tree Mapping Hello World Example
List of all members
hello_t Class Reference

Class corresponding to the hello_t schema type. More...

#include <hello.hxx>

Inheritance diagram for hello_t:
xsd::cxx::tree::_type

greeting

Accessor and modifier functions for the greeting required element.

The greeting element contains the greeting phrase for this hello object.

typedef ::xml_schema::string greeting_type
 Element type.
 
typedef ::xsd::cxx::tree::traits< greeting_type, char > greeting_traits
 Element traits type.
 
const greeting_typegreeting () const
 Return a read-only (constant) reference to the element.
 
greeting_typegreeting ()
 Return a read-write reference to the element.
 
void greeting (const greeting_type &x)
 Set the element value.
 
void greeting (::std::unique_ptr< greeting_type > p)
 Set the element value without copying.
 

name

Accessor and modifier functions for the name sequence element.

The name elements contains names to be greeted.

typedef ::xml_schema::string name_type
 Element type.
 
typedef ::xsd::cxx::tree::sequence< name_typename_sequence
 Element sequence container type.
 
typedef name_sequence::iterator name_iterator
 Element iterator type.
 
typedef name_sequence::const_iterator name_const_iterator
 Element constant iterator type.
 
typedef ::xsd::cxx::tree::traits< name_type, char > name_traits
 Element traits type.
 
const name_sequencename () const
 Return a read-only (constant) reference to the element sequence.
 
name_sequencename ()
 Return a read-write reference to the element sequence.
 
void name (const name_sequence &s)
 Copy elements from a given sequence.
 

Constructors

 hello_t (const greeting_type &)
 Create an instance from the ultimate base and initializers for required elements and attributes.
 
 hello_t (const ::xercesc::DOMElement &e, ::xml_schema::flags f=0, ::xml_schema::container *c=0)
 Create an instance from a DOM element.
 
 hello_t (const hello_t &x, ::xml_schema::flags f=0, ::xml_schema::container *c=0)
 Copy constructor.
 
virtual hello_t_clone (::xml_schema::flags f=0, ::xml_schema::container *c=0) const
 Copy the instance polymorphically.
 
hello_toperator= (const hello_t &x)
 Copy assignment operator.
 
virtual ~hello_t ()
 Destructor.
 

Additional Inherited Members

- Public Member Functions inherited from xsd::cxx::tree::_type
 _type (const C *s)
 
 _type (const type &x, flags f=0, container *c=0)
 
virtual type_clone (flags f=0, container *c=0) const
 
 _type (istream< S > &s, flags f=0, container *c=0)
 
 _type (const xercesc::DOMElement &e, flags f=flags::extract_content, container *c=0)
 
 _type (const xercesc::DOMAttr &a, flags f=0, container *c=0)
 
 _type (const std::basic_string< C > &s, const xercesc::DOMElement *e, flags f=0, container *c=0)
 
typeoperator= (const type &x)
 
const dom_content_optionaldom_content () const
 
dom_content_optionaldom_content ()
 
void dom_content (const xercesc::DOMElement &e)
 
void dom_content (xercesc::DOMElement *e)
 
void dom_content (const dom_content_optional &d)
 
const xercesc::DOMDocument & dom_content_document () const
 
xercesc::DOMDocument & dom_content_document ()
 
bool null_content () const
 
const container_container () const
 
container_container ()
 
virtual void _container (container *c)
 
const container_root () const
 
container_root ()
 
const xercesc::DOMNode * _node () const
 
xercesc::DOMNode * _node ()
 
void _node (xercesc::DOMNode *n)
 

Detailed Description

Class corresponding to the hello_t schema type.

The hello_t type consists of a greeting phrase and a collection of names to which this greeting applies.

Constructor & Destructor Documentation

◆ hello_t() [1/2]

hello_t::hello_t ( const ::xercesc::DOMElement &  e,
::xml_schema::flags  f = 0,
::xml_schema::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.

◆ hello_t() [2/2]

hello_t::hello_t ( const hello_t x,
::xml_schema::flags  f = 0,
::xml_schema::container c = 0 
)

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.

Member Function Documentation

◆ _clone()

virtual hello_t * hello_t::_clone ( ::xml_schema::flags  f = 0,
::xml_schema::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.

◆ greeting() [1/4]

greeting_type & hello_t::greeting ( )

Return a read-write reference to the element.

Returns
A reference to the element.

◆ greeting() [2/4]

const greeting_type & hello_t::greeting ( ) const

Return a read-only (constant) reference to the element.

Returns
A constant reference to the element.

◆ greeting() [3/4]

void hello_t::greeting ( ::std::unique_ptr< greeting_type p)

Set the element value without copying.

Parameters
pA new value to use.

This function will try to use the passed value directly instead of making a copy.

◆ greeting() [4/4]

void hello_t::greeting ( const greeting_type x)

Set the element value.

Parameters
xA new value to set.

This function makes a copy of its argument and sets it as the new value of the element.

◆ name() [1/3]

name_sequence & hello_t::name ( )

Return a read-write reference to the element sequence.

Returns
A reference to the sequence container.

◆ name() [2/3]

const name_sequence & hello_t::name ( ) const

Return a read-only (constant) reference to the element sequence.

Returns
A constant reference to the sequence container.

◆ name() [3/3]

void hello_t::name ( const name_sequence s)

Copy elements from a given sequence.

Parameters
sA sequence to copy elements from.

For each element in s this function makes a copy and adds it to the sequence. Note that this operation completely changes the sequence and all old elements will be lost.

◆ operator=()

hello_t & hello_t::operator= ( const hello_t x)

Copy assignment operator.

Parameters
xAn instance to make a copy of.
Returns
A reference to itself.

For polymorphic object models use the _clone function instead.


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

Copyright © 2005-2023 Code Synthesis.