X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/f3cbd5740fd2c6e770459ed6e10826b7a317c2d2..b78d5563826957045678f4c3bcfdcef6c9bfc48d:/named_object_list.h?ds=sidebyside 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