16#ifndef Type_info_included
17#define Type_info_included
63 void ajouter_type(
const Type_info& type_info);
64 static int search_type_info_name(
const char *nom,
int& index);
67 const char* names_ =
"rien";
69 mutable Nom * name_ =
nullptr;
70 mutable Nom * synonym_name_ =
nullptr;
72 Synonyme_info* synonym_=
nullptr;
80 Objet_U* (*cree_instance)()=
nullptr;
87 static int * types_homonymes;
89 static int nb_classes;
92 static int les_types_memsize;
class Nom: a character string for naming TRUST objects.
An array of character strings (VECT(Nom)).
Base class for TRUST objects (Objet_U).
Base class for output streams.
Models synonym information for Objet_U objects.
Models type information for Objet_U objects.
int instanciable() const
Returns 1 if the associated type is instantiable (cree_instance is non-null), 0 otherwise.
static int les_sous_types(const Nom &, Noms &sous_types)
Returns the names of the subtypes for a parent type identified by name.
Type_info(const char *name, Objet_U *(*f)(), int nb_bases=0, const Type_info **bases=0)
Constructor from a name, a factory function, and an array of base types.
Objet_U * instance() const
Creates an instance of the class associated with the type_info.
int has_base(const Type_info *p, int direct=0) const
Tests whether a type belongs to the base types of the considered type. If direct == 0,...
int can_cast(const Type_info *p) const
Traverses the type hierarchy. Returns 1 if p points to a subtype of the current type.
int same(const Type_info *p) const
Returns 1 if this==p, 0 otherwise.
static int est_un_type(const char *)
Tests whether a class of the given type exists. If a class T whose Type_info has the name nom exists,...
static Sortie & hierarchie(Sortie &)
Writes the full hierarchy of the considered type to an output stream.
static const Type_info * type_info_from_name(const char *type_name)
Static method that returns a pointer to the Type_info whose name is "type_name".
Sortie & bases(Sortie &) const
Writes the base types of the current type to an output stream.