extractbad_extractextract
The function template extract allows the object bound to an interface instance to be retrieved in a type-safe manner.
<boost/interfaces/extract.hpp>namespace boost { namespace interfaces { class bad_extract : public std::bad_cast { public: const char* what() const throw(); }; template<typename T, typename Interface> T& extract(const Interface& i); // throw(bad_extract) } } // End namespace boost::interfaces
bad_extractThe class bad_extract is an exception type thrown by extract to indicate that an extraction has failed.
bad_extract::whatconst char* what() const throw();
Returns an implementation-defined string identifying this exception as an instance of bad_extract.
extracttemplate<typename T, typename Interface> T& extract(const Interface& i);
| Interface | - |
An interface defined using the Interface Definition Language (IDL). |
| T | - |
A class implementing Interface. |
Retrieves the object bound to i as a reference to T.
The extraction will succeed only if i is bound to an object and if the static type of the object, at the point it was bound to i, is the same as or derived from T. If the extraction cannot succeed, extract throws an exception of type bad_extract.
extract is implemented using exception handling, and is therefore a relatively expensive operation.
Revised 20 Jan, 2005
© Copyright Jonathan Turkanis, 2005. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Sha'arei Tefila, an Orthodox Shul (Synagogue) in Salt Lake City, Utah Chabad Lubavitch of Utah