-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyGraphManager.cpp
More file actions
41 lines (35 loc) · 925 Bytes
/
PyGraphManager.cpp
File metadata and controls
41 lines (35 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "stdafx.h"
#include "PyGraphManager.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
void CPyGraphManager::Init(IBroker* pBroker)
{
pBroker->GetInterface(IID_IGraphManager, (IUnknown**)&m_pGraphManager);
}
void CPyGraphManager::Reset()
{
m_pGraphManager.Release();
}
IndexType CPyGraphManager::GetGraphBuilderCount()
{
return m_pGraphManager->GetGraphBuilderCount();
}
boost::python::list CPyGraphManager::GetGraphNames()
{
USES_CONVERSION;
boost::python::list list;
std::vector<std::_tstring> vNames = m_pGraphManager->GetGraphNames();
for (const auto& name : vNames)
{
#if defined _UNICODE
boost::python::handle<> handle(PyUnicode_FromWideChar(name.c_str(),-1));
#else
boost::python::handle<> handle(PyUnicode_FromString(T2A(name.c_str())));
#endif
list.append(boost::python::object(handle));
}
return list;
}