6 #include <ast_annotation_appl.h> 7 #include <ast_annotation_decl.h> 8 #include <ast_annotation_member.h> 9 #include <ast_sequence.h> 10 #include <ast_array.h> 11 #include <ast_union.h> 12 #include <utl_string.h> 16 register_one<KeyAnnotation>();
17 register_one<TopicAnnotation>();
18 register_one<NestedAnnotation>();
19 register_one<DefaultNestedAnnotation>();
20 register_one<IdAnnotation>();
21 register_one<AutoidAnnotation>();
22 register_one<HashidAnnotation>();
23 register_one<OptionalAnnotation>();
24 register_one<MustUnderstandAnnotation>();
25 register_one<ExternalAnnotation>();
26 register_one<ExtensibilityAnnotation>();
27 register_one<FinalAnnotation>();
28 register_one<AppendableAnnotation>();
29 register_one<MutableAnnotation>();
30 register_one<TryConstructAnnotation>();
31 register_one<OpenDDS::DataRepresentationAnnotation>();
32 register_one<OpenDDS::internal::NoDynamicDataAdapterAnnotation>();
33 register_one<OpenDDS::internal::SpecialSerializationAnnotation>();
42 for (MapType::iterator i =
map_.begin(); i !=
map_.end(); ++i) {
49 const MapType::const_iterator i =
map_.find(annotation);
50 if (i ==
map_.end()) {
88 UTL_Scope* root = idl_global->scopes().bottom();
90 root->lookup_by_name(
fullname().c_str()));
94 AST_Annotation_Appl* appl,
const char* member_name, AST_Expression::ExprType type)
96 AST_Annotation_Member* member =
97 dynamic_cast<AST_Annotation_Member*
>((*appl)[member_name]);
99 AST_Expression* e = member->value();
101 if (e->ev()->et != type) {
103 "while getting value of member \"") +
104 member_name +
"\" of annotation \"" +
105 appl->local_name()->get_string() +
'"',
113 member_name +
"\" of annotation \"" +
114 appl->local_name()->get_string() +
'"',
120 const char* member_name)
122 AST_Expression::AST_ExprValue*
const ev =
128 const char* member_name)
130 AST_Expression::AST_ExprValue*
const ev =
136 const char* member_name)
138 AST_Expression::AST_ExprValue*
const ev =
140 return ev->u.strval->get_string();
166 "@annotation key {\n" 167 " boolean value default TRUE;\n" 178 AST_Annotation_Appl* appl = node->disc_annotations().find(
declaration());
179 if (!appl) {
return absent_value; }
180 return value_from_appl(appl);
192 "@annotation topic {\n" 193 " string name default \"\";\n" 194 " string platform default \"*\";\n" 216 "@annotation nested {\n" 217 " boolean value default TRUE;\n" 231 "@annotation default_nested {\n" 232 " boolean value default TRUE;\n" 238 return "default_nested";
247 " unsigned long value;\n" 261 "@annotation autoid {\n" 262 " enum AutoidKind {\n" 266 " AutoidKind value default HASH;\n" 280 "@annotation hashid {\n" 281 " string value default \"\";" 295 "@annotation optional {\n" 296 " boolean value default TRUE;" 310 "@annotation must_understand {\n" 311 " boolean value default TRUE;" 317 return "must_understand";
325 "@annotation external {\n" 326 " boolean value default TRUE;" 340 "@annotation extensibility {\n" 341 " enum ExtensibilityKind {\n" 346 " ExtensibilityKind value;\n" 352 return "extensibility";
359 return "@annotation final {};\n";
371 return "@annotation appendable {};\n";
383 return "@annotation mutable {};\n";
396 "@annotation try_construct {\n" 397 " enum TryConstructFailAction {\n" 402 " TryConstructFailAction value default USE_DEFAULT;\n" 408 return "try_construct";
413 AST_Annotation_Appl* appl = node->base_type_annotations().find(
declaration());
414 if (!appl) {
return absent_value; }
415 return value_from_appl(appl);
420 AST_Annotation_Appl* appl = node->base_type_annotations().find(
declaration());
421 if (!appl) {
return absent_value; }
422 return value_from_appl(appl);
427 AST_Annotation_Appl* appl = node->disc_annotations().find(
declaration());
428 if (!appl) {
return absent_value; }
429 return value_from_appl(appl);
437 std::string DataRepresentationAnnotation::definition()
const 441 " @annotation data_representation {\n" 455 return "data_representation";
458 bool DataRepresentationAnnotation::node_value_exists(
464 for (AST_Annotation_Appls::iterator i = node->annotations().begin();
465 i != node->annotations().end(); ++i) {
466 AST_Annotation_Appl* appl = i->get();
467 if (appl && appl->annotation_decl() ==
declaration()) {
469 value.
add(value_from_appl(appl));
479 if (appl && appl->annotation_decl() ==
declaration()) {
498 std::string DataRepresentationAnnotation::module()
const 500 return "::OpenDDS::";
virtual std::string module() const
AST_Annotation_Decl * declaration_
AST_Annotation_Appl * find_on(AST_Decl *node) const
std::string definition() const
const LogLevel::Value value
std::string definition() const
std::string definition() const
TryConstructFailAction union_value(AST_Union *node) const
std::string definition() const
TryConstructFailAction array_element_value(AST_Array *node) const
void add(const DataRepresentation &other)
std::string definition() const
TopicValue value_from_appl(AST_Annotation_Appl *appl) const
std::string definition() const
Annotation * operator[](const std::string &annotation) const
AST_Annotation_Decl * declaration() const
ACE_UINT32 get_u32_annotation_member_value(AST_Annotation_Appl *appl, const char *member_name)
AST_Expression::AST_ExprValue * get_annotation_member_ev(AST_Annotation_Appl *appl, const char *member_name, AST_Expression::ExprType type)
std::string definition() const
virtual T value_from_appl(AST_Annotation_Appl *) const
TryConstructFailAction sequence_element_value(AST_Sequence *node) const
bool get_bool_annotation_member_value(AST_Annotation_Appl *appl, const char *member_name)
virtual std::string definition() const =0
virtual std::string name() const =0
std::string definition() const
std::string definition() const
virtual std::string fullname() const
std::string definition() const
std::string definition() const
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
std::string get_str_annotation_member_value(AST_Annotation_Appl *appl, const char *member_name)
std::string definition() const
bool union_value(AST_Union *node) const
std::string definition() const
std::string definition() const
void misc_error_and_abort(const std::string &message, AST_Decl *node=0)
Report a miscellaneous error and abort.
The Internal API and Implementation of OpenDDS.
std::string definition() const