X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/92d7eb81980a40dda0715b23e874a1537cf3adb8..e02d85948b5f10d8b37e39ec94d915c48f46a15a:/named_object_list.h diff --git a/named_object_list.h b/named_object_list.h index 2c91263..929a0db 100644 --- a/named_object_list.h +++ b/named_object_list.h @@ -4,6 +4,17 @@ #include #include +// Define an associative container that maps a name with a class and a +// description. All classes must be derived from a same base class. +// +// We can then use the name to create an object of the associated +// class, and to retrieve a pointer to this object. +// +// Furthermore, it is possible to iterate over the elements to get +// their name and their description. + +// I am too lazy to comment the code, which should be obvious... + //===== arity 0 ===== template @@ -143,6 +154,7 @@ public: //=================== +// "NOL" like in Named_Object_List.... #define NOL_INSERT(name, descr, class) insert(name, new creator(descr)) #endif // !NAMED_OBJECT_LIST_H