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

#include <annotations.h>

Collaboration diagram for Annotations:
Collaboration graph
[legend]

Public Member Functions

 Annotations ()
 
 ~Annotations ()
 
void register_all ()
 
Annotationoperator[] (const std::string &annotation) const
 
template<typename T >
void register_one ()
 

Private Types

typedef std::map< std::string, Annotation * > MapType
 

Private Attributes

MapType map_
 

Detailed Description

Definition at line 39 of file annotations.h.

Member Typedef Documentation

◆ MapType

typedef std::map<std::string, Annotation*> Annotations::MapType
private

Definition at line 56 of file annotations.h.

Constructor & Destructor Documentation

◆ Annotations()

Annotations::Annotations ( )

Definition at line 36 of file annotations.cpp.

37 {
38 }

◆ ~Annotations()

Annotations::~Annotations ( )

Definition at line 40 of file annotations.cpp.

References map_.

41 {
42  for (MapType::iterator i = map_.begin(); i != map_.end(); ++i) {
43  delete i->second;
44  }
45 }
MapType map_
Definition: annotations.h:57

Member Function Documentation

◆ operator[]()

Annotation * Annotations::operator[] ( const std::string &  annotation) const

Definition at line 47 of file annotations.cpp.

References map_, and be_util::misc_error_and_abort().

48 {
49  const MapType::const_iterator i = map_.find(annotation);
50  if (i == map_.end()) {
51  be_util::misc_error_and_abort(std::string("No such annotation: ") + annotation);
52  }
53  return i->second;
54 }
MapType map_
Definition: annotations.h:57
void misc_error_and_abort(const std::string &message, AST_Decl *node=0)
Report a miscellaneous error and abort.

◆ register_all()

void Annotations::register_all ( )

Definition at line 14 of file annotations.cpp.

Referenced by BE_post_init().

15 {
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>();
34 }

◆ register_one()

template<typename T >
void Annotations::register_one ( )
inline

Definition at line 48 of file annotations.h.

References map_.

49  {
50  T* annotation = new T;
51  map_[annotation->fullname()] = annotation;
52  annotation->cache();
53  }
MapType map_
Definition: annotations.h:57

Member Data Documentation

◆ map_

MapType Annotations::map_
private

Definition at line 57 of file annotations.h.

Referenced by operator[](), register_one(), and ~Annotations().


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