![]() |
Rosetta
2021.16
|
The XMLSchemaSimpleSubelementList class defines an interface that can be used by those wishing to define a complexType that contains sub-elements. The structure of the XML Schema for the sub-elements will determined by how this list is given to the XMLSchemaComplexTypeGenerator. "simple" subelements are those which themselves contain no subelements (but may contain attributes). Also allowed are subelements that refer to previously-defined complexTypes or those that refer to previously defined xs:groups. More...
#include <XMLSchemaGeneration.hh>

Classes | |
| struct | ElementSummary |
Public Types | |
| typedef std::function < std::string(std::string const &) > | DerivedNameFunction |
| typedef std::function < std::string() > | NameFunction |
Public Member Functions | |
| XMLSchemaSimpleSubelementList () | |
| ~XMLSchemaSimpleSubelementList () override | |
| XMLSchemaSimpleSubelementList (XMLSchemaSimpleSubelementList const &src) | |
| XMLSchemaSimpleSubelementList & | operator= (XMLSchemaSimpleSubelementList const &rhs) |
| XMLSchemaSimpleSubelementList & | complex_type_naming_func (DerivedNameFunction const &naming_function) |
| the naming function is required if this subelement list is going to be repeatable More... | |
| XMLSchemaSimpleSubelementList & | add_simple_subelement (std::string const &name, AttributeList const &, std::string const &description) |
| Add a new subelement to the growing list of subelements, defined by its name and a (possibly empty) list of attributes This subelement may not itself contain other subelements, however. The name for the complexType of this element will be derived from the function given in complex_type_naming_func, if provided, and otherwise, the complexType for this element will be listed within the element declaration and will be unnamed. More... | |
| XMLSchemaSimpleSubelementList & | add_simple_subelement (std::string const &name, AttributeList const &, std::string const &description, int min_occurs, int max_occurs=xsminmax_unspecified) |
| Add a new subelement to the growing list of subelements, but where the minimum and maximum number of occurrences for this subelement has been set; note: usually, the min and max are set by the XMLSchemaComplexTypeGenerator, and so tension could arise between the generator and your settings. Consider this an advanced function. More... | |
| XMLSchemaSimpleSubelementList & | add_already_defined_subelement (std::string const &name, DerivedNameFunction const &ct_naming_function) |
| Add a new subelement to the growing list of subelements, but one whose complexType definition has been provided elsewhere and where the name of the complexType for this subelement is derived from the subelement's name using the provided function. (Why pass a function to define the name for the complex type instead of just passing the result of the function? Because such an interface would also let you bypass a function entirely and let you pass in a raw string, and that would lead to brittle code. If we should want to change the complexType naming rule for a particular class of elements in the schema, we want to be able to change only a single function and have that change ripple outwards through all the parts of the schema that interacted with those elements.) More... | |
| XMLSchemaSimpleSubelementList & | add_already_defined_subelement (std::string const &name, DerivedNameFunction const &ct_naming_function, int min_occurs, int max_occurs=xsminmax_unspecified) |
| Add a new subelement to the growing list of subelements, but where the minimum and maximum number of occurrences for this subelement has been set; note: usually, the min and max are set by the XMLSchemaComplexTypeGenerator, and so tension could arise between the generator and your settings. Consider this an advanced function. More... | |
| XMLSchemaSimpleSubelementList & | add_already_defined_subelement_w_alt_element_name (std::string const &alt_element_name, std::string const &reference_element_name, DerivedNameFunction const &ct_naming_function) |
| Add a subelement with a different name than the complex type was created with so that to get the correct name for the complex type, the original name must also be provided. E.g. The PROTOCOLS subelement takes its structure from the ParsedProtocol mover. Instead of duplicating the complex type for that mover, instead, create an element whose type will be given by the protocols::moves::complex_type_name_for_mover function when given the "ParsedProtocol" element name. More... | |
| XMLSchemaSimpleSubelementList & | add_already_defined_subelement_w_alt_element_name (std::string const &alt_element_name, std::string const &reference_element_name, DerivedNameFunction const &ct_naming_function, int min_occurs, int max_occurs=xsminmax_unspecified) |
| Add a subelement with a different name than the complex type was created with so that to get the correct name for the complex type, the original name must also be provided. E.g. The PROTOCOLS subelement takes its structure from the ParsedProtocol mover. Instead of duplicating the complex type for that mover, instead, create an element whose type will be given by the protocols::moves::complex_type_name_for_mover function when given the "ParsedProtocol" element name. More... | |
| XMLSchemaSimpleSubelementList & | add_group_subelement (NameFunction const &group_name_function) |
| Add a new subelement to the growing list of subelements which refers to an already existing group whose name is given by the input function. More... | |
| XMLSchemaSimpleSubelementList & | add_group_subelement (NameFunction const &group_name_function, int min_occurs, int max_occurs=xsminmax_unspecified) |
| Add a new subelement to the growing list of subelements, but where the minimum and maximum number of occurrences for this subelement has been set; note: usually, the min and max are set by the XMLSchemaComplexTypeGenerator, and so tension could arise between the generator and your settings. Consider this an advanced function. More... | |
| XMLSchemaSimpleSubelementList & | add_subelement (ElementSummary const &summary) |
| Really only intended to be used by the XMLSchemaRepeatableCTNode. More... | |
| bool | simple_element_naming_func_has_been_set () const |
| std::string | complex_typename_for_element (std::string const &element_name) const |
| DerivedNameFunction | naming_func () const |
| std::list< ElementSummary > const & | element_list () const |
Public Member Functions inherited from utility::VirtualBase | |
| VirtualBase ()=default | |
| Default constructor. More... | |
| virtual | ~VirtualBase ()=default |
| The virtual destructor is one of the main reasons for the VirtualBase class. More... | |
| VirtualBase (VirtualBase const &)=default | |
| VirtualBase (VirtualBase &&)=default | |
| VirtualBase & | operator= (VirtualBase const &)=default |
| VirtualBase & | operator= (VirtualBase &&)=default |
Static Public Member Functions | |
| static ElementSummary | element_summary_as_simple_subelement (std::string const &name, AttributeList const &attributes, std::string const &description) |
| static ElementSummary | element_summary_as_simple_subelement (std::string const &name, AttributeList const &attributes, std::string const &description, int min_occurs, int max_occurs) |
| static ElementSummary | element_summary_as_already_defined_subelement (std::string const &name, DerivedNameFunction const &ct_naming_function) |
| static ElementSummary | element_summary_as_already_defined_subelement (std::string const &name, DerivedNameFunction const &ct_naming_function, int min_occurs, int max_occurs) |
| static ElementSummary | element_summary_as_already_defined_subelement_w_alt_element_name (std::string const &alt_element_name, std::string const &reference_element_name, DerivedNameFunction const &ct_naming_function) |
| static ElementSummary | element_summary_as_already_defined_subelement_w_alt_element_name (std::string const &alt_element_name, std::string const &reference_element_name, DerivedNameFunction const &ct_naming_function, int min_occurs, int max_occurs) |
| static ElementSummary | element_summary_as_group_subelement (NameFunction const &group_name_function) |
| static ElementSummary | element_summary_as_group_subelement (NameFunction const &group_name_function, int min_occurs, int max_occurs) |
Private Attributes | |
| DerivedNameFunction | ct_naming_func_for_simple_subelements_ |
| std::list< ElementSummary > | elements_ |
The XMLSchemaSimpleSubelementList class defines an interface that can be used by those wishing to define a complexType that contains sub-elements. The structure of the XML Schema for the sub-elements will determined by how this list is given to the XMLSchemaComplexTypeGenerator. "simple" subelements are those which themselves contain no subelements (but may contain attributes). Also allowed are subelements that refer to previously-defined complexTypes or those that refer to previously defined xs:groups.
| typedef std::function< std::string ( std::string const & ) > utility::tag::XMLSchemaSimpleSubelementList::DerivedNameFunction |
| typedef std::function< std::string () > utility::tag::XMLSchemaSimpleSubelementList::NameFunction |
|
default |
|
overridedefault |
| utility::tag::XMLSchemaSimpleSubelementList::XMLSchemaSimpleSubelementList | ( | XMLSchemaSimpleSubelementList const & | src | ) |
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_already_defined_subelement | ( | std::string const & | name, |
| DerivedNameFunction const & | ct_naming_function | ||
| ) |
Add a new subelement to the growing list of subelements, but one whose complexType definition has been provided elsewhere and where the name of the complexType for this subelement is derived from the subelement's name using the provided function. (Why pass a function to define the name for the complex type instead of just passing the result of the function? Because such an interface would also let you bypass a function entirely and let you pass in a raw string, and that would lead to brittle code. If we should want to change the complexType naming rule for a particular class of elements in the schema, we want to be able to change only a single function and have that change ripple outwards through all the parts of the schema that interacted with those elements.)
References element_summary_as_already_defined_subelement(), and elements_.
Referenced by basic::resource_manager::ResourceManager::schema_for_resource_definition_file().
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_already_defined_subelement | ( | std::string const & | name, |
| DerivedNameFunction const & | ct_naming_function, | ||
| int | min_occurs, | ||
| int | max_occurs = xsminmax_unspecified |
||
| ) |
Add a new subelement to the growing list of subelements, but where the minimum and maximum number of occurrences for this subelement has been set; note: usually, the min and max are set by the XMLSchemaComplexTypeGenerator, and so tension could arise between the generator and your settings. Consider this an advanced function.
References element_summary_as_already_defined_subelement(), and elements_.
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_already_defined_subelement_w_alt_element_name | ( | std::string const & | alt_element_name, |
| std::string const & | reference_element_name, | ||
| DerivedNameFunction const & | ct_naming_function | ||
| ) |
Add a subelement with a different name than the complex type was created with so that to get the correct name for the complex type, the original name must also be provided. E.g. The PROTOCOLS subelement takes its structure from the ParsedProtocol mover. Instead of duplicating the complex type for that mover, instead, create an element whose type will be given by the protocols::moves::complex_type_name_for_mover function when given the "ParsedProtocol" element name.
References element_summary_as_already_defined_subelement_w_alt_element_name(), and elements_.
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_already_defined_subelement_w_alt_element_name | ( | std::string const & | alt_element_name, |
| std::string const & | reference_element_name, | ||
| DerivedNameFunction const & | ct_naming_function, | ||
| int | min_occurs, | ||
| int | max_occurs = xsminmax_unspecified |
||
| ) |
Add a subelement with a different name than the complex type was created with so that to get the correct name for the complex type, the original name must also be provided. E.g. The PROTOCOLS subelement takes its structure from the ParsedProtocol mover. Instead of duplicating the complex type for that mover, instead, create an element whose type will be given by the protocols::moves::complex_type_name_for_mover function when given the "ParsedProtocol" element name.
References element_summary_as_already_defined_subelement_w_alt_element_name(), and elements_.
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_group_subelement | ( | NameFunction const & | group_name_function | ) |
Add a new subelement to the growing list of subelements which refers to an already existing group whose name is given by the input function.
References element_summary_as_group_subelement(), and elements_.
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_group_subelement | ( | NameFunction const & | group_name_function, |
| int | min_occurs, | ||
| int | max_occurs = xsminmax_unspecified |
||
| ) |
Add a new subelement to the growing list of subelements, but where the minimum and maximum number of occurrences for this subelement has been set; note: usually, the min and max are set by the XMLSchemaComplexTypeGenerator, and so tension could arise between the generator and your settings. Consider this an advanced function.
References element_summary_as_group_subelement(), and elements_.
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_simple_subelement | ( | std::string const & | name, |
| AttributeList const & | attributes, | ||
| std::string const & | description | ||
| ) |
Add a new subelement to the growing list of subelements, defined by its name and a (possibly empty) list of attributes This subelement may not itself contain other subelements, however. The name for the complexType of this element will be derived from the function given in complex_type_naming_func, if provided, and otherwise, the complexType for this element will be listed within the element declaration and will be unnamed.
References CREATE_EXCEPTION, element_summary_as_simple_subelement(), elements_, and utility::tag::string_contains_gt_lt_or_ampersand().
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_simple_subelement | ( | std::string const & | name, |
| AttributeList const & | attributes, | ||
| std::string const & | description, | ||
| int | min_occurs, | ||
| int | max_occurs = xsminmax_unspecified |
||
| ) |
Add a new subelement to the growing list of subelements, but where the minimum and maximum number of occurrences for this subelement has been set; note: usually, the min and max are set by the XMLSchemaComplexTypeGenerator, and so tension could arise between the generator and your settings. Consider this an advanced function.
References CREATE_EXCEPTION, element_summary_as_simple_subelement(), elements_, and utility::tag::string_contains_gt_lt_or_ampersand().
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::add_subelement | ( | ElementSummary const & | summary | ) |
Really only intended to be used by the XMLSchemaRepeatableCTNode.
References elements_.
Referenced by utility::tag::XMLSchemaRepeatableCTNode::recursively_write_ct_to_schema().
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::complex_type_naming_func | ( | DerivedNameFunction const & | naming_function | ) |
the naming function is required if this subelement list is going to be repeatable
References ct_naming_func_for_simple_subelements_.
Referenced by utility::tag::XMLSchemaRepeatableCTNode::recursively_write_ct_to_schema().
| std::string utility::tag::XMLSchemaSimpleSubelementList::complex_typename_for_element | ( | std::string const & | element_name | ) | const |
References ct_naming_func_for_simple_subelements_.
| std::list< XMLSchemaSimpleSubelementList::ElementSummary > const & utility::tag::XMLSchemaSimpleSubelementList::element_list | ( | ) | const |
References elements_.
Referenced by utility::tag::XMLSchemaComplexTypeGeneratorImpl::add_ordered_subelement_set_as_optional(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::add_ordered_subelement_set_as_required(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::only_one_subelement_and_that_subelement_is_a_ct_group(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::prepare_subelement_choice_opt(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::prepare_subelement_choice_req(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::prepare_subelement_repeatable(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::prepare_subelement_single_instance_optional(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::prepare_subelement_single_instance_required(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::prepare_subelement_single_instance_required_ordered(), utility::tag::XMLSchemaComplexTypeGeneratorImpl::set_subelements_single_appearance_optional(), and utility::tag::XMLSchemaComplexTypeGeneratorImpl::set_subelements_single_appearance_required().
|
static |
References utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_ref, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_type, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::max_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_or_max_occurs_set, name, and utility::tag::xsminmax_unspecified.
Referenced by add_already_defined_subelement(), utility::tag::XMLSchemaRepeatableCTNode::recursively_write_ct_to_schema(), and utility::tag::XMLSchemaRepeatableCTNode::set_already_defined_element().
|
static |
References utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_ref, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_type, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::max_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_or_max_occurs_set, and name.
|
static |
References utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_ref, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_type, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::max_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_or_max_occurs_set, and utility::tag::xsminmax_unspecified.
Referenced by add_already_defined_subelement_w_alt_element_name(), and utility::tag::XMLSchemaRepeatableCTNode::set_already_defined_element_w_alt_name().
|
static |
References utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_ref, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_type, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::max_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_occurs, and utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_or_max_occurs_set.
|
static |
References utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_group, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_type, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::max_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_or_max_occurs_set, and utility::tag::xsminmax_unspecified.
Referenced by add_group_subelement(), and utility::tag::XMLSchemaRepeatableCTNode::set_group_subelement().
|
static |
References utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_group, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_type, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::max_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_occurs, and utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_or_max_occurs_set.
|
static |
References utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::attributes, CREATE_EXCEPTION, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_simple, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::description, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_type, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::max_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_or_max_occurs_set, name, utility::tag::string_contains_gt_lt_or_ampersand(), and utility::tag::xsminmax_unspecified.
Referenced by add_simple_subelement(), and utility::tag::XMLSchemaRepeatableCTNode::set_element_w_attributes().
|
static |
References utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::attributes, CREATE_EXCEPTION, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::ct_simple, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::description, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_name, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::element_type, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::max_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_occurs, utility::tag::XMLSchemaSimpleSubelementList::ElementSummary::min_or_max_occurs_set, name, and utility::tag::string_contains_gt_lt_or_ampersand().
| XMLSchemaSimpleSubelementList::DerivedNameFunction utility::tag::XMLSchemaSimpleSubelementList::naming_func | ( | ) | const |
References ct_naming_func_for_simple_subelements_.
Referenced by utility::tag::XMLSchemaComplexTypeGeneratorImpl::create_subelement().
| XMLSchemaSimpleSubelementList & utility::tag::XMLSchemaSimpleSubelementList::operator= | ( | XMLSchemaSimpleSubelementList const & | rhs | ) |
References ct_naming_func_for_simple_subelements_, and elements_.
| bool utility::tag::XMLSchemaSimpleSubelementList::simple_element_naming_func_has_been_set | ( | ) | const |
References ct_naming_func_for_simple_subelements_.
Referenced by utility::tag::XMLSchemaComplexTypeGeneratorImpl::create_subelement().
|
private |
|
private |
1.8.7