OpenDDS  Snapshot(2023/04/28-20:55)
Classes | Namespaces | Enumerations | Functions
annotations.h File Reference
#include "../Versioned_Namespace.h"
#include <ast_expression.h>
#include <ace/Basic_Types.h>
#include <vector>
#include <string>
#include <map>
#include <set>
Include dependency graph for annotations.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Annotations
 
class  Annotation
 
class  AbsentValue< T >
 
class  AnnotationWithValue< T >
 
class  AnnotationWithEnumValue< T >
 
class  KeyAnnotation
 
struct  TopicValue
 
class  TopicAnnotation
 
class  NestedAnnotation
 
class  DefaultNestedAnnotation
 
class  IdAnnotation
 
class  AutoidAnnotation
 
class  HashidAnnotation
 
class  OptionalAnnotation
 
class  MustUnderstandAnnotation
 
class  ExternalAnnotation
 
class  ExtensibilityAnnotation
 
class  FinalAnnotation
 
class  AppendableAnnotation
 
class  MutableAnnotation
 
class  TryConstructAnnotation
 
struct  OpenDDS::DataRepresentation
 
class  OpenDDS::DataRepresentationAnnotation
 
struct  OpenDDS::internal::NoDynamicDataAdapterAnnotation
 
class  OpenDDS::internal::SpecialSerializationAnnotation
 

Namespaces

 OpenDDS
 The Internal API and Implementation of OpenDDS.
 
 OpenDDS::internal
 

Enumerations

enum  AutoidKind { autoidkind_sequential, autoidkind_hash }
 
enum  ExtensibilityKind { extensibilitykind_final, extensibilitykind_appendable, extensibilitykind_mutable }
 
enum  TryConstructFailAction { tryconstructfailaction_discard, tryconstructfailaction_use_default, tryconstructfailaction_trim }
 

Functions

AST_Expression::AST_ExprValue * get_annotation_member_ev (AST_Annotation_Appl *appl, const char *member_name, AST_Expression::ExprType type)
 
bool get_bool_annotation_member_value (AST_Annotation_Appl *appl, const char *member_name)
 
ACE_UINT32 get_u32_annotation_member_value (AST_Annotation_Appl *appl, const char *member_name)
 
std::string get_str_annotation_member_value (AST_Annotation_Appl *appl, const char *member_name)
 

Enumeration Type Documentation

◆ AutoidKind

enum AutoidKind
Enumerator
autoidkind_sequential 
autoidkind_hash 

Definition at line 217 of file annotations.h.

◆ ExtensibilityKind

Enumerator
extensibilitykind_final 
extensibilitykind_appendable 
extensibilitykind_mutable 

Definition at line 278 of file annotations.h.

◆ TryConstructFailAction

Enumerator
tryconstructfailaction_discard 
tryconstructfailaction_use_default 
tryconstructfailaction_trim 

Definition at line 316 of file annotations.h.

Function Documentation

◆ get_annotation_member_ev()

AST_Expression::AST_ExprValue* get_annotation_member_ev ( AST_Annotation_Appl *  appl,
const char *  member_name,
AST_Expression::ExprType  type 
)

Definition at line 93 of file annotations.cpp.

References be_util::misc_error_and_abort().

Referenced by get_bool_annotation_member_value(), get_str_annotation_member_value(), and get_u32_annotation_member_value().

95 {
96  AST_Annotation_Member* member =
97  dynamic_cast<AST_Annotation_Member*>((*appl)[member_name]);
98  if (member) {
99  AST_Expression* e = member->value();
100  if (e && e->ev()) {
101  if (e->ev()->et != type) {
102  be_util::misc_error_and_abort(std::string("Found unexpected expression type "
103  "while getting value of member \"") +
104  member_name + "\" of annotation \"" +
105  appl->local_name()->get_string() + '"',
106  appl);
107  }
108  return e->ev();
109  }
110  }
111 
112  be_util::misc_error_and_abort(std::string("Found null pointer while getting value of member \"") +
113  member_name + "\" of annotation \"" +
114  appl->local_name()->get_string() + '"',
115  appl);
116  return 0;
117 }
void misc_error_and_abort(const std::string &message, AST_Decl *node=0)
Report a miscellaneous error and abort.

◆ get_bool_annotation_member_value()

bool get_bool_annotation_member_value ( AST_Annotation_Appl *  appl,
const char *  member_name 
)

Definition at line 119 of file annotations.cpp.

References get_annotation_member_ev().

Referenced by get_str_annotation_member_value().

121 {
122  AST_Expression::AST_ExprValue* const ev =
123  get_annotation_member_ev(appl, member_name, AST_Expression::EV_bool);
124  return ev->u.bval;
125 }
AST_Expression::AST_ExprValue * get_annotation_member_ev(AST_Annotation_Appl *appl, const char *member_name, AST_Expression::ExprType type)
Definition: annotations.cpp:93

◆ get_str_annotation_member_value()

std::string get_str_annotation_member_value ( AST_Annotation_Appl *  appl,
const char *  member_name 
)

Definition at line 135 of file annotations.cpp.

References get_annotation_member_ev(), get_bool_annotation_member_value(), get_str_annotation_member_value(), get_u32_annotation_member_value(), and AnnotationWithValue< T >::value_from_appl().

Referenced by get_str_annotation_member_value(), TopicAnnotation::value_from_appl(), and OpenDDS::internal::SpecialSerializationAnnotation::value_from_appl().

137 {
138  AST_Expression::AST_ExprValue* const ev =
139  get_annotation_member_ev(appl, member_name, AST_Expression::EV_string);
140  return ev->u.strval->get_string();
141 }
AST_Expression::AST_ExprValue * get_annotation_member_ev(AST_Annotation_Appl *appl, const char *member_name, AST_Expression::ExprType type)
Definition: annotations.cpp:93

◆ get_u32_annotation_member_value()

ACE_UINT32 get_u32_annotation_member_value ( AST_Annotation_Appl *  appl,
const char *  member_name 
)

Definition at line 127 of file annotations.cpp.

References get_annotation_member_ev().

Referenced by get_str_annotation_member_value(), AnnotationWithEnumValue< ExtensibilityKind >::value_from_appl(), and OpenDDS::DataRepresentationAnnotation::value_from_appl().

129 {
130  AST_Expression::AST_ExprValue* const ev =
131  get_annotation_member_ev(appl, member_name, AST_Expression::EV_ulong);
132  return ev->u.ulval;
133 }
AST_Expression::AST_ExprValue * get_annotation_member_ev(AST_Annotation_Appl *appl, const char *member_name, AST_Expression::ExprType type)
Definition: annotations.cpp:93