This class models the XML Schema choice element. More...
#include <Choice.h>
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... | |
Content * | clone () const |
Annotation * | getAnnotation () 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... | |
Choice & | operator= (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 = std::numeric_limits<unsigned int>::max() |
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< Any > | m_anyVec |
The list of any elements. More... | |
boost::ptr_vector< Content > | m_contentVec |
The list of Contents elements (group | choice | sequence). More... | |
boost::ptr_vector< Element > | m_elementVec |
The list of elements. More... | |
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.
te::xsd::Choice::Choice | ( | unsigned int | minOccurs = 1 , |
unsigned int | maxOccurs = 1 , |
||
Annotation * | ann = 0 , |
||
std::string * | id = 0 |
||
) |
Constructor.
id | It specifies a unique ID for the element. It can be a NULL value. |
minOccurs | The minimum number of times the element can occur. |
maxOccurs | The maximum number of times the element can occur. |
Definition at line 31 of file Choice.cpp.
te::xsd::Choice::Choice | ( | const Choice & | rhs | ) |
Copy constructor.
rhs | Right-hand-side object. |
Definition at line 38 of file Choice.cpp.
References m_anyVec, m_contentVec, and m_elementVec.
te::xsd::Choice::~Choice | ( | ) |
Destructor.
Definition at line 53 of file Choice.cpp.
void te::xsd::Choice::addAny | ( | Any * | a | ) |
It adds an any to this Choice element.
a | The any that will be added. |
Definition at line 107 of file Choice.cpp.
void te::xsd::Choice::addContent | ( | Content * | c | ) |
void te::xsd::Choice::addElement | ( | Element * | e | ) |
It adds an element to this Choice element.
e | The element that will be added. |
Definition at line 97 of file Choice.cpp.
|
virtual |
Implements te::xsd::Content.
Definition at line 112 of file Choice.cpp.
|
inherited |
It returns the associated annotation.
Definition at line 30 of file Annotated.cpp.
References te::xsd::Annotated::m_annotation.
const boost::ptr_vector< te::xsd::Any > & te::xsd::Choice::getAnys | ( | ) | const |
It returns the list of any elements of Choice.
Definition at line 92 of file Choice.cpp.
const boost::ptr_vector< te::xsd::Content > & te::xsd::Choice::getContents | ( | ) | const |
It returns the list of Content elements of Choice.
Definition at line 87 of file Choice.cpp.
const boost::ptr_vector< te::xsd::Element > & te::xsd::Choice::getElements | ( | ) | const |
It returns the list of elements of Choice.
Definition at line 82 of file Choice.cpp.
|
inherited |
It returns a pointer (may be NULL) to the object id.
Definition at line 35 of file Identifiable.cpp.
|
inherited |
It returns the maxOccurs values.
Definition at line 40 of file Occurs.cpp.
|
inherited |
It returns the minOccurs values.
Definition at line 35 of file Occurs.cpp.
References te::xsd::Occurs::m_minOccurs.
te::xsd::Choice & te::xsd::Choice::operator= | ( | const Choice & | rhs | ) |
Assignment operator.
rhs | Right-hand-side object. |
Definition at line 57 of file Choice.cpp.
References m_anyVec, m_contentVec, m_elementVec, te::xsd::Identifiable::operator=(), te::xsd::Annotated::operator=(), and te::xsd::Occurs::operator=().
|
inherited |
It sets the associated annotation.
ann | The annotation to be associated to the object. The annotated class will take the ownership of the given pointer. |
Definition at line 35 of file Annotated.cpp.
Referenced by te::xsd::serialize::ReadAnnotated().
|
inherited |
it sets the id.
id | The id to be associated to the object. It will take the ownership of the given string. |
Definition at line 29 of file Identifiable.cpp.
References te::xsd::Identifiable::m_id.
Referenced by te::xsd::serialize::ReadIdentifiable().
|
inherited |
It sets the maxOccurs value.
maxOccurs | The maxOccurs value. The value can be any number >= 0. |
Definition at line 50 of file Occurs.cpp.
Referenced by te::xsd::serialize::ReadOccurs().
|
inherited |
It sets the minOccurs value.
minOccurs | The minOccurs value. The value can be any number >= 0. |
Definition at line 45 of file Occurs.cpp.
Referenced by te::xsd::serialize::ReadOccurs().
|
private |
The list of any elements.
Definition at line 147 of file Choice.h.
Referenced by Choice(), and operator=().
|
private |
The list of Contents elements (group | choice | sequence).
Definition at line 146 of file Choice.h.
Referenced by Choice(), and operator=().
|
private |
The list of elements.
Definition at line 145 of file Choice.h.
Referenced by Choice(), and operator=().
|
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.
Referenced by te::xsd::Occurs::operator=().
|
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.
Referenced by te::xsd::Occurs::getMinOccurs(), and te::xsd::Occurs::operator=().
|
staticinherited |
Identifer for "unbounded" max values.
Definition at line 108 of file Occurs.h.
Referenced by te::xsd::serialize::ReadOccurs().