add doxygen via opencode
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
//! \file colors_p.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Color collection
|
||||
//! \~russian Коллекция цветов
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Color collection
|
||||
@@ -23,13 +28,27 @@
|
||||
#include "pivarianttypes.h"
|
||||
|
||||
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Color collection singleton for CSS color names.
|
||||
//! \~russian Синглтон коллекции цветов для CSS имен цветов.
|
||||
class PIColorCollection {
|
||||
public:
|
||||
//! \~english Returns singleton instance of color collection.
|
||||
//! \~russian Возвращает синглтон экземпляр коллекции цветов.
|
||||
static PIColorCollection & instance();
|
||||
|
||||
//! \~english Returns color by CSS name.
|
||||
//! \~russian Возвращает цвет по CSS имени.
|
||||
PIVariantTypes::Color getCSSColor(const PIString & name) const { return css_color.value(name); }
|
||||
|
||||
//! \~english Returns CSS name by color.
|
||||
//! \~russian Возвращает CSS имя по цвету.
|
||||
PIString getCSSName(const PIVariantTypes::Color color) const { return css_name.value(color); }
|
||||
|
||||
private:
|
||||
//! \~english Private constructor.
|
||||
//! \~russian Приватный конструктор.
|
||||
PIColorCollection();
|
||||
PIMap<PIString, PIVariantTypes::Color> css_color;
|
||||
PIMap<PIVariantTypes::Color, PIString> css_name;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*! \file pibitarray.h
|
||||
* \~\brief
|
||||
* \~english Bit array
|
||||
* \~russian Битовый массив
|
||||
*/
|
||||
//! \file pibitarray.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Bit array
|
||||
//! \~russian Битовый массив
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Bit array
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pibytearray.h
|
||||
* \ingroup Types
|
||||
* \~\brief
|
||||
* \~english Byte array
|
||||
* \~russian Байтовый массив
|
||||
*/
|
||||
//! \file pibytearray.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Byte array
|
||||
//! \~russian Байтовый массив
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Byte array
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pidatetime.h
|
||||
* \ingroup Types
|
||||
* \~\brief
|
||||
* \~english Time and date structs
|
||||
* \~russian Типы времени и даты
|
||||
*/
|
||||
//! \file pidatetime.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Time and date structs
|
||||
//! \~russian Типы времени и даты
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Time and date structs
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file piflags.h
|
||||
* \ingroup Types
|
||||
* \~\brief
|
||||
* \~english General flags class
|
||||
* \~russian Универсальные флаги
|
||||
*/
|
||||
//! \file piflags.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english General flags class
|
||||
//! \~russian Универсальные флаги
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
General flags class
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
/*! \file pinetworkaddress.h
|
||||
* \ingroup Types
|
||||
* \~\brief
|
||||
* \~english Network address
|
||||
* \~russian Сетевой адрес
|
||||
*/
|
||||
//! \file pinetworkaddress.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Network address
|
||||
//! \~russian Сетевой адрес
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Network address
|
||||
Network address
|
||||
Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pipropertystorage.h
|
||||
* \ingroup Types
|
||||
* \~\brief
|
||||
* \~english Properties array
|
||||
* \~russian Массив свойств
|
||||
*/
|
||||
//! \file pipropertystorage.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Properties array
|
||||
//! \~russian Массив свойств
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Storage of properties for GUI usage
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pisystemtime.h
|
||||
* \ingroup Types
|
||||
* \~\brief
|
||||
* \~english System time structs and methods
|
||||
* \~russian Типы и методы системного времени
|
||||
*/
|
||||
//! \file pisystemtime.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english System time structs and methods
|
||||
//! \~russian Типы и методы системного времени
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Time structs
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pitime.h
|
||||
* \ingroup Types
|
||||
* \~\brief
|
||||
* \~english System time, time and date
|
||||
* \~russian Системное время, время и дата
|
||||
*/
|
||||
//! \file pitime.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english System time, time and date
|
||||
//! \~russian Системное время, время и дата
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pivaluetree.h
|
||||
* \ingroup Types
|
||||
* \brief
|
||||
* \~english Attributed values tree
|
||||
* \~russian Дерево атрибутированных значений
|
||||
*/
|
||||
//! \file pivaluetree.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Attributed values tree
|
||||
//! \~russian Дерево атрибутированных значений
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Attributed values tree
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pivariant.h
|
||||
* \ingroup Types
|
||||
* \brief
|
||||
* \~english Variant type
|
||||
* \~russian Вариативный тип
|
||||
*/
|
||||
//! \file pivariant.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Variant type
|
||||
//! \~russian Вариативный тип
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Variant type
|
||||
@@ -102,21 +101,21 @@ struct __PIVariantTypeInfo__ {
|
||||
typedef const T & ConstReferenceType;
|
||||
};
|
||||
|
||||
# define __TYPEINFO_SINGLE(PT, T) \
|
||||
template<> \
|
||||
struct __PIVariantTypeInfo__<T> { \
|
||||
typedef PT PureType; \
|
||||
typedef const PT ConstPureType; \
|
||||
typedef PT * PointerType; \
|
||||
typedef const PT * ConstPointerType; \
|
||||
typedef PT & ReferenceType; \
|
||||
typedef const PT & ConstReferenceType; \
|
||||
};
|
||||
# define __TYPEINFO_SINGLE(PT, T) \
|
||||
template<> \
|
||||
struct __PIVariantTypeInfo__<T> { \
|
||||
typedef PT PureType; \
|
||||
typedef const PT ConstPureType; \
|
||||
typedef PT * PointerType; \
|
||||
typedef const PT * ConstPointerType; \
|
||||
typedef PT & ReferenceType; \
|
||||
typedef const PT & ConstReferenceType; \
|
||||
};
|
||||
|
||||
# define REGISTER_VARIANT_TYPEINFO(T) \
|
||||
__TYPEINFO_SINGLE(T, T &) \
|
||||
__TYPEINFO_SINGLE(T, const T) \
|
||||
__TYPEINFO_SINGLE(T, const T &)
|
||||
__TYPEINFO_SINGLE(T, T &) \
|
||||
__TYPEINFO_SINGLE(T, const T) \
|
||||
__TYPEINFO_SINGLE(T, const T &)
|
||||
|
||||
|
||||
class PIP_EXPORT __PIVariantInfoStorage__ {
|
||||
@@ -125,72 +124,67 @@ public:
|
||||
};
|
||||
|
||||
|
||||
# define REGISTER_VARIANT(classname) \
|
||||
template<> \
|
||||
inline PIString __PIVariantFunctions__<classname>::typeNameHelper() { \
|
||||
static PIString tn = PIStringAscii(#classname); \
|
||||
return tn; \
|
||||
} \
|
||||
template<> \
|
||||
inline uint __PIVariantFunctions__<classname>::typeIDHelper() { \
|
||||
static uint ret = PIStringAscii(#classname).hash(); \
|
||||
return ret; \
|
||||
} \
|
||||
REGISTER_VARIANT_TYPEINFO(classname) \
|
||||
STATIC_INITIALIZER_BEGIN \
|
||||
uint type_id = __PIVariantFunctions__<classname>::typeIDHelper(); \
|
||||
PIString type_name = __PIVariantFunctions__<classname>::typeNameHelper(); \
|
||||
if (__PIVariantInfoStorage__::get().contains(type_id)) return; \
|
||||
PIByteArray empty; \
|
||||
empty << classname(); \
|
||||
__PIVariantInfoStorage__::get()[type_id] = new __PIVariantInfo__(type_name, empty); \
|
||||
STATIC_INITIALIZER_END
|
||||
# define REGISTER_VARIANT(classname) \
|
||||
template<> \
|
||||
inline PIString __PIVariantFunctions__<classname>::typeNameHelper() { \
|
||||
static PIString tn = PIStringAscii(#classname); \
|
||||
return tn; \
|
||||
} \
|
||||
template<> \
|
||||
inline uint __PIVariantFunctions__<classname>::typeIDHelper() { \
|
||||
static uint ret = PIStringAscii(#classname).hash(); \
|
||||
return ret; \
|
||||
} \
|
||||
REGISTER_VARIANT_TYPEINFO(classname) \
|
||||
STATIC_INITIALIZER_BEGIN \
|
||||
uint type_id = __PIVariantFunctions__<classname>::typeIDHelper(); \
|
||||
PIString type_name = __PIVariantFunctions__<classname>::typeNameHelper(); \
|
||||
if (__PIVariantInfoStorage__::get().contains(type_id)) return; \
|
||||
PIByteArray empty; \
|
||||
empty << classname(); \
|
||||
__PIVariantInfoStorage__::get()[type_id] = new __PIVariantInfo__(type_name, empty); \
|
||||
STATIC_INITIALIZER_END
|
||||
|
||||
|
||||
# define REGISTER_VARIANT_CAST_H(classname_from, classname_to) \
|
||||
template<> \
|
||||
template<> \
|
||||
inline classname_to __PIVariantFunctions__<classname_from>::castVariant<classname_to>(const classname_from & v);
|
||||
template<> \
|
||||
template<> \
|
||||
inline classname_to __PIVariantFunctions__<classname_from>::castVariant<classname_to>(const classname_from & v);
|
||||
|
||||
# define REGISTER_VARIANT_CAST_CPP(classname_from, classname_to) \
|
||||
template<> \
|
||||
template<> \
|
||||
inline PIByteArray __PIVariantFunctions__<classname_from>::castHelper<classname_to>(PIByteArray v) { \
|
||||
classname_from f; \
|
||||
v >> f; \
|
||||
classname_to t = __PIVariantFunctions__<classname_from>::castVariant<classname_to>(f); \
|
||||
PIByteArray ret; \
|
||||
ret << t; \
|
||||
return ret; \
|
||||
template<> \
|
||||
template<> \
|
||||
inline PIByteArray __PIVariantFunctions__<classname_from>::castHelper<classname_to>(PIByteArray v) { \
|
||||
classname_from f; \
|
||||
v >> f; \
|
||||
classname_to t = __PIVariantFunctions__<classname_from>::castVariant<classname_to>(f); \
|
||||
PIByteArray ret; \
|
||||
ret << t; \
|
||||
return ret; \
|
||||
} \
|
||||
STATIC_INITIALIZER_BEGIN \
|
||||
__PIVariantInfo__ * vi(__PIVariantInfoStorage__::get().value(__PIVariantFunctions__<classname_from>::typeIDHelper(), nullptr)); \
|
||||
if (!vi) { \
|
||||
piCout << "Warning! Using REGISTER_VARIANT_CAST(" #classname_from ", " #classname_to ") before REGISTER_VARIANT(" #classname_from \
|
||||
"), ignore."; \
|
||||
return; \
|
||||
} \
|
||||
STATIC_INITIALIZER_BEGIN \
|
||||
__PIVariantInfo__ * vi(__PIVariantInfoStorage__::get().value(__PIVariantFunctions__<classname_from>::typeIDHelper(), nullptr)); \
|
||||
if (!vi) { \
|
||||
piCout << "Warning! Using REGISTER_VARIANT_CAST(" #classname_from ", " #classname_to \
|
||||
") before REGISTER_VARIANT(" #classname_from "), ignore."; \
|
||||
return; \
|
||||
} \
|
||||
vi->cast[__PIVariantFunctions__<classname_to>::typeIDHelper()] = \
|
||||
__PIVariantFunctions__<classname_from>::castHelper<classname_to>; \
|
||||
STATIC_INITIALIZER_END \
|
||||
template<> \
|
||||
template<> \
|
||||
classname_to __PIVariantFunctions__<classname_from>::castVariant<classname_to>(const classname_from & v)
|
||||
vi->cast[__PIVariantFunctions__<classname_to>::typeIDHelper()] = __PIVariantFunctions__<classname_from>::castHelper<classname_to>; \
|
||||
STATIC_INITIALIZER_END \
|
||||
template<> \
|
||||
template<> \
|
||||
classname_to __PIVariantFunctions__<classname_from>::castVariant<classname_to>(const classname_from & v)
|
||||
|
||||
# define REGISTER_VARIANT_CAST(classname_from, classname_to) \
|
||||
REGISTER_VARIANT_CAST_H(classname_from, classname_to) \
|
||||
REGISTER_VARIANT_CAST_CPP(classname_from, classname_to)
|
||||
REGISTER_VARIANT_CAST_H(classname_from, classname_to) \
|
||||
REGISTER_VARIANT_CAST_CPP(classname_from, classname_to)
|
||||
|
||||
|
||||
# define REGISTER_VARIANT_CAST_SIMPLE(classname_from, classname_to) \
|
||||
REGISTER_VARIANT_CAST(classname_from, classname_to) { \
|
||||
return classname_to(v); \
|
||||
}
|
||||
REGISTER_VARIANT_CAST(classname_from, classname_to) { return classname_to(v); }
|
||||
# define REGISTER_VARIANT_CAST_SIMPLE_H(classname_from, classname_to) REGISTER_VARIANT_CAST_H(classname_from, classname_to)
|
||||
# define REGISTER_VARIANT_CAST_SIMPLE_CPP(classname_from, classname_to) \
|
||||
REGISTER_VARIANT_CAST_CPP(classname_from, classname_to) { \
|
||||
return classname_to(v); \
|
||||
}
|
||||
REGISTER_VARIANT_CAST_CPP(classname_from, classname_to) { return classname_to(v); }
|
||||
|
||||
#else
|
||||
|
||||
@@ -1182,7 +1176,7 @@ REGISTER_VARIANT_CAST(PIGeoPosition, PIString) {
|
||||
g.setEllipsoidModel(PIEllipsoidModel::WGS84Ellipsoid());
|
||||
g.transformTo(PIGeoPosition::Geodetic);
|
||||
return PIString::fromNumber(g.latitudeGeodetic(), 'f', 8) + ", " + PIString::fromNumber(g.longitude(), 'f', 8) + ", " +
|
||||
PIString::fromNumber(g.height(), 'f', 2);
|
||||
PIString::fromNumber(g.height(), 'f', 2);
|
||||
};
|
||||
|
||||
REGISTER_VARIANT_CAST(PIString, PIGeoPosition) {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pivariantsimple.h
|
||||
* \ingroup Types
|
||||
* \brief
|
||||
* \~english Simple variant type
|
||||
* \~russian Простой вариативный тип
|
||||
*/
|
||||
//! \file pivariantsimple.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Simple variant type
|
||||
//! \~russian Простой вариативный тип
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Variant simple type
|
||||
@@ -178,35 +177,27 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#define REGISTER_PIVARIANTSIMPLE(Type) \
|
||||
template<> \
|
||||
class __VariantFunctions__<Type>: public __VariantFunctionsBase__ { \
|
||||
public: \
|
||||
__VariantFunctionsBase__ * instance() final { \
|
||||
static __VariantFunctions__<Type> ret; \
|
||||
return &ret; \
|
||||
} \
|
||||
PIString typeName() const final { \
|
||||
static PIString ret(#Type); \
|
||||
return ret; \
|
||||
} \
|
||||
uint hash() const final { \
|
||||
static uint ret = typeName().hash(); \
|
||||
return ret; \
|
||||
} \
|
||||
void newT(void *& ptr, const void * value) final { \
|
||||
ptr = (void *)(new Type(*(const Type *)value)); \
|
||||
} \
|
||||
void newNullT(void *& ptr) final { \
|
||||
ptr = (void *)(new Type()); \
|
||||
} \
|
||||
void assignT(void *& ptr, const void * value) final { \
|
||||
*(Type *)ptr = *(const Type *)value; \
|
||||
} \
|
||||
void deleteT(void *& ptr) final { \
|
||||
delete (Type *)(ptr); \
|
||||
} \
|
||||
};
|
||||
#define REGISTER_PIVARIANTSIMPLE(Type) \
|
||||
template<> \
|
||||
class __VariantFunctions__<Type>: public __VariantFunctionsBase__ { \
|
||||
public: \
|
||||
__VariantFunctionsBase__ * instance() final { \
|
||||
static __VariantFunctions__<Type> ret; \
|
||||
return &ret; \
|
||||
} \
|
||||
PIString typeName() const final { \
|
||||
static PIString ret(#Type); \
|
||||
return ret; \
|
||||
} \
|
||||
uint hash() const final { \
|
||||
static uint ret = typeName().hash(); \
|
||||
return ret; \
|
||||
} \
|
||||
void newT(void *& ptr, const void * value) final { ptr = (void *)(new Type(*(const Type *)value)); } \
|
||||
void newNullT(void *& ptr) final { ptr = (void *)(new Type()); } \
|
||||
void assignT(void *& ptr, const void * value) final { *(Type *)ptr = *(const Type *)value; } \
|
||||
void deleteT(void *& ptr) final { delete (Type *)(ptr); } \
|
||||
};
|
||||
|
||||
REGISTER_PIVARIANTSIMPLE(std::function<void(void *)>)
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/*! \file pivarianttypes.h
|
||||
* \ingroup Types
|
||||
* \brief
|
||||
* \~english Types for PIVariant
|
||||
* \~russian Типы для PIVariant
|
||||
*/
|
||||
//! \file pivarianttypes.h
|
||||
//! \ingroup Types
|
||||
//! \~\brief
|
||||
//! \~english Types for PIVariant
|
||||
//! \~russian Типы для PIVariant
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Variant types
|
||||
|
||||
Reference in New Issue
Block a user