Set of declared classes. More...
Public Member Functions | |
JSonClasses (JSonError::Handler handler={}) | |
Constructor. | |
template<class T > | |
JSonUserClass< T > & | addClass (JKString &classname) |
Declares a C++ class having a public no-argument constructor. More... | |
template<class T > | |
JSonUserClass< T > & | addClass (JKString &classname, std::function< T *()> creator) |
Declares a C++ class that is abstract or does not have a public no-argument constructor. More... | |
void | error (JSonError::Type type, JKString &arg, JKString &name) |
Displays an error. | |
const JSonClass * | getClass (JKString &classname) const |
Searches class from name. | |
const JSonClass * | getClass (const std::type_info &tinfo) const |
Searches class from typeinfo. | |
Set of declared classes.
|
inline |
Declares a C++ class having a public no-argument constructor.
The template argument is the c++ class, classname its UTF8 name. The no-argument constructor will be used when a pointee needs to be created.
JSonUserClass< T > & jsonserial::JSonClasses::addClass | ( | JKString & | classname, |
std::function< T *()> | creator | ||
) |
Declares a C++ class that is abstract or does not have a public no-argument constructor.
The template argument is the c++ class, classname its UTF8 name, creator the creator function that will be used when a pointee needs to be created. creator can be null if the class is an abstract class. Otherwise creator must return the newly created pointee as a pointer. creator can be a lambda, a static method, a non-member function.