te::xsd::Choice Class Reference

This class models the XML Schema choice element. More...

#include <Choice.h>

Inheritance diagram for te::xsd::Choice:
te::xsd::Content te::xsd::Occurs te::xsd::Identifiable te::xsd::Annotated

Public Member Functions

void addAny (Any *a)
 It adds an any to this Choice element. More...
 
void addContent (Content *c)
 It adds a Content element to this Choice element. More...
 
void addElement (Element *e)
 It adds an element to this Choice element. More...
 
 Choice (unsigned int minOccurs=1, unsigned int maxOccurs=1, Annotation *ann=0, std::string *id=0)
 Constructor. More...
 
 Choice (const Choice &rhs)
 Copy constructor. More...
 
Contentclone () const
 
AnnotationgetAnnotation () const
 It returns the associated annotation. More...
 
const boost::ptr_vector< Any > & getAnys () const
 It returns the list of any elements of Choice. More...
 
const boost::ptr_vector< Content > & getContents () const
 It returns the list of Content elements of Choice. More...
 
const boost::ptr_vector< Element > & getElements () const
 It returns the list of elements of Choice. More...
 
std::string * getId () const
 It returns a pointer (may be NULL) to the object id. More...
 
const unsigned int getMaxOccurs () const
 It returns the maxOccurs values. More...
 
const unsigned int getMinOccurs () const
 It returns the minOccurs values. More...
 
Choiceoperator= (const Choice &rhs)
 Assignment operator. More...
 
void setAnnotation (Annotation *ann)
 It sets the associated annotation. More...
 
void setId (std::string *id)
 it sets the id. More...
 
void setMaxOccurs (unsigned int maxOccurs)
 It sets the maxOccurs value. More...
 
void setMinOccurs (unsigned int minOccurs)
 It sets the minOccurs value. More...
 
 ~Choice ()
 Destructor. More...
 

Static Public Attributes

static const unsigned int unbounded
 Identifer for "unbounded" max values. More...
 

Protected Attributes

unsigned int m_maxOccurs
 It specifies the maximum number of times the any element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. (Optional) More...
 
unsigned int m_minOccurs
 It specifies the minimum number of times the any element can occur in the parent element. The value can be any number >= 0. Default value is 1. (Optional) More...
 

Private Attributes

boost::ptr_vector< Anym_anyVec
 The list of any elements. More...
 
boost::ptr_vector< Contentm_contentVec
 The list of Contents elements (group | choice | sequence). More...
 
boost::ptr_vector< Elementm_elementVec
 The list of elements. More...
 

Detailed Description

This class models the XML Schema choice element.

The choice element allows only one of the elements contained in the <choice> declaration to be present within the containing element.

Note
Parent elements: group, choice, sequence, complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent).

Definition at line 57 of file Choice.h.

Constructor & Destructor Documentation

te::xsd::Choice::Choice ( unsigned int  minOccurs = 1,
unsigned int  maxOccurs = 1,
Annotation ann = 0,
std::string *  id = 0 
)

Constructor.

Parameters
idIt specifies a unique ID for the element. It can be a NULL value.
minOccursThe minimum number of times the element can occur.
maxOccursThe maximum number of times the element can occur.
te::xsd::Choice::Choice ( const Choice rhs)

Copy constructor.

Parameters
rhsRight-hand-side object.
te::xsd::Choice::~Choice ( )

Destructor.

Member Function Documentation

void te::xsd::Choice::addAny ( Any a)

It adds an any to this Choice element.

Parameters
aThe any that will be added.
Note
The Choice object will take the ownership of the given pointer.
void te::xsd::Choice::addContent ( Content c)

It adds a Content element to this Choice element.

Parameters
cThe appropriate Content element. It can be: group | choice | sequence.
Note
The Choice object will take the ownership of the given pointer.
void te::xsd::Choice::addElement ( Element e)

It adds an element to this Choice element.

Parameters
eThe element that will be added.
Note
The Choice object will take the ownership of the given pointer.
Content* te::xsd::Choice::clone ( ) const
virtual

Implements te::xsd::Content.

Annotation* te::xsd::Annotated::getAnnotation ( ) const
inherited

It returns the associated annotation.

Returns
The associated annotation.
const boost::ptr_vector<Any>& te::xsd::Choice::getAnys ( ) const

It returns the list of any elements of Choice.

Returns
The list of any elements.
const boost::ptr_vector<Content>& te::xsd::Choice::getContents ( ) const

It returns the list of Content elements of Choice.

Returns
The list of Content elements: group | choice | sequence.
const boost::ptr_vector<Element>& te::xsd::Choice::getElements ( ) const

It returns the list of elements of Choice.

Returns
The list of elements.
std::string* te::xsd::Identifiable::getId ( ) const
inherited

It returns a pointer (may be NULL) to the object id.

const unsigned int te::xsd::Occurs::getMaxOccurs ( ) const
inherited

It returns the maxOccurs values.

Returns
The maxOccurs value.
const unsigned int te::xsd::Occurs::getMinOccurs ( ) const
inherited

It returns the minOccurs values.

Returns
The minOccurs value.
Choice& te::xsd::Choice::operator= ( const Choice rhs)

Assignment operator.

Parameters
rhsRight-hand-side object.
Returns
A reference to this object.
void te::xsd::Annotated::setAnnotation ( Annotation ann)
inherited

It sets the associated annotation.

Parameters
annThe annotation to be associated to the object. The annotated class will take the ownership of the given pointer.
void te::xsd::Identifiable::setId ( std::string *  id)
inherited

it sets the id.

Parameters
idThe id to be associated to the object. It will take the ownership of the given string.
void te::xsd::Occurs::setMaxOccurs ( unsigned int  maxOccurs)
inherited

It sets the maxOccurs value.

Parameters
maxOccursThe maxOccurs value. The value can be any number >= 0.
Note
If you want to set no limit on the maximum number, use the value "unbounded" defined as te::xsd::Occurs::unbounded.
void te::xsd::Occurs::setMinOccurs ( unsigned int  minOccurs)
inherited

It sets the minOccurs value.

Parameters
minOccursThe minOccurs value. The value can be any number >= 0.

Member Data Documentation

boost::ptr_vector<Any> te::xsd::Choice::m_anyVec
private

The list of any elements.

Definition at line 147 of file Choice.h.

boost::ptr_vector<Content> te::xsd::Choice::m_contentVec
private

The list of Contents elements (group | choice | sequence).

Definition at line 146 of file Choice.h.

boost::ptr_vector<Element> te::xsd::Choice::m_elementVec
private

The list of elements.

Definition at line 145 of file Choice.h.

unsigned int te::xsd::Occurs::m_maxOccurs
protectedinherited

It specifies the maximum number of times the any element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. (Optional)

Definition at line 113 of file Occurs.h.

unsigned int te::xsd::Occurs::m_minOccurs
protectedinherited

It specifies the minimum number of times the any element can occur in the parent element. The value can be any number >= 0. Default value is 1. (Optional)

Definition at line 112 of file Occurs.h.

const unsigned int te::xsd::Occurs::unbounded
staticinherited

Identifer for "unbounded" max values.

Definition at line 108 of file Occurs.h.


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