1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2017 Christian Schoenebeck * |
* Copyright (C) 2017-2019 Christian Schoenebeck * |
4 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
5 |
* * |
* * |
6 |
* This library is part of libgig. * |
* This library is part of libgig. * |
7 |
* * |
* * |
323 |
*/ |
*/ |
324 |
typedef std::vector<UID> UIDChain; |
typedef std::vector<UID> UIDChain; |
325 |
|
|
326 |
|
#if LIBGIG_SERIALIZATION_INTERNAL |
327 |
// prototyping of private internal friend functions |
// prototyping of private internal friend functions |
328 |
static String _encodePrimitiveValue(const Object& obj); |
static String _encodePrimitiveValue(const Object& obj); |
329 |
static DataType _popDataTypeBlob(const char*& p, const char* end); |
static DataType _popDataTypeBlob(const char*& p, const char* end); |
334 |
// | |
// | |
335 |
template<typename T> |
template<typename T> |
336 |
static T _primitiveObjectValueToNumber(const Object& obj); |
static T _primitiveObjectValueToNumber(const Object& obj); |
337 |
|
#endif // LIBGIG_SERIALIZATION_INTERNAL |
338 |
|
|
339 |
/** @brief Abstract reflection of a native C++ data type. |
/** @brief Abstract reflection of a native C++ data type. |
340 |
* |
* |
441 |
template<typename T> |
template<typename T> |
442 |
static String rawCppTypeNameOf(const T& data) { |
static String rawCppTypeNameOf(const T& data) { |
443 |
#if defined _MSC_VER // Microsoft compiler ... |
#if defined _MSC_VER // Microsoft compiler ... |
444 |
# warning type_info::raw_name() demangling has not been tested yet with Microsoft compiler! Feedback appreciated! |
String name = typeid(data).raw_name(); |
|
String name = typeid(data).raw_name(); //NOTE: I haven't checked yet what MSC actually outputs here exactly |
|
445 |
#else // i.e. especially GCC and clang ... |
#else // i.e. especially GCC and clang ... |
446 |
String name = typeid(data).name(); |
String name = typeid(data).name(); |
447 |
#endif |
#endif |
456 |
int m_size; |
int m_size; |
457 |
bool m_isPointer; |
bool m_isPointer; |
458 |
|
|
459 |
|
#if LIBGIG_SERIALIZATION_INTERNAL |
460 |
friend DataType _popDataTypeBlob(const char*& p, const char* end); |
friend DataType _popDataTypeBlob(const char*& p, const char* end); |
461 |
|
#endif |
462 |
friend class Archive; |
friend class Archive; |
463 |
}; |
}; |
464 |
|
|
508 |
String m_name; |
String m_name; |
509 |
DataType m_type; |
DataType m_type; |
510 |
|
|
511 |
|
#if LIBGIG_SERIALIZATION_INTERNAL |
512 |
friend Member _popMemberBlob(const char*& p, const char* end); |
friend Member _popMemberBlob(const char*& p, const char* end); |
513 |
|
#endif |
514 |
}; |
}; |
515 |
|
|
516 |
/** @brief Abstract reflection of some native serialized C/C++ data. |
/** @brief Abstract reflection of some native serialized C/C++ data. |
576 |
RawData m_data; |
RawData m_data; |
577 |
std::vector<Member> m_members; |
std::vector<Member> m_members; |
578 |
|
|
579 |
|
#if LIBGIG_SERIALIZATION_INTERNAL |
580 |
friend String _encodePrimitiveValue(const Object& obj); |
friend String _encodePrimitiveValue(const Object& obj); |
581 |
friend Object _popObjectBlob(const char*& p, const char* end); |
friend Object _popObjectBlob(const char*& p, const char* end); |
582 |
friend void _popPrimitiveValue(const char*& p, const char* end, Object& obj); |
friend void _popPrimitiveValue(const char*& p, const char* end, Object& obj); |
583 |
friend String _primitiveObjectValueToString(const Object& obj); |
friend String _primitiveObjectValueToString(const Object& obj); |
584 |
|
// | |
585 |
template<typename T> |
template<typename T> |
586 |
friend T _primitiveObjectValueToNumber(const Object& obj); |
friend T _primitiveObjectValueToNumber(const Object& obj); |
587 |
|
#endif // LIBGIG_SERIALIZATION_INTERNAL |
588 |
|
|
589 |
friend class Archive; |
friend class Archive; |
590 |
}; |
}; |