Skip to content

Commit 0d92faa

Browse files
committed
api: Hide protected function in Freenect2
Freenect2 class is marked as API. A protected function in Freenect2 got exported as a symbol. Avoid that.
1 parent 1d516bc commit 0d92faa

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

include/libfreenect2/libfreenect2.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ class LIBFREENECT2_API Freenect2
140140

141141
Freenect2Device *openDefaultDevice();
142142
Freenect2Device *openDefaultDevice(const PacketPipeline *factory);
143-
protected:
144-
Freenect2Device *openDevice(int idx, const PacketPipeline *factory, bool attempting_reset);
145143
private:
146144
Freenect2Impl *impl_;
147145
};

src/libfreenect2.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ class Freenect2Impl
511511
}
512512
return enumerated_devices_.size();
513513
}
514+
515+
Freenect2Device *openDevice(int idx, const PacketPipeline *factory, bool attempting_reset);
514516
};
515517

516518

@@ -912,12 +914,12 @@ Freenect2Device *Freenect2::openDevice(int idx)
912914

913915
Freenect2Device *Freenect2::openDevice(int idx, const PacketPipeline *pipeline)
914916
{
915-
return openDevice(idx, pipeline, true);
917+
return impl_->openDevice(idx, pipeline, true);
916918
}
917919

918-
Freenect2Device *Freenect2::openDevice(int idx, const PacketPipeline *pipeline, bool attempting_reset)
920+
Freenect2Device *Freenect2Impl::openDevice(int idx, const PacketPipeline *pipeline, bool attempting_reset)
919921
{
920-
int num_devices = impl_->getNumDevices();
922+
int num_devices = getNumDevices();
921923
Freenect2DeviceImpl *device = 0;
922924

923925
if(idx >= num_devices)
@@ -928,10 +930,10 @@ Freenect2Device *Freenect2::openDevice(int idx, const PacketPipeline *pipeline,
928930
return device;
929931
}
930932

931-
Freenect2Impl::UsbDeviceWithSerial &dev = impl_->enumerated_devices_[idx];
933+
Freenect2Impl::UsbDeviceWithSerial &dev = enumerated_devices_[idx];
932934
libusb_device_handle *dev_handle;
933935

934-
if(impl_->tryGetDevice(dev.dev, &device))
936+
if(tryGetDevice(dev.dev, &device))
935937
{
936938
LOG_WARNING << "device " << PrintBusAndDevice(dev.dev)
937939
<< " is already be open!";
@@ -975,8 +977,8 @@ Freenect2Device *Freenect2::openDevice(int idx, const PacketPipeline *pipeline,
975977

976978
// reenumerate devices
977979
LOG_INFO << "re-enumerating devices after reset";
978-
impl_->clearDeviceEnumeration();
979-
impl_->enumerateDevices();
980+
clearDeviceEnumeration();
981+
enumerateDevices();
980982

981983
// re-open without reset
982984
return openDevice(idx, pipeline, false);
@@ -990,8 +992,8 @@ Freenect2Device *Freenect2::openDevice(int idx, const PacketPipeline *pipeline,
990992
}
991993
}
992994

993-
device = new Freenect2DeviceImpl(impl_, pipeline, dev.dev, dev_handle, dev.serial);
994-
impl_->addDevice(device);
995+
device = new Freenect2DeviceImpl(this, pipeline, dev.dev, dev_handle, dev.serial);
996+
addDevice(device);
995997

996998
if(!device->open())
997999
{

0 commit comments

Comments
 (0)