Commit 7bb148d3 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Tests for ROOT-8176


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@20097 4525493e-7705-40b1-a816-d608a930855b
parent 8a86c224
#include <memory>
#include <iostream>
class IInt {
public:
virtual ~IInt(){}
virtual int getint() = 0;
};
class Int : virtual public IInt {
public:
virtual ~Int(){}
Int( int i ) : m_i(i) {}
int getint() { return m_i; };
private:
int m_i;
Int();
};
typedef std::shared_ptr<IInt> IIntPtr;
class root8176 {
public:
IIntPtr handle( int i )
{
std::shared_ptr<Int> spi( new Int( i ) );
return spi;
}
void printpi( IInt* pi )
{
std::cout << pi->getint() << std::endl;
}
};
import cppyy
cppyy.gbl.gInterpreter.Declare('#include "root8176.h"')
r=cppyy.gbl.root8176()
print r
spi1=r.handle(1)
print spi1
pi1=spi1.get()
print pi1
r.printpi(pi1)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment