pip_cmg and picodeinfo.h doc
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/*! \file picodeinfo.h
|
||||
* \ingroup Code
|
||||
* \~\brief
|
||||
* \~english C++ code info structs
|
||||
* \~russian Структуры для C++ кода
|
||||
* \~english C++ code info structs. See \ref code_model.
|
||||
* \~russian Структуры для C++ кода. Подробнее \ref code_model.
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
@@ -34,17 +34,24 @@
|
||||
|
||||
class PIVariant;
|
||||
|
||||
//! \~english Namespace contains structures for code generation. See \ref code_model.
|
||||
//! \~russian Пространство имен содержит структуры для кодогенерации. Подробнее \ref code_model.
|
||||
namespace PICodeInfo {
|
||||
|
||||
|
||||
//! \~english
|
||||
//! Type modifiers
|
||||
//! \~russian
|
||||
//! Модификаторы типа
|
||||
enum TypeFlag {
|
||||
NoFlag,
|
||||
Const = 0x01,
|
||||
Static = 0x02,
|
||||
Mutable = 0x04,
|
||||
Volatile = 0x08,
|
||||
Inline = 0x10,
|
||||
Virtual = 0x20,
|
||||
Extern = 0x40
|
||||
Const /** const */ = 0x01,
|
||||
Static /** static */ = 0x02,
|
||||
Mutable /** mutable */ = 0x04,
|
||||
Volatile /** volatile */ = 0x08,
|
||||
Inline /** inline */ = 0x10,
|
||||
Virtual /** virtual */ = 0x20,
|
||||
Extern /** extern */ = 0x40
|
||||
};
|
||||
|
||||
typedef PIFlags<PICodeInfo::TypeFlag> TypeFlags;
|
||||
@@ -52,49 +59,145 @@ typedef PIMap<PIString, PIString> MetaMap;
|
||||
typedef PIByteArray(*AccessValueFunction)(const void *, const char *);
|
||||
typedef const char*(*AccessTypeFunction)(const char *);
|
||||
|
||||
|
||||
//! \~english Type information
|
||||
//! \~russian Информация о типе
|
||||
struct PIP_EXPORT TypeInfo {
|
||||
TypeInfo(const PIConstChars & n = PIConstChars(), const PIConstChars & t = PIConstChars(), PICodeInfo::TypeFlags f = 0, int b = -1) {name = n; type = t; flags = f; bits = b;}
|
||||
|
||||
//! \~english Returns if variable if bitfield
|
||||
//! \~russian Возвращает битовым ли полем является переменная
|
||||
bool isBitfield() const {return bits > 0;}
|
||||
|
||||
//! \~english Custom PIMETA content
|
||||
//! \~russian Произвольное содержимое PIMETA
|
||||
MetaMap meta;
|
||||
|
||||
//! \~english Name
|
||||
//! \~russian Имя
|
||||
PIConstChars name;
|
||||
|
||||
//! \~english Type
|
||||
//! \~russian Тип
|
||||
PIConstChars type;
|
||||
|
||||
//! \~english Modifiers
|
||||
//! \~russian Модификаторы
|
||||
PICodeInfo::TypeFlags flags;
|
||||
|
||||
//! \~english Bitfield variable bit count
|
||||
//! \~russian Количество бит битового поля
|
||||
int bits;
|
||||
};
|
||||
|
||||
|
||||
//! \~english Method information
|
||||
//! \~russian Информация о методе
|
||||
struct PIP_EXPORT FunctionInfo {
|
||||
|
||||
//! \~english Custom PIMETA content
|
||||
//! \~russian Произвольное содержимое PIMETA
|
||||
MetaMap meta;
|
||||
|
||||
//! \~english Name
|
||||
//! \~russian Имя
|
||||
PIConstChars name;
|
||||
|
||||
//! \~english Return type
|
||||
//! \~russian Возвращаемые тип
|
||||
TypeInfo return_type;
|
||||
|
||||
//! \~english Arguments types
|
||||
//! \~russian Типы аргументов
|
||||
PIVector<PICodeInfo::TypeInfo> arguments;
|
||||
};
|
||||
|
||||
|
||||
//! \~english Class or struct information
|
||||
//! \~russian Информация о классе или структуре
|
||||
struct PIP_EXPORT ClassInfo {
|
||||
ClassInfo() {has_name = true;}
|
||||
|
||||
//! \~english Custom PIMETA content
|
||||
//! \~russian Произвольное содержимое PIMETA
|
||||
MetaMap meta;
|
||||
|
||||
//! \~english Has name or not
|
||||
//! \~russian Имеет или нет имя
|
||||
bool has_name;
|
||||
|
||||
//! \~english Type
|
||||
//! \~russian Тип
|
||||
PIConstChars type;
|
||||
|
||||
//! \~english Name
|
||||
//! \~russian Имя
|
||||
PIConstChars name;
|
||||
|
||||
//! \~english Parent names
|
||||
//! \~russian Имена родителей
|
||||
PIVector<PIConstChars> parents;
|
||||
|
||||
//! \~english Variables
|
||||
//! \~russian Переменные
|
||||
PIVector<PICodeInfo::TypeInfo> variables;
|
||||
|
||||
//! \~english Methods
|
||||
//! \~russian Методы
|
||||
PIVector<PICodeInfo::FunctionInfo> functions;
|
||||
|
||||
//! \~english Subclass list
|
||||
//! \~russian Список наследников
|
||||
PIVector<PICodeInfo::ClassInfo * > children_info;
|
||||
};
|
||||
|
||||
|
||||
//! \~english Enumerator information
|
||||
//! \~russian Информация об элементе перечисления
|
||||
struct PIP_EXPORT EnumeratorInfo {
|
||||
EnumeratorInfo(const PIConstChars & n = PIConstChars(), int v = 0) {name = n; value = v;}
|
||||
PIVariantTypes::Enumerator toPIVariantEnumerator() {return PIVariantTypes::Enumerator(value, name.toString());}
|
||||
|
||||
//! \~english Custom PIMETA content
|
||||
//! \~russian Произвольное содержимое PIMETA
|
||||
MetaMap meta;
|
||||
|
||||
//! \~english Name
|
||||
//! \~russian Имя
|
||||
PIConstChars name;
|
||||
|
||||
//! \~english Value
|
||||
//! \~russian Значение
|
||||
int value;
|
||||
};
|
||||
|
||||
|
||||
//! \~english Enum information
|
||||
//! \~russian Информация о перечислении
|
||||
struct PIP_EXPORT EnumInfo {
|
||||
|
||||
//! \~english Returns member name with value "value"
|
||||
//! \~russian Возвращает имя элемента со значением "value"
|
||||
PIString memberName(int value) const;
|
||||
|
||||
//! \~english Returns member value with name "name"
|
||||
//! \~russian Возвращает значение элемента с именем "name"
|
||||
int memberValue(const PIString & name) const;
|
||||
|
||||
//! \~english Returns as PIVariantTypes::Enum
|
||||
//! \~russian Возвращает как PIVariantTypes::Enum
|
||||
PIVariantTypes::Enum toPIVariantEnum();
|
||||
|
||||
//! \~english Custom PIMETA content
|
||||
//! \~russian Произвольное содержимое PIMETA
|
||||
MetaMap meta;
|
||||
|
||||
//! \~english Name
|
||||
//! \~russian Имя
|
||||
PIConstChars name;
|
||||
|
||||
//! \~english Members
|
||||
//! \~russian Элементы
|
||||
PIVector<PICodeInfo::EnumeratorInfo> members;
|
||||
};
|
||||
|
||||
@@ -161,9 +264,17 @@ inline PICout operator <<(PICout s, const PICodeInfo::EnumInfo & v) {
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
//! \~english Pointer to single storage of PICodeInfo::ClassInfo, access by name
|
||||
//! \~russian Указатель на единое хренилище PICodeInfo::ClassInfo, доступ по имени
|
||||
extern PIP_EXPORT PIMap<PIConstChars, PICodeInfo::ClassInfo * > * classesInfo;
|
||||
|
||||
//! \~english Pointer to single storage of PICodeInfo::EnumInfo, access by name
|
||||
//! \~russian Указатель на единое хренилище PICodeInfo::EnumInfo, доступ по имени
|
||||
extern PIP_EXPORT PIMap<PIConstChars, PICodeInfo::EnumInfo * > * enumsInfo;
|
||||
|
||||
extern PIP_EXPORT PIMap<PIConstChars, PICodeInfo::AccessValueFunction> * accessValueFunctions;
|
||||
|
||||
extern PIP_EXPORT PIMap<PIConstChars, PICodeInfo::AccessTypeFunction> * accessTypeFunctions;
|
||||
|
||||
inline PIByteArray getMemberValue(const void * p, const char * class_name, const char * member_name) {
|
||||
|
||||
@@ -35,9 +35,11 @@
|
||||
//!
|
||||
//! \~english
|
||||
//! These files provides parsing C++ code and storage to use results of \a pip_cmg utility.
|
||||
//! See \ref code_model.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Эти файлы обеспечивают разбор C++ кода и хранение результатов работы утилиты \a pip_cmg.
|
||||
//! Подробнее \ref code_model.
|
||||
//!
|
||||
//! \~\authors
|
||||
//! \~english
|
||||
|
||||
Reference in New Issue
Block a user