170 if ( NULL == pInterfaces )
182 pInterfaces[i] = iter->second;
202 if ( NULL == pStrID )
215 rInterface = iter->second;
220 std::vector<VmbInterfaceInfo_t> interfaceInfos;
225 for ( std::vector<VmbInterfaceInfo_t>::iterator iterInfo = interfaceInfos.begin();
226 interfaceInfos.end() != iterInfo;
229 if ( 0 == strcmp( iterInfo->interfaceIdString, pStrID ))
239 rInterface = iter->second;
257 if ( NULL == pStrID )
282 if ( NULL == pCameras )
294 pCameras[i] = iter->second;
314 if ( NULL == pStrID )
328 rCamera = iter->second;
353 rCamera = iter->second;
359 std::string cameraIdString;
371 rCamera = iter->second;
390 if ( NULL == pStrID )
398 return SP_ACCESS( rCamera )->Open( eAccessMode );
415 if (
SP_ACCESS( iter->second )->GetHandle() == handle )
436 std::vector<char> strID;
444 strID.resize( nCount );
449 const char* pReason = NULL;
491 if (
false == bFound )
497 LOG_FREE_TEXT(
"Could not find a known camera in camera list")
511 SP_ACCESS(( *iter ))->CameraListChanged( pCam, reason );
530 LOG_FREE_TEXT(
"Could not get integer representation of enum string" )
545 LOG_FREE_TEXT(
"Could not get length of camera ID or length is 0" )
552 std::vector<char> strID;
560 strID.resize( nCount );
577 pInterface = iter->second;
603 if (
true == bFound )
620 pInterface = iter->second;
627 LOG_FREE_TEXT(
"Could not find interface in interface list." )
643 SP_ACCESS(( *iter ))->InterfaceListChanged( pInterface, reason );
826 LOG_FREE_TEXT(
"Could not register interface list observer" )
946 std::vector<VmbInterfaceInfo_t> interfaceInfos;
952 InterfacePtrMap::iterator iter = m_interfaces.Map.begin();
953 std::vector<VmbInterfaceInfo_t>::iterator iterInfo = interfaceInfos.begin();
957 while ( m_interfaces.Map.end() != iter )
961 if ( iterInfo->interfaceIdString == iter->first )
968 if (
false == bFound )
970 m_interfaces.Map.erase( iter++ );
978 iterInfo = interfaceInfos.begin();
982 while ( 0 < nCount-- )
984 iter = m_interfaces.Map.find( iterInfo->interfaceIdString );
986 if ( m_interfaces.Map.end() == iter )
988 SP_SET( m_interfaces.Map[iterInfo->interfaceIdString],
new Interface( &(*iterInfo) ));
1005 std::vector<VmbCameraInfo_t> cameraInfos( 10 );
1008 if (
true == m_bGeVTLPresent
1009 &&
false == m_bGeVDiscoveryAutoOn )
1023 cameraInfos.resize( nCount );
1032 if( nCount < cameraInfos.size() )
1034 cameraInfos.resize( nCount );
1036 CameraPtrMap::iterator mapPos = m_cameras.Map.begin();
1037 typedef std::vector<VmbCameraInfo_t>::const_iterator const_info_iterator;
1040 while ( m_cameras.Map.end() != mapPos )
1042 bool bFound =
false;
1043 for( const_info_iterator infoPos = cameraInfos.begin(); cameraInfos.end() != infoPos; ++infoPos )
1045 if ( infoPos->cameraIdString == mapPos->first )
1052 if (
false == bFound )
1054 m_cameras.Map.erase( mapPos++ );
1063 for (const_info_iterator infoPos= cameraInfos.begin(); infoPos != cameraInfos.end(); ++infoPos )
1065 CameraPtrMap::const_iterator findPos = m_cameras.Map.find( infoPos->cameraIdString );
1067 if ( m_cameras.Map.end() == findPos )
1069 AppendCamToMap( *infoPos );
1075 m_cameras.Map.clear();
1079 catch(
const std::bad_alloc& )
1095 if( NULL == pStrID )
1103 while( pStrID[nIndex] !=
'\0' )
1105 if( isdigit( pStrID[nIndex] ) != 0 )
1113 else if(
'.' == pStrID[nIndex] )
1144 std::string strInterfaceName,
1150 if ( m_cameras.Map.end() == m_cameras.Map.find( camInfo.
cameraIdString ))
1168 strInterfaceName.c_str(),
1169 strInterfaceSerial.c_str(),
1185 CameraPtrMap::iterator iter = m_cameras.Map.find( camInfo.
cameraIdString );
1186 if ( m_cameras.Map.end() != iter
1189 m_cameras.Map.erase( iter );
1216 rInterfaceInfos.resize( nCount );
IMEXPORTC VmbError_t VMB_CALL VmbFeatureCommandRun(const VmbHandle_t handle, const char *name)
IMEXPORT VmbErrorType GetCameraByID(const char *pID, CameraPtr &pCamera)
static IMEXPORT VimbaSystem & GetInstance()
std::map< std::string, CameraPtr > CameraPtrMap
bool EnterWriteLock(BasicLockable &rLockable, bool bExclusive=false)
const char * cameraIdString
VmbErrorType GetInterfaceList(std::vector< VmbInterfaceInfo_t > &interfaceInfos)
IMEXPORTC VmbError_t VMB_CALL VmbFeatureStringMaxlengthQuery(const VmbHandle_t handle, const char *name, VmbUint32_t *pMaxLength)
#define VIMBACPP_VERSION_PATCH
IMEXPORTC VmbError_t VMB_CALL VmbFeatureStringGet(const VmbHandle_t handle, const char *name, char *buffer, VmbUint32_t bufferSize, VmbUint32_t *pSizeFilled)
IMEXPORT VmbErrorType Startup()
IMEXPORT VmbErrorType RegisterCameraListObserver(const ICameraListObserverPtr &pObserver)
VmbErrorType GetInterfaces(InterfacePtrVector &interfaces)
char const *const AVT_IP_OR_MAC_ADDRESS
static void VMB_CALL InterfaceDiscoveryCallback(const VmbHandle_t handle, const char *name, void *context)
LockableMap< std::string, InterfacePtr > m_interfaces
std::map< std::string, InterfacePtr > InterfacePtrMap
CameraPtr GetCameraPtrByHandle(const VmbHandle_t handle) const
void ExitWriteLock(BasicLockable &rLockable)
VmbErrorType UpdateInterfaceList()
IMEXPORT VmbErrorType OpenCameraByID(const char *pID, VmbAccessModeType eAccessMode, CameraPtr &pCamera)
static const VmbHandle_t gVimbaHandle
IMEXPORTC VmbError_t VMB_CALL VmbFeatureInvalidationRegister(const VmbHandle_t handle, const char *name, VmbInvalidationCallback callback, void *pUserContext)
static VimbaSystem _instance
#define LOG_FREE_TEXT(txt)
ConditionHelper m_cameraObserversConditionHelper
VmbErrorType GetCameras(CameraPtrVector &cameras)
IMEXPORTC VmbError_t VMB_CALL VmbFeatureInvalidationUnregister(const VmbHandle_t handle, const char *name, VmbInvalidationCallback callback)
IMEXPORTC VmbError_t VMB_CALL VmbCameraInfoQuery(const char *idString, VmbCameraInfo_t *pInfo, VmbUint32_t sizeofCameraInfo)
VimbaSystem & operator=(const VimbaSystem &system)
IMEXPORT VmbErrorType RegisterInterfaceListObserver(const IInterfaceListObserverPtr &pObserver)
IMEXPORT VmbErrorType RegisterCameraFactory(const ICameraFactoryPtr &pCameraFactory)
const char * interfaceIdString
ConditionHelper m_interfaceObserversConditionHelper
LockableMap< std::string, CameraPtr > m_cameras
NetPointer< Camera, AVT::VmbAPINET::Camera > CameraPtr
void AppendCamToMap(VmbCameraInfo_t camInfo)
IMEXPORTC VmbError_t VMB_CALL VmbInterfacesList(VmbInterfaceInfo_t *pInterfaceInfo, VmbUint32_t listLength, VmbUint32_t *pNumFound, VmbUint32_t sizeofInterfaceInfo)
const char * serialString
IMEXPORTC VmbError_t VMB_CALL VmbStartup(void)
IMEXPORT VmbErrorType UnregisterInterfaceListObserver(const IInterfaceListObserverPtr &pObserver)
IMEXPORTC VmbError_t VMB_CALL VmbFeatureEnumAsInt(const VmbHandle_t handle, const char *name, const char *value, VmbInt64_t *pIntVal)
IMEXPORT VmbErrorType QueryVersion(VmbVersionInfo_t &version)
NetPointer< Interface, AVT::VmbAPINET::Interface > InterfacePtr
#define SP_SET(sp, rawPtr)
#define SP_ISEQUAL(sp1, sp2)
bool m_bGeVDiscoveryAutoOn
void ExitReadLock(BasicLockable &rLockable)
ConditionHelper m_camerasConditionHelper
bool EnterReadLock(BasicLockable &rLockable)
IMEXPORTC VmbError_t VMB_CALL VmbFeatureEnumGet(const VmbHandle_t handle, const char *name, const char **pValue)
IMEXPORTC VmbError_t VMB_CALL VmbFeatureBoolGet(const VmbHandle_t handle, const char *name, VmbBool_t *pValue)
LockableVector< ICameraListObserverPtr > m_cameraObservers
IMEXPORTC VmbError_t VMB_CALL VmbCamerasList(VmbCameraInfo_t *pCameraInfo, VmbUint32_t listLength, VmbUint32_t *pNumFound, VmbUint32_t sizeofCameraInfo)
IMEXPORT VmbErrorType UnregisterCameraFactory()
IMEXPORTC void VMB_CALL VmbShutdown(void)
ConditionHelper m_interfacesConditionHelper
#define VIMBACPP_VERSION_MAJOR
IMEXPORT VmbErrorType Shutdown()
VmbErrorType UpdateCameraList()
IMEXPORT VmbErrorType UnregisterCameraListObserver(const ICameraListObserverPtr &pObserver)
static void VMB_CALL CameraDiscoveryCallback(const VmbHandle_t handle, const char *name, void *context)
#define VIMBACPP_VERSION_MINOR
bool IsIPAddress(const char *pStrID)
ICameraFactoryPtr m_pCameraFactory
LockableVector< IInterfaceListObserverPtr > m_interfaceObservers
IMEXPORT VmbErrorType GetInterfaceByID(const char *pID, InterfacePtr &pInterface)
IMEXPORT VmbErrorType OpenInterfaceByID(const char *pID, InterfacePtr &pInterface)