boost::openmethod::missing_class

Missing class.

Synopsis

Declared in <boost/openmethod/preamble.hpp>

struct missing_class
    : openmethod_error

Description

A class used as a virtual parameter in a method, an overrider or a method call was not registered.

Examples

The error goes to the registry's boost::openmethod::policies::error_handler policy, which writes the description shown in the comments; the program is then terminated. A handler may throw instead, to keep the program running.

Missing registration of a class used as a virtual parameter in a method:

BOOST_OPENMETHOD_CLASSES(Dog); // Animal is missing

BOOST_OPENMETHOD(poke, (virtual_ptr<Animal>), void);

BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr<Dog>), void) {
    // ...
}

// aborts with error message: unknown class Animal
initialize();

Missing registration of a class used as a virtual parameter in an overrider:

BOOST_OPENMETHOD_CLASSES(Animal); // Dog is missing

BOOST_OPENMETHOD(poke, (virtual_ptr<Animal>), void);

BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr<Dog>), void) {
    // ...
}

// aborts with error message: unknown class Dog
initialize();

Missing registration of a class used as a virtual parameter in a call:

// Bulldog is missing
BOOST_OPENMETHOD_CLASSES(Animal, Dog);

BOOST_OPENMETHOD(poke, (virtual_ptr<Animal>), void);

BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr<Dog>), void) {
    // ...
}

Bulldog hector;

// aborts with error message: unknown class Bulldog
poke(hector);

Base Classes

Name

Description

openmethod_error

Base class for all OpenMethod errors.

Member Functions

Name

Description

write

Write a short description to an output stream

Data Members

Name

Description

type

The type_id of the unknown class.

See Also

Created with MrDocs