2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-27 19:12:16 +00:00

Move repr into int_wrapper, remove some unneeded header includes

[SVN r20391]
This commit is contained in:
Raoul Gough
2003-10-15 16:18:55 +00:00
parent 3847f1d455
commit 43e1dc9d5b
5 changed files with 5 additions and 65 deletions

View File

@@ -19,11 +19,6 @@
#include <boost/python/suite/indexing/container_suite.hpp>
#include <boost/python/suite/indexing/iterator_pair.hpp>
#include <boost/python/suite/indexing/container_proxy.hpp>
#include <string>
#include <sstream>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
@@ -54,13 +49,6 @@ boost::python::indexing::iterator_pair<int_wrapper *> get_array_wrap()
, boost::python::indexing::end(array));
}
std::string repr (int_wrapper const &i)
{
std::stringstream temp;
temp << i;
return temp.str();
}
BOOST_PYTHON_MODULE(test_array_ext)
{
boost::python::implicitly_convertible <int, int_wrapper>();
@@ -69,7 +57,7 @@ BOOST_PYTHON_MODULE(test_array_ext)
boost::python::class_<int_wrapper>("int_wrapper", boost::python::init<int>())
.def ("increment", &int_wrapper::increment)
.def ("__repr__", repr)
.def ("__repr__", &int_wrapper::repr)
.def ("__cmp__", compare)
;

View File

@@ -18,13 +18,8 @@
#include "int_wrapper.hpp"
#include <boost/python/suite/indexing/container_suite.hpp>
#include <boost/python/suite/indexing/iterator_pair.hpp>
#include <boost/python/suite/indexing/container_proxy.hpp>
#include <deque>
#include <string>
#include <sstream>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
@@ -34,13 +29,6 @@
bool int_wrapper::our_trace_flag = true;
unsigned int_wrapper::our_object_counter = 0;
std::string repr (int_wrapper const &i)
{
std::stringstream temp;
temp << i;
return temp.str();
}
BOOST_PYTHON_MODULE(test_deque_ext)
{
boost::python::implicitly_convertible <int, int_wrapper>();
@@ -49,7 +37,7 @@ BOOST_PYTHON_MODULE(test_deque_ext)
boost::python::class_<int_wrapper>("int_wrapper", boost::python::init<int>())
.def ("increment", &int_wrapper::increment)
.def ("__repr__", repr)
.def ("__repr__", &int_wrapper::repr)
.def ("__cmp__", compare)
;

View File

@@ -18,13 +18,7 @@
#include "int_wrapper.hpp"
#include <boost/python/suite/indexing/container_suite.hpp>
#include <boost/python/suite/indexing/iterator_pair.hpp>
#include <boost/python/suite/indexing/container_proxy.hpp>
#include <list>
#include <string>
#include <sstream>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
@@ -34,13 +28,6 @@
bool int_wrapper::our_trace_flag = true;
unsigned int_wrapper::our_object_counter = 0;
std::string repr (int_wrapper const &i)
{
std::stringstream temp;
temp << i;
return temp.str();
}
BOOST_PYTHON_MODULE(test_list_ext)
{
boost::python::implicitly_convertible <int, int_wrapper>();
@@ -49,7 +36,7 @@ BOOST_PYTHON_MODULE(test_list_ext)
boost::python::class_<int_wrapper>("int_wrapper", boost::python::init<int>())
.def ("increment", &int_wrapper::increment)
.def ("__repr__", repr)
.def ("__repr__", &int_wrapper::repr)
.def ("__cmp__", compare)
;

View File

@@ -20,13 +20,8 @@
#include "int_wrapper.hpp"
#include <boost/python/suite/indexing/container_suite.hpp>
#include <boost/python/suite/indexing/iterator_pair.hpp>
#include <boost/python/suite/indexing/container_proxy.hpp>
#include <vector>
#include <string>
#include <sstream>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
@@ -36,13 +31,6 @@
bool int_wrapper::our_trace_flag = true;
unsigned int_wrapper::our_object_counter = 0;
std::string repr (int_wrapper const &i)
{
std::stringstream temp;
temp << i;
return temp.str();
}
BOOST_PYTHON_MODULE(test_vector_ext)
{
boost::python::implicitly_convertible <int, int_wrapper>();
@@ -51,7 +39,7 @@ BOOST_PYTHON_MODULE(test_vector_ext)
boost::python::class_<int_wrapper>("int_wrapper", boost::python::init<int>())
.def ("increment", &int_wrapper::increment)
.def ("__repr__", repr)
.def ("__repr__", &int_wrapper::repr)
.def ("__cmp__", compare)
;

View File

@@ -17,12 +17,8 @@
#include "int_wrapper.hpp"
#include <boost/python/suite/indexing/container_suite.hpp>
#include <map>
#include <set>
#include <string>
#include <sstream>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
@@ -32,13 +28,6 @@
bool int_wrapper::our_trace_flag = true;
unsigned int_wrapper::our_object_counter = 0;
std::string repr (int_wrapper const &i)
{
std::stringstream temp;
temp << i;
return temp.str();
}
BOOST_PYTHON_MODULE(testnonlinear)
{
boost::python::implicitly_convertible <int, int_wrapper>();
@@ -47,7 +36,7 @@ BOOST_PYTHON_MODULE(testnonlinear)
boost::python::class_<int_wrapper> ("int_wrapper", boost::python::init<int>())
.def ("increment", &int_wrapper::increment)
.def ("__repr__", repr)
.def ("__repr__", &int_wrapper::repr)
.def ("__cmp__", compare)
;