Include :
- aggiunto EgtUUID e Writer - Scan diventato Scanner.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EGnEgtUUID.h Data : 01.06.15 Versione : 1.6f1
|
||||
// Contenuto : Dichiarazione struttura EgtUUID e sue funzioni.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 01.06.15 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
//----------------------- Macro per import/export ----------------------------
|
||||
#undef EGN_EXPORT
|
||||
#if defined( I_AM_EGN) // da definirsi solo nella DLL
|
||||
#define EGN_EXPORT __declspec( dllexport)
|
||||
#else
|
||||
#define EGN_EXPORT __declspec( dllimport)
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
struct EgtUUID {
|
||||
unsigned int Data1 ;
|
||||
unsigned short Data2 ;
|
||||
unsigned short Data3 ;
|
||||
unsigned char Data4[8] ;
|
||||
EgtUUID( void)
|
||||
{ Data1 = 0 ; Data2 = 0; Data3 = 0 ; memset( Data4, 0, 8) ; }
|
||||
bool operator ==( const EgtUUID& other) const
|
||||
{ return ( Data1 == other.Data1 && Data2 == other.Data2 && Data3 == other.Data3 &&
|
||||
memcmp( Data4, other.Data4, 8) == 0) ; }
|
||||
bool operator !=( const EgtUUID& other) const
|
||||
{ return ! operator ==( other) ; }
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
EGN_EXPORT std::string ToString( const EgtUUID& uuId) ;
|
||||
EGN_EXPORT bool FromString( const std::string& sVal, EgtUUID& uuId) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<EgtUUID>
|
||||
{
|
||||
typedef EgtUUID argument_type ;
|
||||
typedef std::size_t result_type ;
|
||||
std::size_t operator()( EgtUUID key) const {
|
||||
return ( key.Data1 + key.Data2 + key.Data3 + key.Data4[0] + key.Data4[7]) ;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user