1 #include "ast_annotation_appls.h"
2 #include "ast_annotation_appl.h"
4 AST_Annotation_Appls::AST_Annotation_Appls ()
8 AST_Annotation_Appls::AST_Annotation_Appls (const AST_Annotation_Appls
& other
)
13 AST_Annotation_Appls::~AST_Annotation_Appls ()
17 AST_Annotation_Appls
&
18 AST_Annotation_Appls::operator= (const AST_Annotation_Appls
& other
)
26 AST_Annotation_Appls::add (AST_Annotation_Appl
*appl
)
28 vector_
.push_back (AST_Annotation_Appl_Ptr (appl
));
32 AST_Annotation_Appls::add (const AST_Annotation_Appls
&other
)
34 for (const_iterator i
= other
.begin (); i
!= other
.end (); ++i
)
36 vector_
.push_back (*i
);
41 AST_Annotation_Appls::empty () const
43 return !vector_
.size ();
47 AST_Annotation_Appls::size () const
49 return vector_
.size ();
52 AST_Annotation_Appls::iterator
53 AST_Annotation_Appls::begin ()
55 return vector_
.begin ();
58 AST_Annotation_Appls::iterator
59 AST_Annotation_Appls::end ()
61 return vector_
.end ();
64 AST_Annotation_Appls::const_iterator
65 AST_Annotation_Appls::begin () const
67 return vector_
.begin ();
70 AST_Annotation_Appls::const_iterator
71 AST_Annotation_Appls::end () const
73 return vector_
.end ();
77 AST_Annotation_Appls::operator[] (size_t index
)
79 return vector_
[index
].get ();
83 AST_Annotation_Appls::find (AST_Annotation_Decl
*annotation
)
85 AST_Annotation_Appl
*result
= 0;
86 for (iterator i
= begin (); i
!= end (); ++i
)
88 AST_Annotation_Appl
*appl
= i
->get ();
89 if (appl
&& appl
->annotation_decl () == annotation
)
98 AST_Annotation_Appls::find (const char *annotation
)
105 UTL_Scope
* bottom
= idl_global
->scopes ().bottom ();
111 AST_Decl
* decl
= bottom
->lookup_by_name (annotation
);
117 return find (dynamic_cast<AST_Annotation_Decl
*> (decl
));