ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CCShareable.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include <pybind11/pybind11.h>
9 
10 #include <CVShareable.h>
11 
12 #include "wrappers.h"
13 
14 namespace py = pybind11;
15 using namespace pybind11::literals;
16 
17 void define_CCShareable(py::module &cccorelib)
18 {
19  py::class_<CCShareable, CCShareableHolder<CCShareable>>(cccorelib, "CCShareable")
20  .def(py::init<>())
21  .def("link", &CCShareable::link)
22  .def("release", &CCShareable::release)
23  .def("getLinkCount", &CCShareable::getLinkCount)
24 #ifdef CC_TRACK_ALIVE_SHARED_OBJECTS
25  .def_static("GetAliveCount", &CCShareable::GetAliveCount);
26 #else
27  ;
28 #endif
29 }
void define_CCShareable(py::module &cccorelib)
Definition: CCShareable.cpp:17
virtual void link()
Increase counter.
Definition: CVShareable.cpp:33
virtual void release()
Decrease counter and deletes object when 0.
Definition: CVShareable.cpp:35
virtual unsigned getLinkCount() const
Returns the current link count.
Definition: CVShareable.h:40