Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / ACEXML / common / Element_Def_Builder.h
blob78ad36fc83390e3863ea5b0225ca3ef4948338c6
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Element_Def_Builder.h
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
8 */
9 //=============================================================================
10 #ifndef _ACEXML_ELEMENT_DEF_BUILDER_H_
11 #define _ACEXML_ELEMENT_DEF_BUILDER_H_
13 #include /**/ "ace/pre.h"
14 #include "ACEXML/common/ACEXML_Export.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 #pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "ACEXML/common/XML_Types.h"
21 #include "ACEXML/common/SAXExceptions.h"
22 #include <memory>
24 /**
25 * @class ACEXML_Element_Def_Builder
27 * @brief An abstract virtual class that defines the interface to define an
28 * element definition.
30 * This class defines how to define an element definition after parsing a
31 * DTD.
33 class ACEXML_Export ACEXML_Element_Def_Builder
35 public:
36 typedef std::unique_ptr<ACEXML_Element_Def_Builder> VAR;
38 typedef enum {
39 EMPTY,
40 ANY,
41 MIXED,
42 CHILDREN,
43 UNDEFINED
44 } CONTENT_TYPE;
46 typedef enum {
47 ONE,
48 ZERO_OR_MORE,
49 ONE_OR_MORE,
50 ONE_OR_ZERO
51 } CARDINALITY;
53 virtual ~ACEXML_Element_Def_Builder () = 0;
55 /**
56 * Define the name of the element.
58 * @retval 0 if valid, -1 otherwise.
60 virtual int setElementName (const ACEXML_Char *namespaceURI,
61 const ACEXML_Char *localName,
62 const ACEXML_Char *qName) = 0;
64 /**
65 * Define the content type of the element.
67 * @retval 0 if valid, -1 otherwise.
69 virtual int setContentType (CONTENT_TYPE type) = 0;
71 /**
72 * Insert one more element into Mixed definition.
74 virtual int insertMixedElement (const ACEXML_Char *namespaceURI,
75 const ACEXML_Char *localName,
76 const ACEXML_Char *qName) = 0;
78 /**
79 * Start a new group of children.
81 virtual int startChildGroup () = 0;
83 /**
84 * End a new group of children.
86 * @retval 0 on success.
88 virtual int endChildGroup (CARDINALITY card) = 0;
90 /**
91 * Set the type of current child group to Choice.
93 * @retval 0 on success, -1 if the type of the child group has
94 * already been set and this action conflicts with the previous
95 * setting.
97 virtual int setChoice () = 0;
99 /**
100 * Set the type of current child group to Sequence.
102 * @retval 0 on success, -1 if the type of the child group has
103 * already been set and this action conflicts with the previous
104 * setting.
106 virtual int setSequence () = 0;
109 * Insert an new element into the current child group.
111 * @retval 0 on success, -1 otherwise.
113 virtual int insertElement (const ACEXML_Char *namespaceURI,
114 const ACEXML_Char *localName,
115 const ACEXML_Char *qName) = 0;
118 * Dump the content of the attribute definition.
120 virtual void dump () = 0;
124 #include /**/ "ace/post.h"
126 #endif /* _ACEXML_ELEMENT_DEF_BUILDER_H_ */