Here it is.
The file fyrespost.h contains includes to all my .h files
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "NASTRAN/material/material.h"
#include "pyferespost.h"
#include "NastranMaterial.pypp.hpp"
namespace bp = boost::python;
struct material_wrapper : postLib::nastran::material, bp::wrapper<
postLib::nastran::material > {
material_wrapper( )
: postLib::nastran::material( )
, bp::wrapper< postLib::nastran::material >(){
// null constructor
}
material_wrapper(::postLib::nastran::material const & in )
: postLib::nastran::material( boost::ref(in) )
, bp::wrapper< postLib::nastran::material >(){
// copy constructor
}
virtual bool fillClaMaterial( ::postLib::cla::material & tmpMat ) const {
if( bp::override func_fillClaMaterial = this->get_override(
"fillClaMaterial" ) )
return func_fillClaMaterial( boost::ref(tmpMat) );
else
return this->postLib::nastran::material::fillClaMaterial(
boost::ref(tmpMat) );
}
bool default_fillClaMaterial( ::postLib::cla::material & tmpMat ) const {
return postLib::nastran::material::fillClaMaterial(
boost::ref(tmpMat) );
}
virtual void write( ::std::ostream & os ) const {
if( bp::override func_write = this->get_override( "write" ) )
func_write( boost::ref(os) );
else
this->postLib::nastran::material::write( boost::ref(os) );
}
void default_write( ::std::ostream & os ) const {
postLib::nastran::material::write( boost::ref(os) );
}
};
void register_NastranMaterial_class(){
{ //::postLib::nastran::material
typedef bp::class_< material_wrapper > NastranMaterial_exposer_t;
NastranMaterial_exposer_t NastranMaterial_exposer =
NastranMaterial_exposer_t( "NastranMaterial" );
bp::scope NastranMaterial_scope( NastranMaterial_exposer );
bp::class_< postLib::nastran::material::matType >(
"NastranMattype" )
.def(
"activate"
, &::postLib::nastran::material::matType::activate
, ( bp::arg("typeName") ) )
.def(
"desactivate"
, &::postLib::nastran::material::matType::desactivate
, ( bp::arg("typeName") ) )
.def(
"getIdFromName"
, &::postLib::nastran::material::matType::getIdFromName
, ( bp::arg("typeName") ) )
.def(
"getNameFromId"
, &::postLib::nastran::material::matType::getNameFromId
, ( bp::arg("typeId") ) )
.def(
"isActive"
, (bool (*)( int ))(
&::postLib::nastran::material::matType::isActive )
, ( bp::arg("typeId") ) )
.def(
"isActive"
, (bool (*)( ::std::string const & ))(
&::postLib::nastran::material::matType::isActive )
, ( bp::arg("typeName") ) )
.def(
"isTotallySupported"
, (bool ( ::postLib::nastran::material::matType::* )(
int ) )( &::postLib::nastran::material::matType::isTotallySupported )
, ( bp::arg("typeId") ) )
.def(
"isTotallySupported"
, (bool ( ::postLib::nastran::material::matType::* )(
::std::string const & ) )(
&::postLib::nastran::material::matType::isTotallySupported )
, ( bp::arg("typeName") ) )
.def_readonly( "CREEP",
postLib::nastran::material::matType::CREEP )
.def_readonly( "MAT1",
postLib::nastran::material::matType::MAT1 )
.def_readonly( "MAT10",
postLib::nastran::material::matType::MAT10 )
.def_readonly( "MAT11",
postLib::nastran::material::matType::MAT11 )
.def_readonly( "MAT2",
postLib::nastran::material::matType::MAT2 )
.def_readonly( "MAT3",
postLib::nastran::material::matType::MAT3 )
.def_readonly( "MAT4",
postLib::nastran::material::matType::MAT4 )
.def_readonly( "MAT5",
postLib::nastran::material::matType::MAT5 )
.def_readonly( "MAT8",
postLib::nastran::material::matType::MAT8 )
.def_readonly( "MAT9",
postLib::nastran::material::matType::MAT9 )
.def_readonly( "MATHP",
postLib::nastran::material::matType::MATHP )
.def_readonly( "MATS1",
postLib::nastran::material::matType::MATS1 )
.def_readonly( "MATT1",
postLib::nastran::material::matType::MATT1 )
.def_readonly( "MATT2",
postLib::nastran::material::matType::MATT2 )
.def_readonly( "MATT3",
postLib::nastran::material::matType::MATT3 )
.def_readonly( "MATT4",
postLib::nastran::material::matType::MATT4 )
.def_readonly( "MATT5",
postLib::nastran::material::matType::MATT5 )
.def_readonly( "MATT8",
postLib::nastran::material::matType::MATT8 )
.def_readonly( "MATT9",
postLib::nastran::material::matType::MATT9 )
.def_readwrite( "activeCards",
postLib::nastran::material::matType::activeCards )
.def_readwrite( "mapNamesIds",
postLib::nastran::material::matType::mapNamesIds )
.staticmethod( "activate" )
.staticmethod( "desactivate" )
.staticmethod( "getIdFromName" )
.staticmethod( "getNameFromId" )
.staticmethod( "isActive" );
NastranMaterial_exposer.def( bp::init< >() );
NastranMaterial_exposer.def( bp::init<
postLib::nastran::material const & >(( bp::arg("in") )) );
{ //::postLib::nastran::material::clear
typedef void (
::postLib::nastran::material::*clear_function_type )( ) ;
NastranMaterial_exposer.def(
"clear"
, clear_function_type( &::postLib::nastran::material::clear ) );
}
{ //::postLib::nastran::material::fillClaMaterial
typedef bool (
::postLib::nastran::material::*fillClaMaterial_function_type )(
::postLib::cla::material & ) const;
typedef bool (
material_wrapper::*default_fillClaMaterial_function_type )(
::postLib::cla::material & ) const;
NastranMaterial_exposer.def(
"fillClaMaterial"
,
fillClaMaterial_function_type(&::postLib::nastran::material::fillClaMaterial)
,
default_fillClaMaterial_function_type(&material_wrapper::default_fillClaMaterial)
, ( bp::arg("tmpMat") ) );
}
{ //::postLib::nastran::material::getNbrWords
typedef unsigned int (
::postLib::nastran::material::*getNbrWords_function_type )( ) const;
NastranMaterial_exposer.def(
"getNbrWords"
, getNbrWords_function_type(
&::postLib::nastran::material::getNbrWords ) );
}
{ //::postLib::nastran::material::getType
typedef int (
::postLib::nastran::material::*getType_function_type )( ) const;
NastranMaterial_exposer.def(
"getType"
, getType_function_type(
&::postLib::nastran::material::getType ) );
}
{ //::postLib::nastran::material::getTypeName
typedef ::std::string (
::postLib::nastran::material::*getTypeName_function_type )( ) const;
NastranMaterial_exposer.def(
"getTypeName"
, getTypeName_function_type(
&::postLib::nastran::material::getTypeName ) );
}
{ //::postLib::nastran::material::getWords
typedef int const * (
::postLib::nastran::material::*getWords_function_type )( ) const;
NastranMaterial_exposer.def(
"getWords"
, getWords_function_type(
&::postLib::nastran::material::getWords )
, bp::return_value_policy<
pyplusplus::call_policies::return_pointee_value >() );
}
{ //::postLib::nastran::material::operator=
typedef ::postLib::nastran::material const & (
::postLib::nastran::material::*assign_function_type )(
::postLib::nastran::material const & ) ;
NastranMaterial_exposer.def(
"assign"
, assign_function_type(
&::postLib::nastran::material::operator= )
, ( bp::arg("in") )
, bp::return_value_policy< bp::copy_const_reference >() );
}
{ //::postLib::nastran::material::scanBdfCard
typedef void ( *scanBdfCard_function_type )(
::postLib::generic::dataBase &,::postLib::nastran::scanBdf::card const
& );
NastranMaterial_exposer.def(
"scanBdfCard"
, scanBdfCard_function_type(
&::postLib::nastran::material::scanBdfCard )
, ( bp::arg("DB"), bp::arg("tmpCard") ) );
}
{ //::postLib::nastran::material::scanOp2Record
typedef void ( *scanOp2Record_function_type )(
::postLib::generic::dataBase &,::std::string,int,::std::vector< int >
& );
NastranMaterial_exposer.def(
"scanOp2Record"
, scanOp2Record_function_type(
&::postLib::nastran::material::scanOp2Record )
, ( bp::arg("DB"), bp::arg("hName"), bp::arg("nbr"),
bp::arg("iBlock") ) );
}
{ //::postLib::nastran::material::setNbrWords
typedef void (
::postLib::nastran::material::*setNbrWords_function_type )( unsigned
int ) ;
NastranMaterial_exposer.def(
"setNbrWords"
, setNbrWords_function_type(
&::postLib::nastran::material::setNbrWords )
, ( bp::arg("nbr") ) );
}
{ //::postLib::nastran::material::write
typedef void (
::postLib::nastran::material::*write_function_type )( ::std::ostream &
) const;
typedef void (
material_wrapper::*default_write_function_type )( ::std::ostream & )
const;
NastranMaterial_exposer.def(
"write"
, write_function_type(&::postLib::nastran::material::write)
, default_write_function_type(&material_wrapper::default_write)
, ( bp::arg("os") ) );
}
NastranMaterial_exposer.staticmethod( "scanBdfCard" );
NastranMaterial_exposer.staticmethod( "scanOp2Record" );
}
}
2008/6/12, Roman Yakovenko <rom...@gm...>:
> On Thu, Jun 12, 2008 at 1:33 PM, Vincent Ferries
> <vin...@gm...> wrote:
>> I added some different call_policies to wrap some functions.
>> These functions where not fully wrapped due to missing informations on
>> call_policies.
>> I added the following call_policy :
>>
>> function.call_policies =
>> call_policies.return_value_policy(call_policies.return_pointee_value)
>>
>> I encounter problems during compilation :
>>
>> wrappers/NastranMaterial.pypp.cpp: In function 'void
>> register_NastranMaterial_class()':
>> wrappers/NastranMaterial.pypp.cpp:179: error: 'pyplusplus' was not
>> declared in this scope
>> wrappers/NastranMaterial.pypp.cpp:179: error: template argument 1 is
>> invalid
>> scons: *** [wrappers/NastranMaterial.pypp.os] Error 1
>> scons: building terminated because of errors.
>>
>> There is nothing in the examples on call_policies I haven't in my python
>> script.
>> Am I missing something?
>
> Do you replace "include" files? Can you post NastranMaterial.pypp.cpp file?
>
> Thanks
>
>
> --
> Roman Yakovenko
> C++ Python language binding
> http://www.language-binding.net/
>
|