Update of /cvsroot/cpptool/rfta/src/pyrfta
In directory sc8-pr-cvs1:/tmp/cvs-serv28468/src/pyrfta
Modified Files:
pyrfta.cpp pyrfta.dsp
Added Files:
ExposeBase.cpp ExposeStatements.cpp ExposeStatements2.cpp
ExposeStatements3.cpp ExposeVisitors.cpp Forwards.h
Log Message:
* added working python binding for code model statement
--- NEW FILE: ExposeBase.cpp ---
#include "Forwards.h"
#include <boost/python.hpp>
#include <rfta/refactoring/CodeModelElement.h>
using namespace boost::python;
using namespace Refactoring::CodeModel;
using Refactoring::SourceRange;
void
exposeBase()
{
class_<Change>( "Change" )
.def( init<Change::ChangeType, Refactoring::SourceRange>() )
.def( "wasReplaced", &Change::wasReplaced )
.def( "wasRemoved", &Change::wasRemoved )
.def( "wasAdded", &Change::wasAdded )
.def( "isUnmodified", &Change::isUnmodified )
.def_readwrite( "type", &Change::type_ )
.def_readwrite( "oldRange", &Change::oldRange_ )
;
enum_<Change::ChangeType>( "ChangeType" )
.value( "added", Change::added )
.value( "replaced", Change::replaced )
.value( "removed", Change::removed )
.value( "unmodified", Change::unmodified )
;
class_<SourceRange>( "SourceRange" )
.def( init<int,int>() )
.def( "moveStartIndexBy", &SourceRange::moveStartIndexBy )
.add_property( "startIndex", &SourceRange::getStartIndex )
.add_property( "endIndex", &SourceRange::getEndIndex )
.add_property( "length", &SourceRange::getLength, &SourceRange::setLength )
.def( "isEmpty", &SourceRange::isEmpty )
.def( "contains", &SourceRange::contains )
.def( "overlap", &SourceRange::overlap )
.def( "toString", &SourceRange::toString ) // should use str(self)
.def( self == self )
.def( self < self )
;
void (Element::*mfAcceptElementVisitor)( ElementVisitor & ) = &Element::accept;
class_<Element, ElementPtr, boost::noncopyable>( "Element" )
.def( "isFromSource", &Element::isFromSource )
.def( "getSourceText", &Element::getSourceText )
.def( "getSourceRange", &Element::getSourceRange )
// .def( "setSource", &Element::setSource )
// .def( "accept", mfAcceptElementVisitor )
;
}
--- NEW FILE: ExposeStatements.cpp ---
#include "Forwards.h"
#include <boost/python.hpp>
#include <rfta/refactoring/CodeModelStatements.h>
#include <rfta/refactoring/CodeModelExpressions.h>
using namespace boost::python;
using namespace Refactoring::CodeModel;
void
exposeStatements()
{
void (Statement::*mfAcceptStatementVisitor)( StatementVisitor & ) = &Statement::accept;
class_<Statement, bases<Element>, boost::noncopyable >( "Statement", no_init )
.def( "accept", mfAcceptStatementVisitor )
;
class_<CompoundStatement::StatementChange, bases<Change> >( "CompoundStatementChange",
init<Change::ChangeType, StatementPtr>() )
// .def_readwrite( "statement", &CompoundStatement::StatementChange::statement_ )
;
class_<CompoundStatement, CompoundStatementPtr, bases<Statement>, boost::noncopyable >( "CompoundStatement" )
.def( "removeStatementAt", &CompoundStatement::removeStatementAt )
.def( "appendStatement", &CompoundStatement::appendStatement )
.def( "insertStatementAt", &CompoundStatement::insertStatementAt )
.def( "setStatementAt", &CompoundStatement::setStatementAt )
.def( "getStatementCount", &CompoundStatement::getStatementCount )
.def( "getStatementAt", &CompoundStatement::getStatementAt )
.def( "getChangeCount", &CompoundStatement::getChangeCount )
.def( "getChangeAt", &CompoundStatement::getChangeAt )
;
class_<ConditionStatement, bases<Statement>, boost::noncopyable>( "ConditionStatement", no_init )
.def( "getCondition", &ConditionStatement::getCondition )
.def( "setCondition", &ConditionStatement::setCondition )
.def( "getConditionChange", &ConditionStatement::getConditionChange )
;
class_<IfStatement, IfStatementPtr, bases<ConditionStatement>, boost::noncopyable>( "IfStatement",
init<ExpressionPtr, StatementPtr>() )
.def( init<ExpressionPtr, StatementPtr, StatementPtr>() )
.def( "getThenStatement", &IfStatement::getThenStatement )
.def( "setThenStatement", &IfStatement::setThenStatement )
.def( "getThenStatementChange", &IfStatement::getThenStatementChange )
.def( "hasElseStatement", &IfStatement::hasElseStatement )
.def( "getElseStatement", &IfStatement::getElseStatement )
.def( "setElseStatement", &IfStatement::setElseStatement )
.def( "getElseStatementChange", &IfStatement::getElseStatementChange )
.def( "getThenStatement", &IfStatement::getThenStatement )
.def( "getThenStatement", &IfStatement::getThenStatement )
;
class_<IterationStatement, bases<ConditionStatement>, boost::noncopyable >( "IterationStatement", no_init )
.def( "getIteratedStatement", &IterationStatement::getIteratedStatement )
.def( "setIteratedStatement", &IterationStatement::setIteratedStatement )
.def( "getIteratedStatementChange", &IterationStatement::getIteratedStatementChange )
;
}
--- NEW FILE: ExposeStatements2.cpp ---
#include "Forwards.h"
#include <boost/python.hpp>
#include <rfta/refactoring/CodeModelStatements.h>
#include <rfta/refactoring/CodeModelExpressions.h>
using namespace boost::python;
using namespace Refactoring::CodeModel;
void
exposeStatements2()
{
class_<WhileStatement, WhileStatementPtr, bases<IterationStatement>, boost::noncopyable >( "WhileStatement",
init<ExpressionPtr, StatementPtr>() )
;
class_<DoStatement, DoStatementPtr, bases<IterationStatement>, boost::noncopyable >( "DoStatement",
init<ExpressionPtr, StatementPtr>() )
;
class_<ForStatement, ForStatementPtr, bases<IterationStatement>, boost::noncopyable >( "ForStatement",
init<ExpressionPtr, ExpressionPtr, ExpressionPtr, StatementPtr>() )
.def( "getDeclaration", &ForStatement::getDeclaration )
.def( "setDeclaration", &ForStatement::setDeclaration )
.def( "getDeclarationChange", &ForStatement::getDeclarationChange )
.def( "getIteration", &ForStatement::getIteration )
.def( "setIteration", &ForStatement::setIteration )
.def( "getIterationChange", &ForStatement::getIterationChange )
;
class_<SwitchStatement, SwitchStatementPtr, bases<ConditionStatement>, boost::noncopyable >( "SwitchStatement",
init<ExpressionPtr, CompoundStatementPtr>() )
.def( "getStatements", &SwitchStatement::getStatements )
.def( "setStatements", &SwitchStatement::setStatements )
;
class_<CaseStatement, CaseStatementPtr, bases<Statement>, boost::noncopyable >( "CaseStatement",
init<ExpressionPtr>() )
.def( "getConditionValue", &CaseStatement::getConditionValue )
.def( "setConditionValue", &CaseStatement::setConditionValue )
.def( "getConditionChange", &CaseStatement::getConditionChange )
;
class_<DefaultStatement, DefaultStatementPtr, bases<Statement>, boost::noncopyable >( "DefaultStatement" )
;
class_<BreakStatement, BreakStatementPtr, bases<Statement>, boost::noncopyable >( "BreakStatement" )
;
class_<ContinueStatement, ContinueStatementPtr, bases<Statement>, boost::noncopyable >( "ContinueStatement" )
;
}
--- NEW FILE: ExposeStatements3.cpp ---
#include "Forwards.h"
#include <boost/python.hpp>
#include <rfta/refactoring/CodeModelStatements.h>
#include <rfta/refactoring/CodeModelExpressions.h>
using namespace boost::python;
using namespace Refactoring::CodeModel;
void
exposeStatements3()
{
class_<ReturnStatement, ReturnStatementPtr, bases<Statement>, boost::noncopyable >( "ReturnStatement" )
.def( init<ExpressionPtr>() )
.def( "hasValue", &ReturnStatement::hasValue )
.def( "getValue", &ReturnStatement::getValue )
.def( "setValue", &ReturnStatement::setValue )
.def( "getValueChange", &ReturnStatement::getValueChange )
;
class_<ExpressionStatement, ExpressionStatementPtr, bases<Statement>, boost::noncopyable >( "ExpressionStatement",
init<ExpressionPtr>() )
.def( "getExpression", &ExpressionStatement::getExpression )
.def( "setExpression", &ExpressionStatement::setExpression )
.def( "getExpressionChange", &ExpressionStatement::getExpressionChange )
;
class_<Label, LabelPtr, bases<Element>, boost::noncopyable >( "Label" )
.def( init<std::string>() )
.add_property( "labelName", &Label::getLabelName )
;
class_<LabelStatement, LabelStatementPtr, bases<Statement>, boost::noncopyable >( "LabelStatement", init<LabelPtr>() )
.add_property( "label", &LabelStatement::getLabel, &LabelStatement::setLabel )
;
class_<GotoStatement, GotoStatementPtr, bases<Statement>, boost::noncopyable >( "GotoStatement", init<LabelPtr>() )
.add_property( "label", &LabelStatement::getLabel, &LabelStatement::setLabel )
;
class_<NullStatement, NullStatementPtr, bases<Statement>, boost::noncopyable >( "NullStatement" )
;
}
--- NEW FILE: ExposeVisitors.cpp ---
#include "Forwards.h"
#include <boost/python.hpp>
#include <rfta/refactoring/CodeModelVisitor.h>
using namespace boost::python;
using namespace Refactoring::CodeModel;
class StatementVisitorWrap : public StatementVisitor
{
public:
PyObject *self;
StatementVisitorWrap( PyObject *self_ )
: self(self_)
{
}
void visit( const BreakStatementPtr &statement )
{
call_method<void>( self, "visitBreakStatement", object(statement) );
}
void visit( const CaseStatementPtr &statement )
{
call_method<void>( self, "visitCaseStatement", object(statement) );
}
void visit( const CompoundStatementPtr &statement )
{
call_method<void>( self, "visitCompoundStatement", object(statement) );
}
void visit( const ContinueStatementPtr &statement )
{
call_method<void>( self, "visitContinueStatement", object(statement) );
}
void visit( const DefaultStatementPtr &statement )
{
call_method<void>( self, "visitDefaultStatement", object(statement) );
}
void visit( const DeclarationStatementPtr &statement )
{
call_method<void>( self, "visitDeclarationStatement", object(statement) );
}
void visit( const DoStatementPtr &statement )
{
call_method<void>( self, "visitDoStatement", object(statement) );
}
void visit( const ExpressionStatementPtr &statement )
{
call_method<void>( self, "visitExpressionStatement", object(statement) );
}
void visit( const ForStatementPtr &statement )
{
call_method<void>( self, "visitForStatementStatement", object(statement) );
}
void visit( const GotoStatementPtr &statement )
{
call_method<void>( self, "visitGotoStatement", object(statement) );
}
void visit( const IfStatementPtr &statement )
{
call_method<void>( self, "visitIfStatement", object(statement) );
}
void visit( const LabelStatementPtr &statement )
{
call_method<void>( self, "visitLabelStatement", object(statement) );
}
void visit( const NullStatementPtr &statement )
{
call_method<void>( self, "visitNullStatement", object(statement) );
}
void visit( const ReturnStatementPtr &statement )
{
call_method<void>( self, "visitReturnStatement", object(statement) );
}
void visit( const SwitchStatementPtr &statement )
{
call_method<void>( self, "visitSwitchStatement", object(statement) );
}
void visit( const WhileStatementPtr &statement )
{
call_method<void>( self, "visitWhileStatement", object(statement) );
}
};
class ExpressionVisitorWrap : public ExpressionVisitor
{
public:
PyObject *self;
ExpressionVisitorWrap( PyObject *self_ )
: self(self_)
{
}
void visit( AssignInitializerExpression &expression )
{
call_method<void>( self, "visitAssignInitializerExpression", object(expression) );
}
void visit( ConstructorInitializerExpression &expression )
{
call_method<void>( self, "visitConstructorInitializerExpression", object(expression) );
}
void visit( DeclaratorExpression &expression )
{
call_method<void>( self, "visitDeclaratorExpression", object(expression) );
}
void visit( DefaultConditionExpression &expression )
{
call_method<void>( self, "visitDefaultConditionExpression", object(expression) );
}
void visit( Expression &expression )
{
call_method<void>( self, "visitExpression", object(expression) );
}
void visit( GenericExpression &expression )
{
call_method<void>( self, "visitGenericExpression", object(expression) );
}
void visit( NullExpression &expression )
{
call_method<void>( self, "visitNullExpression", object(expression) );
}
};
class ElementVisitorWrap : public ElementVisitor
, public StatementVisitorWrap
, public ExpressionVisitorWrap
{
ElementVisitorWrap( PyObject *self_ )
: StatementVisitorWrap( self_ )
, ExpressionVisitorWrap( self_ )
{
}
};
void
exposeVisitors()
{
class_<StatementVisitor, StatementVisitorWrap, boost::noncopyable>( "StatementVisitor" )
;
// class_<ExpressionVisitor, ExpressionVisitorWrap, boost::noncopyable>( "ExpressionVisitor", no_init )
;
// class_<ElementVisitor, ElementVisitorWrap, boost::noncopyable>( "ElementVisitor", no_init )
;
}
--- NEW FILE: Forwards.h ---
#ifndef PYRFTA_FORWARDS_INCLUDED
#define PYRFTA_FORWARDS_INCLUDED
void exposeBase();
void exposeStatements();
void exposeStatements2();
void exposeStatements3();
void exposeVisitors();
#endif // PYRFTA_FORWARDS_INCLUDED
Index: pyrfta.cpp
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/pyrfta/pyrfta.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pyrfta.cpp 2 Apr 2003 16:22:54 -0000 1.3
--- pyrfta.cpp 5 Apr 2003 18:29:01 -0000 1.4
***************
*** 1,7 ****
#include <boost/python.hpp>
! #include <rfta/refactoring/CodeModelVisitor.h>
! #include <rfta/refactoring/CodeModelStatements.h>
! #include <rfta/refactoring/CodeModelExpressions.h>
! #include <rfta/refactoring/PlainTextDocument.h>
// Notes: compiler memory allocation limits was reached after declaring two classes.
--- 1,6 ----
#include <boost/python.hpp>
! #include "Forwards.h"
!
! #include <iostream>
// Notes: compiler memory allocation limits was reached after declaring two classes.
***************
*** 10,336 ****
using namespace boost::python;
- using namespace Refactoring::CodeModel;
- using Refactoring::SourceRange;
! /* Boost.Python documentation bug:
!
! ** Virtual Functions with Default Implementations
! struct BaseWrap : Base
! {
! BaseWrap(PyObject* self_)
! : self(self_) {}
! int f() { return call_method<int>(self, "f"); }
! int default_f() { return Base::f(); } // <<=== ***ADDED***
! PyObject* self;
! };
!
! The following constructor is missing for successful compilation with VC6:
!
! BaseWrap(PyObject* self_, const Base &other)
! : Base(other)
! , self(self_) {}
! */
! class StatementVisitorWrap : public StatementVisitor
{
public:
! PyObject *self;
!
! StatementVisitorWrap( PyObject *self_ )
! : self(self_)
! {
! }
!
! void visit( BreakStatement &statement )
! {
! call_method<void>( self, "visitBreakStatement" );
! }
!
! void visit( CaseStatement &statement )
! {
! call_method<void>( self, "visitCaseStatement" );
! }
!
! void visit( CompoundStatement &statement )
! {
! call_method<void>( self, "visitCompoundStatement" );
! }
!
! void visit( ConditionStatement &statement )
! {
! call_method<void>( self, "visitConditionStatement" );
! }
!
! void visit( ContinueStatement &statement )
! {
! call_method<void>( self, "visitContinueStatement" );
! }
!
! void visit( DefaultStatement &statement )
! {
! call_method<void>( self, "visitDefaultStatement" );
! }
!
! void visit( DeclarationStatement &statement )
! {
! call_method<void>( self, "visitDeclarationStatement" );
! }
!
! void visit( DoStatement &statement )
! {
! call_method<void>( self, "visitDoStatement" );
! }
!
! void visit( ExpressionStatement &statement )
! {
! call_method<void>( self, "visitExpressionStatement" );
! }
!
! void visit( FlowControlStatement &statement )
! {
! call_method<void>( self, "visitFlowControlStatement" );
! }
!
! void visit( ForStatement &statement )
! {
! call_method<void>( self, "visitForStatementStatement" );
! }
!
! void visit( GotoStatement &statement )
! {
! call_method<void>( self, "visitGotoStatement" );
! }
!
! void visit( IfStatement &statement )
! {
! call_method<void>( self, "visitIfStatement" );
! }
!
! void visit( IterationStatement &statement )
! {
! call_method<void>( self, "visitIterationStatement" );
! }
!
! void visit( LabelStatement &statement )
{
- call_method<void>( self, "visitLabelStatement" );
}
! void visit( NullStatement &statement )
! {
! call_method<void>( self, "visitNullStatement" );
! }
- void visit( ReturnStatement &statement )
- {
- call_method<void>( self, "visitReturnStatement" );
- }
! void visit( SwitchLabelStatement &statement )
! {
! call_method<void>( self, "visitSwitchLabelStatement" );
! }
! void visit( SwitchStatement &statement )
{
- call_method<void>( self, "visitSwitchStatement" );
}
! void visit( WhileStatement &statement )
{
! call_method<void>( self, "visitWhileStatement" );
}
};
! class ExpressionVisitorWrap : public ExpressionVisitor
{
public:
- PyObject *self;
! ExpressionVisitorWrap( PyObject *self_ )
! : self(self_)
! {
! }
!
! void visit( AssignInitializerExpression &expression )
! {
! call_method<void>( self, "visitAssignInitializerExpression" );
! }
!
! void visit( ConstructorInitializerExpression &expression )
{
! call_method<void>( self, "visitConstructorInitializerExpression" );
}
! void visit( DeclaratorExpression &expression )
{
! call_method<void>( self, "visitDeclaratorExpression" );
}
! void visit( DefaultConditionExpression &expression )
{
! call_method<void>( self, "visitDefaultConditionExpression" );
}
! void visit( Expression &expression )
{
! call_method<void>( self, "visitExpression" );
}
! void visit( GenericExpression &expression )
{
! call_method<void>( self, "visitGenericExpression" );
}
! void visit( NullExpression &expression )
{
! call_method<void>( self, "visitNullExpression" );
}
- };
-
! class ElementVisitorWrap : public ElementVisitor
! , public StatementVisitorWrap
! , public ExpressionVisitorWrap
! {
! ElementVisitorWrap( PyObject *self_ )
! : StatementVisitorWrap( self_ )
! , ExpressionVisitorWrap( self_ )
! {
! }
};
!
! void statementAccept( StatementVisitor &visitor )
{
! // statement->accept( visitor );
}
-
-
-
- struct Base
- {
- virtual int f()
- {
- return 1;
- }
- };
-
- int call_f(Base& b) { return b.f(); }
-
-
- struct BaseWrap : Base
- {
- BaseWrap(PyObject* self_)
- : self(self_) {}
- BaseWrap(PyObject* self_, const Base &other)
- : Base(other)
- , self(self_) {}
- int f() { return call_method<int>(self, "f"); }
- int default_f() { return Base::f(); } // <<=== ***ADDED***
- PyObject* self;
- };
-
-
-
BOOST_PYTHON_MODULE(pyrfta)
{
! class_<Base, BaseWrap>("Base")
! .def("f", &Base::f, &BaseWrap::default_f)
! ;
! def("call_f", call_f);
!
!
!
! class_<Change>( "Change" )
! .def( init<Change::ChangeType, Refactoring::SourceRange>() )
! .def( "wasReplaced", &Change::wasReplaced )
! .def( "wasRemoved", &Change::wasRemoved )
! .def( "wasAdded", &Change::wasAdded )
! .def( "isUnmodified", &Change::isUnmodified )
! .def_readwrite( "type", &Change::type_ )
! .def_readwrite( "oldRange", &Change::oldRange_ )
! ;
!
! enum_<Change::ChangeType>( "ChangeType" )
! .value( "added", Change::added )
! .value( "replaced", Change::replaced )
! .value( "removed", Change::removed )
! .value( "unmodified", Change::unmodified )
! ;
!
! class_<SourceRange>( "SourceRange" )
! .def( init<int,int>() )
! .def( "moveStartIndexBy", &SourceRange::moveStartIndexBy )
! .add_property( "startIndex", &SourceRange::getStartIndex )
! .add_property( "endIndex", &SourceRange::getEndIndex )
! .add_property( "length", &SourceRange::getLength, &SourceRange::setLength )
! .def( "isEmpty", &SourceRange::isEmpty )
! .def( "contains", &SourceRange::contains )
! .def( "overlap", &SourceRange::overlap )
! .def( "toString", &SourceRange::toString ) // should use str(self)
! .def( self == self )
! .def( self < self )
! ;
!
! class_<StatementVisitor, StatementVisitorWrap, boost::noncopyable>( "StatementVisitor" )
! ;
!
! // class_<ExpressionVisitor, ExpressionVisitorWrap, boost::noncopyable>( "ExpressionVisitor", no_init )
! ;
!
! // class_<ElementVisitor, ElementVisitorWrap, boost::noncopyable>( "ElementVisitor", no_init )
! ;
!
! void (Element::*mfAcceptElementVisitor)( ElementVisitor & ) = &Element::accept;
! class_<Element>( "Element" )
! .def( "isFromSource", &Element::isFromSource )
! .def( "getSourceText", &Element::getSourceText )
! .def( "getSourceRange", &Element::getSourceRange )
! // .def( "setSource", &Element::setSource )
! // .def( "accept", mfAcceptElementVisitor )
! ;
!
! void (Statement::*mfAcceptStatementVisitor)( StatementVisitor & ) = &Statement::accept;
! class_<Statement, bases<Element>, boost::noncopyable >( "Statement", no_init )
! .def( "accept", mfAcceptStatementVisitor )
! ;
!
!
! class_<NullStatement, bases<Statement> >( "NullStatement" )
! ;
!
! class_<Label, bases<Element> >( "Label" )
! .def( init<std::string>() )
! .add_property( "labelName", &Label::getLabelName )
;
! class_<LabelHolderStatement>( "LabelHolderStatement", init<LabelPtr>() )
! .add_property( "label", &LabelHolderStatement::getLabel, &LabelHolderStatement::setLabel )
;
! class_<LabelStatement, bases<Statement,LabelHolderStatement> >( "LabelStatement", init<LabelPtr>() )
;
-
- def( "statementAccept", &statementAccept );
}
-
-
- /*
- class Visitor(StatementVisitor):
- ... def __init__( self ):
- ... pass
- ...
- ... def visitNullStatement( self, statement ):
- ... print "NullStatement visited"
- ...
- ... v = Visitor()
- ... s = NullStatement()
- */
\ No newline at end of file
--- 9,114 ----
using namespace boost::python;
! #include <boost/shared_ptr.hpp>
! #include <boost/enable_shared_from_this.hpp>
! class B;
! typedef boost::shared_ptr<B> BPtr;
! class AVisitor
{
public:
! virtual ~AVisitor()
{
}
! virtual void f( const BPtr &b ) = 0;
! };
! class AVisitorWrap : public AVisitor
! {
! public:
! PyObject *self_;
! AVisitorWrap( PyObject *self ) : self_( self )
{
}
! void f( const BPtr &b )
{
! call_method<void>( self_, "f", object( b ) );
}
};
! class B : public boost::enable_shared_from_this<B>
{
public:
! B( int value ) : value_( value )
{
! static int serial = 0;
! serial_ = ++serial;
! std::cout << "B Constructed( " << value_ << " ) : #" << serial_ << std::endl;
}
! ~B()
{
! std::cout << "B Destroyed( " << value_ << " ) : #" << serial_ << std::endl;
}
! void accept( AVisitor &visitor )
{
! visitor.f( shared_from_this() );
}
! int getValue() const
{
! return value_;
}
! long useCount() const
{
! return shared_from_this().use_count();
}
! int serial() const
{
! return serial_;
}
! int value_;
! int serial_;
};
! BPtr makeB( int value )
{
! return BPtr( new B( value ) );
}
BOOST_PYTHON_MODULE(pyrfta)
{
! exposeBase();
! exposeStatements();
! exposeStatements2();
! exposeStatements3();
! exposeVisitors();
! class_<B, boost::shared_ptr<B> >( "B", init<int>() )
! .def( "accept", &B::accept )
! .def( "count", &B::useCount )
! .def( "serial", &B::serial )
! .add_property( "value", &B::getValue )
! // .def_readonly( "value", &B::value_ ) // Not compiling !!!
;
! class_<AVisitor, AVisitorWrap, boost::noncopyable>( "AVisitor" )
;
! def( "makeB", &makeB )
;
}
Index: pyrfta.dsp
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/pyrfta/pyrfta.dsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pyrfta.dsp 1 Apr 2003 18:22:56 -0000 1.2
--- pyrfta.dsp 5 Apr 2003 18:29:01 -0000 1.3
***************
*** 44,48 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /c
! # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../include" /D "NDEBUG" /D "BOOST_PYTHON_STATIC_LINK" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "BOOST_PYTHON_DYNAMIC_LIB" /D "_USRDLL" /YX /FD /Zm200 /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
--- 44,48 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /c
! # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../include" /D "NDEBUG" /D "BOOST_PYTHON_STATIC_LINK" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "BOOST_PYTHON_DYNAMIC_LIB" /D "_USRDLL" /YX /FD /Zm500 /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
***************
*** 75,79 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /GZ /c
! # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "BOOST_PYTHON_DYNAMIC_LIB" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /Zm200 /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
--- 75,79 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /GZ /c
! # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "BOOST_PYTHON_DYNAMIC_LIB" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /Zm500 /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
***************
*** 98,101 ****
--- 98,133 ----
# Name "pyrfta - Win32 Release"
# Name "pyrfta - Win32 Debug"
+ # Begin Group "pytest"
+
+ # PROP Default_Filter ""
+ # Begin Source File
+
+ SOURCE=.\pytest\test.py
+ # End Source File
+ # End Group
+ # Begin Source File
+
+ SOURCE=.\ExposeBase.cpp
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\ExposeStatements.cpp
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\ExposeStatements2.cpp
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\ExposeStatements3.cpp
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\ExposeVisitors.cpp
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\Forwards.h
+ # End Source File
# Begin Source File
|