C++ (Qt)template <typename T> class X : public BaseElement{}; QVector<BaseElement *> * ptrY = new QVector<BaseElement *> (n);(*ptrY)[0] = new X<float>(..);
C++ (Qt)class Parametr { ... QString m_name, m_comment; QVariant m_value;...}; QList<Parametr> theParamList;theParamList << Parametr("name", "comment", QVariant((float) value));...
class ParametrName{private: int type; int sorce; float multiplier; QString name; QString discription; QString dimension;public: ParametrName (QTextStream &input); ParametrName (const ParametrName& toCopy); int getType (); int getSorce (); float getMultiplier (); QString getDimension (); QString getName (); QString getDiscription (); void setType ( int toSet); void setSorce ( int toSet); void setMultiplier ( float toSet); void setDimension (QString toSet); void setName (QString toSet); void setDiscription (QString toSet);};template <typename T> class MyQueueBuffer{private: int bufferLength; QQueue<MyData<T>> myQueueBuffer;public: MyQueueBuffer<T> (const MyQueueBuffer <T>& toCopy); MyQueueBuffer<T> (int length); T dequeue(); void enqueue(const T &t);};template <typename T> MyQueueBuffer<T>::MyQueueBuffer (const MyQueueBuffer <T>& toCopy){ bufferLength = toCopy.bufferLength; myQueueBuffer = toCopy.myQueueBuffer;}template <typename T> MyQueueBuffer<T>::MyQueueBuffer (int length){ bufferLength = length;}template <typename T>class Parametr : public ParametrName{public: enum { continuous = 0, discreteYesNo = 1, time = 2, dateTime = 3 } parametrTypes; enum { measured = 0, calculated = 1, calculatedExternal = 2 } parametrSource;private: T minPossibleValue; T maxPossibleValue; T minMarginalValue; T maxMarginalValue; MyQueueBuffer<T> *buffer;public: Parametr<T> (const Parametr <T>& toCopy); Parametr<T> (const ParametrName& toCopy); Parametr<T> (QTextStream &input, ParametrName const& toCopy); T getMinPossibleValue (); T getMaxPossibleValue (); T getMinMarginalValue (); T getMaxMarginalValue (); void setMinPossibleValue (T minToSet); void setMaxPossibleValue (T maxToSet); void setMinMarginalValue (T minToSet); void setMaxMarginalValue (T maxToSet); void initBuffer (int length);};
MyQueueBuffer<T> *buffer, T minPossibleValue; T maxPossibleValue; T minMarginalValue; T maxMarginalValue;
C++ (Qt)class ParametrName {..virtual double getMinPossibleValue( void ) = 0;..};
C++ (Qt)template <typename T>class Parametr : public ParametrName {.. double getMinPossibleValue( void ) override { return minPossibleValue; }..};