Commit 93fac410 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Change parsing of enums - WIP

parent 97829c77
......@@ -4,6 +4,9 @@
// std includes
#include <cmath>
// simulation scheduler include
#include "../src/ITA/simulation_scheduler/utils.h"
// Vista include
#include <VistaAspects/VistaSerializer.h>
#include <VistaAspects/VistaDeSerializer.h>
......@@ -68,7 +71,7 @@ namespace ITA
returnVal += pSerializer.WriteInt32 ( m_iID );
returnVal += pSerializer.WriteInt32 ( static_cast< std::underlying_type<Type>::type >( m_eType ) );
returnVal += pSerializer.WriteInt32 ( as_integer( m_eType ) );
return returnVal;
}
......
......@@ -3,13 +3,14 @@ set( RelativeSourceGroup "Source Files\\ITA\\SimulationScheduler" )
set( SubDirs
#audibility_filter
#network_interface
#room_acoustics
room_acoustics
)
set( DirFiles
3d_object.cpp
update_config.cpp
update_scene.cpp
utils.h
#_SourceFiles.cmake
)
......
// Header include
#include <ITA/simulation_scheduler/update_config.h>
// simulation scheduler include
#include "../src/ITA/simulation_scheduler/utils.h"
// Vista include
#include <VistaAspects/VistaSerializer.h>
#include <VistaAspects/VistaDeSerializer.h>
......@@ -28,7 +31,7 @@ namespace ITA
int CUpdateConfig::Serialize ( IVistaSerializer& pSerializer ) const
{
int returnVal = 0;
returnVal += pSerializer.WriteInt32 ( static_cast< std::underlying_type<ConfigChangeType>::type >( m_eConfigChangeType ) );
returnVal += pSerializer.WriteInt32 ( as_integer( m_eConfigChangeType ) );
returnVal += pSerializer.WriteEncodedString ( m_sPayload );
return returnVal;
}
......
#ifndef INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_UTILS
#define INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_UTILS
#include <type_traits>
template <typename Enumeration>
auto as_integer ( Enumeration const value )
-> typename std::underlying_type<Enumeration>::type
{
return static_cast< typename std::underlying_type<Enumeration>::type >( value );
}
#endif // INCLUDE_WATCHER_ITA_SIMULATION_SCHEDULER_UTILS
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment