Skip to content

Commit dcad22a

Browse files
committed
[feat] make prepare for python version.
1 parent d804ad1 commit dcad22a

File tree

8 files changed

+70
-69
lines changed

8 files changed

+70
-69
lines changed

python/PyObject/PyoGPipeline.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/***************************
2+
@Author: Chunel
3+
@Contact: chunel@foxmail.com
4+
@File: PyoGPipeline.h
5+
@Time: 2023/4/2 22:41
6+
@Desc:
7+
***************************/
8+
9+
#ifndef CGRAPH_PYOGPIPELINE_H
10+
#define CGRAPH_PYOGPIPELINE_H
11+
12+
#include "../../src/GraphCtrl/GraphPipeline/GPipeline.h"
13+
14+
CGRAPH_NAMESPACE_BEGIN
15+
16+
class PyoGPipeline : public GPipeline {
17+
public:
18+
/**
19+
* 注册一个节点信息
20+
* @param element
21+
* @param dependElements
22+
* @param name
23+
* @param loop
24+
* @return
25+
*/
26+
CStatus registerGElement(GElementPtr element,
27+
const GElementPtrSet &dependElements = std::initializer_list<GElementPtr>(),
28+
const std::string &name = CGRAPH_EMPTY,
29+
CSize loop = CGRAPH_DEFAULT_LOOP_TIMES) {
30+
CGRAPH_FUNCTION_BEGIN
31+
CGRAPH_ASSERT_INIT(false)
32+
33+
status = element->setElementInfo(dependElements, name, loop,
34+
this->param_manager_,
35+
this->event_manager_);
36+
CGRAPH_FUNCTION_CHECK_STATUS
37+
38+
status = element_manager_->add(element);
39+
CGRAPH_FUNCTION_CHECK_STATUS
40+
element_repository_.insert(element);
41+
42+
CGRAPH_FUNCTION_END
43+
}
44+
};
45+
46+
CGRAPH_NAMESPACE_END
47+
48+
#endif //CGRAPH_PYOGPIPELINE_H

python/PyObject/PyoInclude.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/***************************
2+
@Author: Chunel
3+
@Contact: chunel@foxmail.com
4+
@File: PyCGraphInclude.h
5+
@Time: 2023/4/3 22:30
6+
@Desc:
7+
***************************/
8+
9+
#ifndef CGRAPH_PYOINCLUDE_H
10+
#define CGRAPH_PYOINCLUDE_H
11+
12+
#include "../../src/CGraph.h"
13+
#include "PyoGPipeline.h"
14+
15+
#endif //CGRAPH_PYOINCLUDE_H

python/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# python3 setup.py bdist_wheel
2+
import os
3+
4+
root_dir = os.path.abspath(os.path.join(os.getcwd()))

src/GraphCtrl/GraphElement/GElement.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ class GElement : public GElementObject,
262262
friend class GElementManager;
263263
friend class GGroup;
264264
friend class GPipeline;
265-
friend class GPipelinePy;
266265
friend class GElementSorter;
267266
friend class GStaticEngine;
268267
friend class GDynamicEngine;
269268
template<typename T> friend class GSingleton;
269+
friend class PyoGPipeline;
270270
};
271271

272272
using GElementPtr = GElement *;

src/GraphCtrl/GraphElement/GElementManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ class GElementManager : public GElementObject, public GraphManager<GElement> {
9191
UThreadPoolPtr thread_pool_ = nullptr; // 线程池
9292

9393
friend class GPipeline;
94-
friend class GPipelinePy;
9594
friend class GRegion;
9695
friend class UAllocator;
96+
friend class PyoGPipeline;
9797
};
9898

9999
using GElementManagerPtr = GElementManager *;

src/GraphCtrl/GraphPipeline/GPipeline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class GPipeline : public GPipelineObject,
242242

243243
friend class GPipelineFactory;
244244
friend class UAllocator;
245-
friend class GPipelinePy;
245+
friend class PyoGPipeline;
246246
};
247247

248248
using GPipelinePtr = GPipeline *;

src/GraphCtrl/GraphPipeline/GPipelinePy.cpp

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/GraphCtrl/GraphPipeline/GPipelinePy.h

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)