git-svn-id: svn://db.shs.com.ru/pip@211 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -101,6 +101,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline std::ostream & operator <<(std::ostream & s, const PIBitArray & ba) {for (uint i = 0; i < ba.bitSize(); ++i) {s << ba[i]; if (i % 8 == 7) s << ' ';} return s;}
|
inline std::ostream & operator <<(std::ostream & s, const PIBitArray & ba) {for (uint i = 0; i < ba.bitSize(); ++i) {s << ba[i]; if (i % 8 == 7) s << ' ';} return s;}
|
||||||
inline PICout operator <<(PICout s, const PIBitArray & ba) {s.space(); s.setControl(0, true); for (uint i = 0; i < ba.bitSize(); ++i) {s << ba[i]; if (i % 8 == 7) s << ' ';} s.restoreControl(); return s;}
|
inline PICout operator <<(PICout s, const PIBitArray & ba) {s.space(); s.setControl(0, true); for (uint i = 0; i < ba.bitSize(); ++i) {s << int(ba[i]); if (i % 8 == 7) s << ' ';} s.restoreControl(); return s;}
|
||||||
|
|
||||||
#endif // PIBITARRAY_H
|
#endif // PIBITARRAY_H
|
||||||
|
|||||||
@@ -48,7 +48,9 @@
|
|||||||
* \endcode
|
* \endcode
|
||||||
* */
|
* */
|
||||||
|
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
PIMap<PIString, __PIVariantInfo__ * > * __PIVariantInfoStorage__::map = 0;
|
PIMap<PIString, __PIVariantInfo__ * > * __PIVariantInfoStorage__::map = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
PIVariant::PIVariant() {
|
PIVariant::PIVariant() {
|
||||||
@@ -59,7 +61,9 @@ PIVariant::PIVariant() {
|
|||||||
PIVariant & PIVariant::operator =(const PIVariant & v) {
|
PIVariant & PIVariant::operator =(const PIVariant & v) {
|
||||||
_type = v._type;
|
_type = v._type;
|
||||||
_content = v._content;
|
_content = v._content;
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
_info = v._info;
|
_info = v._info;
|
||||||
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +105,10 @@ PIVariant::Type PIVariant::typeFromName(const PIString & tname) {
|
|||||||
|
|
||||||
|
|
||||||
PIString PIVariant::typeName() const {
|
PIString PIVariant::typeName() const {
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
if ((_type == Custom) && _info)
|
if ((_type == Custom) && _info)
|
||||||
return _info->typeName;
|
return _info->typeName;
|
||||||
|
#endif
|
||||||
return typeName(_type);
|
return typeName(_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,11 @@
|
|||||||
#include "pitime.h"
|
#include "pitime.h"
|
||||||
#include "pimathbase.h"
|
#include "pimathbase.h"
|
||||||
|
|
||||||
|
#ifndef QNX
|
||||||
|
# define CUSTOM_PIVARIANT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class __PIVariantFunctions__ {
|
class __PIVariantFunctions__ {
|
||||||
@@ -120,6 +125,7 @@ classname_to __PIVariantFunctions__<classname_from>::castVariant<classname_to>(c
|
|||||||
#define REGISTER_VARIANT_CAST_SIMPLE_H(classname_from, classname_to) REGISTER_VARIANT_CAST_H(classname_from, classname_to)
|
#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);}
|
#define REGISTER_VARIANT_CAST_SIMPLE_CPP(classname_from, classname_to) REGISTER_VARIANT_CAST_CPP(classname_from, classname_to) {return classname_to(v);}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
class PIP_EXPORT PIVariant {
|
class PIP_EXPORT PIVariant {
|
||||||
friend PICout operator <<(PICout s, const PIVariant & v);
|
friend PICout operator <<(PICout s, const PIVariant & v);
|
||||||
@@ -426,16 +432,20 @@ public:
|
|||||||
|
|
||||||
static PIVariant fromValue(const PIByteArray & c, const PIString & type) {
|
static PIVariant fromValue(const PIByteArray & c, const PIString & type) {
|
||||||
PIVariant ret;
|
PIVariant ret;
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
ret._info = __PIVariantInfoStorage__::get()->map->value(type, 0);
|
ret._info = __PIVariantInfoStorage__::get()->map->value(type, 0);
|
||||||
if (!ret._info) {
|
if (!ret._info) {
|
||||||
|
#endif
|
||||||
PIVariant::Type t = typeFromName(type);
|
PIVariant::Type t = typeFromName(type);
|
||||||
if (t == Invalid) {
|
if (t == Invalid) {
|
||||||
piCout << "Can`t initialize PIVariant from unregistered type \"" << type << "\"!";
|
piCout << "Can`t initialize PIVariant from unregistered type \"" << type << "\"!";
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret._type = t;
|
ret._type = t;
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
} else
|
} else
|
||||||
ret._type = Custom;
|
ret._type = Custom;
|
||||||
|
#endif
|
||||||
ret._content = c;
|
ret._content = c;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -454,14 +464,17 @@ private:
|
|||||||
_content.clear();
|
_content.clear();
|
||||||
_content << v;
|
_content << v;
|
||||||
_type = getType<T>();
|
_type = getType<T>();
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
if (_type == Custom) {
|
if (_type == Custom) {
|
||||||
_info = __PIVariantInfoStorage__::get()->map->value(__PIVariantFunctions__<T>::typeNameHelper(), 0);
|
_info = __PIVariantInfoStorage__::get()->map->value(__PIVariantFunctions__<T>::typeNameHelper(), 0);
|
||||||
if (!_info)
|
if (!_info)
|
||||||
piCout << "Can`t initialize PIVariant from unregistered type!";
|
piCout << "Can`t initialize PIVariant from unregistered type!";
|
||||||
} else
|
} else
|
||||||
_info = 0;
|
_info = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
template<typename T> static T getAsValue(const PIVariant & v) {
|
template<typename T> static T getAsValue(const PIVariant & v) {
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
if (v._content.isEmpty() || !v._info) return T();
|
if (v._content.isEmpty() || !v._info) return T();
|
||||||
PIString cn = __PIVariantFunctions__<T>::typeNameHelper();
|
PIString cn = __PIVariantFunctions__<T>::typeNameHelper();
|
||||||
piCout << "gav" << cn;
|
piCout << "gav" << cn;
|
||||||
@@ -476,11 +489,16 @@ private:
|
|||||||
}
|
}
|
||||||
T ret; ba >> ret;
|
T ret; ba >> ret;
|
||||||
return ret;
|
return ret;
|
||||||
|
#else
|
||||||
|
return T();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PIByteArray _content;
|
PIByteArray _content;
|
||||||
PIVariant::Type _type;
|
PIVariant::Type _type;
|
||||||
|
#ifdef CUSTOM_PIVARIANT
|
||||||
__PIVariantInfo__ * _info;
|
__PIVariantInfo__ * _info;
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -27,15 +27,10 @@
|
|||||||
|
|
||||||
/// Differential evaluations
|
/// Differential evaluations
|
||||||
|
|
||||||
struct TransferFunction { // <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
struct TransferFunction {
|
||||||
PIVector<double> vector_Bm, vector_An;
|
PIVector<double> vector_Bm, vector_An;
|
||||||
};
|
};
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><>-<2D><><EFBFBD>:
|
|
||||||
// <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
// <09><><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD> 4-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
// <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2, 3, 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
class PIP_EXPORT PIMathSolver
|
class PIP_EXPORT PIMathSolver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user