MCPcopy Create free account
hub / github.com/TNG/boost-python-examples / World

Class World

02-ExposingClasses/classes.cpp:9–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include <vector>
8
9struct World
10{
11 void set(std::string msg) { mMsg = msg; }
12 void many(boost::python::list msgs) {
13 long l = len(msgs);
14 std::stringstream ss;
15 for (long i = 0; i<l; ++i) {
16 if (i>0) ss << ", ";
17 std::string s = boost::python::extract<std::string>(msgs[i]);
18 ss << s;
19 }
20 mMsg = ss.str();
21 }
22 std::string greet() { return mMsg; }
23 std::string mMsg;
24};
25
26using namespace boost::python;
27

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected