doc core reference done
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*! \file pivariantsimple.h
|
||||
* \ingroup Core
|
||||
* \brief
|
||||
* \~english Variant simple type
|
||||
* \~english Simple variant type
|
||||
* \~russian Простой вариативный тип
|
||||
*/
|
||||
/*
|
||||
@@ -62,9 +62,28 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//! \addtogroup Core
|
||||
//! \{
|
||||
//! \~\class PIVariantSimple pivariantsimple.h
|
||||
//! \~\brief
|
||||
//! \~english Simple variant type.
|
||||
//! \~russian Простой вариативный тип.
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//!
|
||||
//! \~russian
|
||||
//!
|
||||
//! \}
|
||||
class PIVariantSimple {
|
||||
public:
|
||||
|
||||
//! \~english Construct null %PIVariantSimple
|
||||
//! \~russian Создает пустой %PIVariantSimple
|
||||
PIVariantSimple() {ptr = 0; f = 0;}
|
||||
|
||||
//! \~english Contructs a copy of %PIVariantSimple.
|
||||
//! \~russian Создает копию %PIVariantSimple.
|
||||
PIVariantSimple(const PIVariantSimple & v) {
|
||||
ptr = 0;
|
||||
f = v.f;
|
||||
@@ -73,6 +92,8 @@ public:
|
||||
}
|
||||
~PIVariantSimple() {destroy();}
|
||||
|
||||
//! \~english Assign operator.
|
||||
//! \~russian Оператор присваивания.
|
||||
PIVariantSimple & operator=(const PIVariantSimple & v) {
|
||||
destroy();
|
||||
f = v.f;
|
||||
@@ -81,6 +102,8 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
//! \~english Set value to "v".
|
||||
//! \~russian Устанавливает значение в "v".
|
||||
template <typename T>
|
||||
void setValue(const T & v) {
|
||||
if (f) {
|
||||
@@ -94,6 +117,18 @@ public:
|
||||
f->newT(ptr, (const void *)&v);
|
||||
}
|
||||
|
||||
//! \~\brief
|
||||
//! \~english Returns value as type "T".
|
||||
//! \~russian Возвращает значение как тип "T".
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In contrast of PIVariant this class has strong check of type.
|
||||
//! Returns value only if this type was set before.
|
||||
//!
|
||||
//! \~russian
|
||||
//! В отличии от PIVariant этот класс строго проверяет типы.
|
||||
//! Возвращает значение только если этот же тип был установлен ранее.
|
||||
//!
|
||||
template <typename T>
|
||||
T value() const {
|
||||
if (!f) return T();
|
||||
@@ -102,6 +137,8 @@ public:
|
||||
return *(T*)(ptr);
|
||||
}
|
||||
|
||||
//! \~english Returns %PIVariantSimple with value "v".
|
||||
//! \~russian Возвращает %PIVariantSimple со значением "v".
|
||||
template <typename T>
|
||||
static PIVariantSimple fromValue(const T & v) {
|
||||
PIVariantSimple ret;
|
||||
|
||||
Reference in New Issue
Block a user