This website is being translated through machine translation by a third-party service. Basler does not warrant the accuracy, reliability or timeliness of any information translated by this system and will not accept liability for loss or damage incurred as a result. Content that has not yet been translated appears in English. Switch to English version
Helper class to automagically call PylonInitialize and PylonTerminate in constructor and destructor.
#include<pylon/TlFactory.h>// ...usingnamespacePylon;intmain(intargc,char*argv[]){PylonAutoInitTermautoInitTerm;// Get the transport layer factoryCTlFactory&TlFactory=CTlFactory::GetInstance();// Get all attached cameras and exit application if no camera is foundDeviceInfoList_tdevices;if(0==TlFactory.EnumerateDevices(devices)){cerr<<"No camera present!"<<endl;return1;}else{// do something with devices ...//...}return0;}// When leaving the main function, the destructor of the PylonAutoInitTerm object will be called// and it will in turn call PylonTerminate.