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

#include <annotations.h>

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

Public Member Functions

 KeyAnnotation ()
 
std::string definition () const
 
std::string name () const
 
bool union_value (AST_Union *node) const
 
- Public Member Functions inherited from AnnotationWithValue< bool >
virtual bool node_value_exists (AST_Decl *node, bool &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< bool >
 AbsentValue (const bool &value)
 

Additional Inherited Members

- Public Attributes inherited from AbsentValue< bool >
const bool absent_value
 
- Protected Member Functions inherited from AnnotationWithValue< bool >
virtual bool value_from_appl (AST_Annotation_Appl *) const
 

Detailed Description

Definition at line 156 of file annotations.h.

Constructor & Destructor Documentation

◆ KeyAnnotation()

KeyAnnotation::KeyAnnotation ( )
inline

Definition at line 158 of file annotations.h.

References name.

159  : AbsentValue<bool>(false)
160  {}

Member Function Documentation

◆ definition()

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

Implements Annotation.

Definition at line 163 of file annotations.cpp.

164 {
165  return
166  "@annotation key {\n"
167  " boolean value default TRUE;\n"
168  "};\n";
169 }

◆ name()

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

Implements Annotation.

Definition at line 171 of file annotations.cpp.

172 {
173  return "key";
174 }

◆ union_value()

bool KeyAnnotation::union_value ( AST_Union *  node) const

Definition at line 176 of file annotations.cpp.

References Annotation::declaration().

Referenced by invalid_option().

177 {
178  AST_Annotation_Appl* appl = node->disc_annotations().find(declaration());
179  if (!appl) { return absent_value; }
180  return value_from_appl(appl);
181 }
AST_Annotation_Decl * declaration() const
Definition: annotations.cpp:75
virtual bool value_from_appl(AST_Annotation_Appl *) const
Definition: annotations.h:130
const bool absent_value
Definition: annotations.h:104

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