File indexing completed on 2026-08-06 09:38:32
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ThePEG_DescriptionList_H
0010 #define ThePEG_DescriptionList_H
0011
0012
0013 #include "ThePEG/Config/ThePEG.h"
0014 #include "ClassDescription.fh"
0015
0016 namespace ThePEG {
0017
0018
0019
0020
0021
0022 class DescriptionList {
0023
0024 public:
0025
0026 #ifndef THEPEG_DYNAMIC_TYPE_INFO_BUG
0027
0028 typedef map<const type_info *, ClassDescriptionBase *> DescriptionMap;
0029 #else
0030
0031 typedef map<string, ClassDescriptionBase *> DescriptionMap;
0032 #endif
0033
0034
0035
0036 typedef map<string, ClassDescriptionBase *> StringMap;
0037
0038 public:
0039
0040
0041
0042
0043 static void Register(ClassDescriptionBase &);
0044
0045
0046
0047
0048 static inline const ClassDescriptionBase * find(const type_info & ti) {
0049 #ifndef THEPEG_DYNAMIC_TYPE_INFO_BUG
0050 DescriptionMap::const_iterator it = descriptionMap().find(&ti);
0051 #else
0052 DescriptionMap::const_iterator it = descriptionMap().find(ti.name());
0053 #endif
0054 if ( it == descriptionMap().end() ) return 0;
0055 return (*it).second;
0056 }
0057
0058
0059
0060
0061 static string className(const type_info & ti);
0062
0063
0064
0065
0066 static int version(const type_info & ti);
0067
0068
0069
0070
0071
0072 static string library(const type_info & ti);
0073
0074
0075
0076
0077 static inline const ClassDescriptionBase * find(const string & name) {
0078 StringMap::const_iterator it = stringMap().find(name);
0079 if ( it == stringMap().end() ) return 0;
0080 return it->second;
0081 }
0082
0083
0084
0085
0086
0087 static inline const DescriptionMap & all() { return descriptionMap(); }
0088
0089
0090
0091
0092
0093 static void printHierarchies(ostream & os);
0094
0095 protected:
0096
0097
0098
0099
0100 static void hookup();
0101
0102
0103
0104
0105 static void insert(ClassDescriptionBase & pb);
0106
0107
0108
0109
0110
0111
0112 static DescriptionMap & descriptionMap();
0113
0114
0115
0116
0117
0118
0119 static StringMap & stringMap();
0120
0121 };
0122
0123 }
0124
0125 #endif