28RegisteredObject<Root>::RegisteredObject()
32typename RegisteredObject<Root>::RegistryType&
44 return factory == 0 ? 0 : (*factory)(in);
51 std::cout <<
"Which type do you want? Possible values are:\n";
53 const std::string registered_name =
ask_string(
"Enter type",
"None");
static Root * ask_type_and_parameters()
ask the user for the type, and then calls read_registered_object(0, type)
Definition RegisteredObject.inl:49
static RegistryType & registry()
Static function returning the registry.
Definition RegisteredObject.inl:33
static void list_registered_names(std::ostream &stream)
List all possible registered names to the stream.
Definition RegisteredObject.inl:59
Root *(* RootFactory)(std::istream *)
The type of a root factory is a function, taking an istream* as argument, and returning a Root*.
Definition RegisteredObject.h:124
static Root * read_registered_object(std::istream *in, const std::string ®istered_name)
Construct a new object (of a type derived from Root, its actual type determined by the registered_nam...
Definition RegisteredObject.inl:41
FactoryRegistry< std::string, RootFactory, interfile_less > RegistryType
The type of the registry.
Definition RegisteredObject.h:126
string ask_string(const string &str, const string &default_value)
A function to ask a string from the user.
Definition utilities.cxx:67
This file declares various utility functions.