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

Class Example

08-CallPolicies/policies.cpp:4–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <string>
3
4class Example {
5 Example(std::string n) : mName(n) {}
6 std::string mName;
7public:
8 std::string name() const { return mName; }
9 static Example* factory()
10 {
11 return new Example("factory");
12 }
13 static Example* singleton()
14 {
15 static Example instance = Example("singleton");
16 return &instance;
17 }
18};
19
20#include <boost/python.hpp>
21using namespace boost::python;

Callers 1

singletonMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected