9 #include "swCommonLib/Common/RTTR.h"
10 #include "swCommonLib/Common/Exceptions/Exception.h"
12 #include "swCommonLib/Serialization/FilePosition.h"
14 #include "swCommonLib/Serialization/PropertySerialization/Core/Exceptions/SerializationException.h"
18 #include <type_traits>
34 typedef std::map< rttr::type, std::vector< rttr::property > > TypePropertyMap;
35 typedef std::vector< ExceptionPtr > Exceptions;
44 Exceptions m_warnings;
51 const Exceptions& GetWarnings ();
52 void AddWarning ( ExceptionPtr warning );
54 template<
typename WarningType >
55 void AddWarning (
const std::string & message,
FilePosition filePos );
69 template< typename WarningType >
72 AddWarning( std::make_shared< WarningType >( message, filePos ) );
77 template<
typename WarningType >
78 inline void Warn (
const IDeserializer& deser,
const std::string& message )
80 static_assert( std::is_base_of< SerializationException, WarningType >::value,
"WariningType should be derived from SerializationException." );
82 auto ctx = deser.
GetContext< SerializationContext >();
87 ctx->AddWarning< WarningType >( message, filePos );
Serialization context for automatic serialization.
Definition: SerializationContext.h:30
Interface for deserializers.
Definition: Deserializer.h:39
Definition: Exception.h:11
Definition: FilePosition.h:11
ContextType * GetContext() const
Zwraca kontekst serializacji.
Definition: Deserializer.h:94
Interface for context used in serialization and deserialization.ISerializationContext is used to stor...
Definition: ISerializationContext.h:20
sw::FilePosition CurrentLineNumber() const
Definition: Deserializer.cpp:721
TypePropertyMap TypeProperties
Maps containing all serializable properties for type.
Definition: SerializationContext.h:40