This repository has been archived by the owner on Jul 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
genjix
committed
Apr 22, 2012
1 parent
f3bcc7b
commit ce2fafb
Showing
8 changed files
with
330 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <boost/python.hpp> | ||
namespace python = boost::python; | ||
|
||
#include "memory_buffer.hpp" | ||
|
||
struct memory_buffer_wrapper | ||
{ | ||
memory_buffer_wrapper(async_service_ptr service, blockchain_ptr chain, | ||
transaction_pool_ptr txpool) | ||
{ | ||
membuf = std::make_shared<memory_buffer>(service, chain, txpool); | ||
} | ||
|
||
void set_handles(python::object handle_tx_stored, | ||
python::object handle_tx_confirmed) | ||
{ | ||
membuf->set_handles(handle_tx_stored, handle_tx_confirmed); | ||
} | ||
|
||
void receive(const message::transaction& tx, | ||
python::object handle_receive) | ||
{ | ||
membuf->receive(tx, handle_receive); | ||
} | ||
|
||
memory_buffer_ptr membuf; | ||
}; | ||
|
||
BOOST_PYTHON_MODULE(membuf) | ||
{ | ||
using namespace boost::python; | ||
class_<memory_buffer_wrapper>("memory_buffer", init< | ||
async_service_ptr, blockchain_ptr, transaction_pool_ptr>()) | ||
.def("receive", &memory_buffer_wrapper::receive) | ||
.def("set_handles", &memory_buffer_wrapper::set_handles) | ||
.def_readonly("internal_ptr", &memory_buffer_wrapper::membuf) | ||
; | ||
class_<memory_buffer_ptr>("internal_memory_buffer", no_init); | ||
} | ||
|
Oops, something went wrong.