annotation.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2008 The FLWOR Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef ZORBA_ANNOTATION_API_H
17 #define ZORBA_ANNOTATION_API_H
18 
19 #include <zorba/config.h>
20 #include <zorba/api_shared_types.h>
21 #include <zorba/smart_ptr.h>
22 
23 namespace zorba {
24 
25 class ZORBA_DLL_PUBLIC Annotation : public SmartObject
26 {
27  public:
28  /** \brief Destructor
29  */
30  virtual ~Annotation() {}
31 
32  /**
33  * Returns the QName of the annotation
34  */
35  virtual Item
36  getQName() const = 0;
37 
38  /**
39  * Returns the number of literals that are associated with the annotation,
40  * e.g. for the annotation:
41  *
42  * %annotation(Literal1, Literal2, ..., LiteralN)
43  *
44  * the function will return N.
45  */
46  virtual unsigned int
47  getLiteralsCount() const = 0;
48 
49  /**
50  * Returns the requested literal. E.g. for the annotation
51  *
52  * %annotation(Literal1, Literal2, ..., LiteralN)
53  *
54  * the function will return the i-th literal.
55  */
56  virtual Item
57  getLiteral(unsigned int i) const = 0;
58 };
59 
60 } /* namespace zorba */
61 #endif
62 
63 /*
64  * Local variables:
65  * mode: c++
66  * End:
67  */
68 
69 /* vim:set et sw=2 ts=2: */
The Zorba Item interface.
Definition: item.h:60
virtual ~Annotation()
Destructor.
Definition: annotation.h:30