x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
enum.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\python\enum.hpp
Girar
Efecto
Propiedad
Historial
// Copyright David Abrahams 2002. // 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) #ifndef ENUM_DWA200298_HPP # define ENUM_DWA200298_HPP # include
# include
# include
# include
namespace boost { namespace python { template
struct enum_ : public objects::enum_base { typedef objects::enum_base base; // Declare a new enumeration type in the current scope() enum_(char const* name, char const* doc = 0); // Add a new enumeration value with the given name and value. inline enum_
& value(char const* name, T); // Add all of the defined enumeration values to the current scope with the // same names used here. inline enum_
& export_values(); private: static PyObject* to_python(void const* x); static void* convertible_from_python(PyObject* obj); static void construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data); }; template
inline enum_
::enum_(char const* name, char const* doc ) : base( name , &enum_
::to_python , &enum_
::convertible_from_python , &enum_
::construct , type_id
() , doc ) { } // This is the conversion function that gets registered for converting // these enums to Python. template
PyObject* enum_
::to_python(void const* x) { return base::to_python( converter::registered
::converters.m_class_object , static_cast
(*(T const*)x)); } // // The following two static functions serve as the elements of an // rvalue from_python converter for the enumeration type. // // This checks that a given Python object can be converted to the // enumeration type. template
void* enum_
::convertible_from_python(PyObject* obj) { return PyObject_IsInstance( obj , upcast
( converter::registered
::converters.m_class_object)) ? obj : 0; } // Constructs an instance of the enumeration type in the from_python // data. template
void enum_
::construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data) { T x = static_cast
(PyInt_AS_LONG(obj)); void* const storage = ((converter::rvalue_from_python_storage
*)data)->storage.bytes; new (storage) T(x); data->convertible = storage; } template
inline enum_
& enum_
::value(char const* name, T x) { this->add_value(name, static_cast
(x)); return *this; } template
inline enum_
& enum_
::export_values() { this->base::export_values(); return *this; } }} // namespace boost::python #endif // ENUM_DWA200298_HPP
enum.hpp
Dirección de la página
Dirección del archivo
Anterior
21/85
Siguiente
Descargar
( 2 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.