MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / Freenect2ReplayImpl

Class Freenect2ReplayImpl

src/libfreenect2.cpp:588–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586};
587
588class Freenect2ReplayImpl
589{
590private:
591 typedef std::vector<Freenect2ReplayDevice*> DeviceVector;
592 DeviceVector devices_;
593
594public:
595 ~Freenect2ReplayImpl()
596 {
597 clearDevices();
598 }
599
600 void addDevice(Freenect2ReplayDevice *device)
601 {
602 devices_.push_back(device);
603 }
604
605 void removeDevice(Freenect2ReplayDevice *device)
606 {
607 DeviceVector::iterator it = std::find(devices_.begin(), devices_.end(), device);
608
609 if(it != devices_.end())
610 {
611 devices_.erase(it);
612 }
613 else
614 {
615 LOG_WARNING << "tried to remove a REPLAY device, which is not in the internal device list!";
616 }
617 }
618
619 void clearDevices()
620 {
621 DeviceVector devices(devices_.begin(), devices_.end());
622
623 for(DeviceVector::iterator it = devices.begin(); it != devices.end(); ++it)
624 {
625 delete (*it);
626 }
627
628 // Should never happen
629 if(!devices_.empty())
630 {
631 LOG_WARNING << "after deleting all REPLAY devices the internal device list should be empty!";
632 }
633 }
634
635 Freenect2Device *openDevice(const std::vector<std::string>& frame_filenames, const PacketPipeline *pipeline);
636};
637
638Freenect2Device::~Freenect2Device()
639{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected