I´m currently trying to wrap the LibRealsense into a Unreal 4 Plugin. This lib provides some C API as well as some C++ API (wrapping it´s C API), so I´m doing C++ (which makes sense for Unreal).
But there is a kind of operator overloading I´ve never seen before (in rs_pipeline.hpp):
class pipeline
{
public:
pipeline(context ctx = context())
...
operator std::shared_ptr<rs2_pipeline>() const
{
return _pipeline;
}
private:
context _ctx;
std::shared_ptr<rs2_pipeline> _pipeline;
}
rs2_pipeline
is the C-type of a pipeline, it is accessed in all the c++ classes as a shared pointer. E.g:
class config
{
public:
...
bool can_resolve(std::shared_ptr<rs2_pipeline> p) const
...
}
So when I´m trying to call config.can_resolve
with my C++ ´pipeline´
object, I need to get the internal shared_ptr<rs_pipline>
. But how do I call operator shared_ptr<rs_pipline()
?? And what kind of operator is it exactly?