boost::openmethod::missing_base

Missing base.

Synopsis

Declared in <boost/openmethod/preamble.hpp>

struct missing_base
    : openmethod_error

Description

A class used in an overrider virtual parameter was not registered as a derived class of the class in the same position in the method's virtual parameter list.

Example

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.

In the following code, OpenMethod cannot infer that Dog is derived from Animal, because they are not registered in a same call to BOOST_OPENMETHOD_CLASSES.

// registered separately, so the inheritance is never seen
BOOST_OPENMETHOD_CLASSES(Animal);
BOOST_OPENMETHOD_CLASSES(Dog);

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

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

// aborts with error message: missing base Animal -<| Dog
initialize();

Fix:

BOOST_OPENMETHOD_CLASSES(Animal, Dog);

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

base

The type_id of the base class.

derived

The type_id of the derived class.

See Also

Created with MrDocs