OpenDDS  Snapshot(2023/04/28-20:55)
Public Member Functions | List of all members
TryConstructAnnotation Class Reference

#include <annotations.h>

Inheritance diagram for TryConstructAnnotation:
Inheritance graph
[legend]
Collaboration diagram for TryConstructAnnotation:
Collaboration graph
[legend]

Public Member Functions

 TryConstructAnnotation ()
 
std::string definition () const
 
std::string name () const
 
TryConstructFailAction sequence_element_value (AST_Sequence *node) const
 
TryConstructFailAction array_element_value (AST_Array *node) const
 
TryConstructFailAction union_value (AST_Union *node) const
 
- Public Member Functions inherited from AnnotationWithValue< TryConstructFailAction >
virtual bool node_value_exists (AST_Decl *node, TryConstructFailAction &value) const
 
- Public Member Functions inherited from Annotation
 Annotation ()
 
virtual ~Annotation ()
 
virtual std::string module () const
 
virtual std::string fullname () const
 
AST_Annotation_Decl * declaration () const
 
AST_Annotation_Appl * find_on (AST_Decl *node) const
 
void cache ()
 
- Public Member Functions inherited from AbsentValue< TryConstructFailAction >
 AbsentValue (const TryConstructFailAction &value)
 

Additional Inherited Members

- Public Attributes inherited from AbsentValue< TryConstructFailAction >
const TryConstructFailAction absent_value
 
- Protected Member Functions inherited from AnnotationWithEnumValue< TryConstructFailAction >
TryConstructFailAction value_from_appl (AST_Annotation_Appl *appl) const
 

Detailed Description

Definition at line 322 of file annotations.h.

Constructor & Destructor Documentation

◆ TryConstructAnnotation()

TryConstructAnnotation::TryConstructAnnotation ( )
inline

Member Function Documentation

◆ array_element_value()

TryConstructFailAction TryConstructAnnotation::array_element_value ( AST_Array *  node) const

Definition at line 418 of file annotations.cpp.

References Annotation::declaration().

Referenced by invalid_option().

419 {
420  AST_Annotation_Appl* appl = node->base_type_annotations().find(declaration());
421  if (!appl) { return absent_value; }
422  return value_from_appl(appl);
423 }
AST_Annotation_Decl * declaration() const
Definition: annotations.cpp:75
const TryConstructFailAction absent_value
Definition: annotations.h:104
TryConstructFailAction value_from_appl(AST_Annotation_Appl *appl) const
Definition: annotations.h:148

◆ definition()

std::string TryConstructAnnotation::definition ( ) const
virtual

Implements Annotation.

Definition at line 393 of file annotations.cpp.

394 {
395  return
396  "@annotation try_construct {\n"
397  " enum TryConstructFailAction {\n"
398  " DISCARD,\n"
399  " USE_DEFAULT,\n"
400  " TRIM\n"
401  " };\n"
402  " TryConstructFailAction value default USE_DEFAULT;\n"
403  "};\n";
404 }

◆ name()

std::string TryConstructAnnotation::name ( void  ) const
virtual

Implements Annotation.

Definition at line 406 of file annotations.cpp.

407 {
408  return "try_construct";
409 }

◆ sequence_element_value()

TryConstructFailAction TryConstructAnnotation::sequence_element_value ( AST_Sequence *  node) const

Definition at line 411 of file annotations.cpp.

References Annotation::declaration().

Referenced by invalid_option().

412 {
413  AST_Annotation_Appl* appl = node->base_type_annotations().find(declaration());
414  if (!appl) { return absent_value; }
415  return value_from_appl(appl);
416 }
AST_Annotation_Decl * declaration() const
Definition: annotations.cpp:75
const TryConstructFailAction absent_value
Definition: annotations.h:104
TryConstructFailAction value_from_appl(AST_Annotation_Appl *appl) const
Definition: annotations.h:148

◆ union_value()

TryConstructFailAction TryConstructAnnotation::union_value ( AST_Union *  node) const

Definition at line 425 of file annotations.cpp.

References Annotation::declaration().

Referenced by invalid_option().

426 {
427  AST_Annotation_Appl* appl = node->disc_annotations().find(declaration());
428  if (!appl) { return absent_value; }
429  return value_from_appl(appl);
430 }
AST_Annotation_Decl * declaration() const
Definition: annotations.cpp:75
const TryConstructFailAction absent_value
Definition: annotations.h:104
TryConstructFailAction value_from_appl(AST_Annotation_Appl *appl) const
Definition: annotations.h:148

The documentation for this class was generated from the following files: