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

Method many

02-ExposingClasses/classes.cpp:12–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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};

Callers 1

classes.pyFile · 0.80

Calls 1

strMethod · 0.80

Tested by

no test coverage detected