// GetProperty Map
typedef struct deviceData
{
uint nCounter; // property counter
void* pData; // device data pointer
} DevData;
typedef std::map<unsigned long, DevData*> GetPropertyMap;
typedef GetPropertyMap::iterator GetPropertyMapIter;
typedef GetPropertyMap::value_type GetPropertyEntry;
GetPropertyMap m_PropMap;
// Signal declaration
void allDMXPropsReceived( unsigned long member, void* pData );
// Create structure
DevData* pDevData = new DevData();
pDevData->nCounter = nPropTotal;
pDevData->pData = static_cast<void*>( pNode );
m_PropMap.insert( GetPropertyEntry( handle, pDevData ) );
.
.
.
// Retreive the data pointer from the struct in the map
GetPropertyMapIter mit = m_PropMap.find( member );
if ( mit != m_PropMap.end() )
{
if ( mit->second != NULL )
{
...
if ( mit->second->pData != NULL )
emit allDMXPropsReceived( member, mit->second->pData );
...
}
}
//Slot declaration
void SLOT_AllDMXPropsReceived( unsigned long u4member, void* pData );
// Slot connection
connect( m_pController, SIGNAL( allDMXPropsReceived( unsigned long, void* ) ),
this, SLOT( SLOT_AllDMXPropsReceived( unsigned long, void* ) ), Qt::QueuedConnection );
void DMXTable::SLOT_AllDMXPropsReceived( unsigned long u4member, void* pData )
{
CDMXGateway* pNode = static_cast<CDMXGateway*>( pData );
// Access data & crash
SetDeviceName( pNode->GetDeviceName() );
SetIPAddr( pNode->GetIPAddr() );
...
// GetProperty Map
typedef struct deviceData
{
uint nCounter; // property counter
void* pData; // device data pointer
} DevData;
typedef std::map<unsigned long, DevData*> GetPropertyMap;
typedef GetPropertyMap::iterator GetPropertyMapIter;
typedef GetPropertyMap::value_type GetPropertyEntry;
GetPropertyMap m_PropMap;
// Signal declaration
void allDMXPropsReceived( unsigned long member, void* pData );
// Create structure
DevData* pDevData = new DevData();
pDevData->nCounter = nPropTotal;
pDevData->pData = static_cast<void*>( pNode );
m_PropMap.insert( GetPropertyEntry( handle, pDevData ) );
.
.
.
// Retreive the data pointer from the struct in the map
GetPropertyMapIter mit = m_PropMap.find( member );
if ( mit != m_PropMap.end() )
{
if ( mit->second != NULL )
{
...
if ( mit->second->pData != NULL )
emit allDMXPropsReceived( member, mit->second->pData );
...
}
}
//Slot declaration
void SLOT_AllDMXPropsReceived( unsigned long u4member, void* pData );
// Slot connection
connect( m_pController, SIGNAL( allDMXPropsReceived( unsigned long, void* ) ),
this, SLOT( SLOT_AllDMXPropsReceived( unsigned long, void* ) ), Qt::QueuedConnection );
void DMXTable::SLOT_AllDMXPropsReceived( unsigned long u4member, void* pData )
{
CDMXGateway* pNode = static_cast<CDMXGateway*>( pData );
// Access data & crash
SetDeviceName( pNode->GetDeviceName() );
SetIPAddr( pNode->GetIPAddr() );
...
To copy to clipboard, switch view to plain text mode
Bookmarks