1 #ifndef AST_ANNOTATION_APPL_VECTOR_HEADER
2 #define AST_ANNOTATION_APPL_VECTOR_HEADER
4 #include "ace/Vector_T.h"
6 #include "ace/Bound_Ptr.h"
8 #include "TAO_IDL_FE_Export.h"
10 class AST_Annotation_Appl
;
11 class AST_Annotation_Decl
;
14 * Container for AST_Annotation_Appl
16 * Uses ACE_Strong_Bound_Ptr because they can be shared between AST_Decl.
18 class TAO_IDL_FE_Export AST_Annotation_Appls
{
20 typedef ACE_Strong_Bound_Ptr
<AST_Annotation_Appl
, ACE_Mutex
> AST_Annotation_Appl_Ptr
;
21 typedef ACE_Vector
<AST_Annotation_Appl_Ptr
> AST_Annotation_Appl_Ptrs
;
22 typedef AST_Annotation_Appl_Ptrs::iterator iterator
;
23 typedef AST_Annotation_Appl_Ptrs::const_iterator const_iterator
;
25 AST_Annotation_Appls ();
26 AST_Annotation_Appls (const AST_Annotation_Appls
& other
);
27 ~AST_Annotation_Appls ();
29 AST_Annotation_Appls
&operator= (const AST_Annotation_Appls
& other
);
32 * Add an AST_Annotation_Appl to the vector. This class assumes ownership of
33 * the pointer which is managed by ACE_Strong_Bound_Ptr.
35 void add (AST_Annotation_Appl
*appl
);
38 * Add all the AST_Annotation_Appls from another AST_Annotation_Appls to the
41 void add (const AST_Annotation_Appls
& other
);
46 /// Iterate through ACE_Strong_Bound_Ptr<AST_Annotation_Appl, ACE_Mutex>
50 const_iterator
begin () const;
51 const_iterator
end () const;
55 * Direct access to the AST_Annotation_Appl pointers by index.
57 AST_Annotation_Appl
*operator[] (size_t index
);
60 * Return last AST_Annotation_Appl that applies the AST_Annotation_Decl
61 * or return 0 if there are non that do.
63 AST_Annotation_Appl
*find (AST_Annotation_Decl
*annotation
);
66 * Same as find (AST_Annotation_Decl*) except do a look up of the
67 * AST_Annotation_Decl first.
69 AST_Annotation_Appl
*find (const char *annotation
);
72 AST_Annotation_Appl_Ptrs vector_
;