git-svn-id: svn://db.shs.com.ru/pip@490 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PICODEPARSER_H
|
||||
#define PICODEPARSER_H
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PISCREENCONSOLE_H
|
||||
#define PISCREENCONSOLE_H
|
||||
|
||||
|
||||
@@ -21,8 +21,10 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PILIST_H
|
||||
#define PILIST_H
|
||||
|
||||
#include "pibase.h"
|
||||
#include <list>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PIPAIR_H
|
||||
#define PIPAIR_H
|
||||
|
||||
|
||||
@@ -57,8 +57,10 @@ public:
|
||||
|
||||
inline size_t rows() const {return rows_;}
|
||||
inline size_t cols() const {return cols_;}
|
||||
inline size_t size_all() const {return mat.size();}
|
||||
inline ssize_t size_s_all() const {return mat.size_s();}
|
||||
inline size_t size() const {return mat.size();}
|
||||
inline ssize_t size_s() const {return mat.size_s();}
|
||||
inline size_t length() const {return mat.length();}
|
||||
inline size_t capacity() const {return mat.capacity();}
|
||||
inline bool isEmpty() const {return mat.isEmpty();}
|
||||
|
||||
class Row {
|
||||
@@ -71,6 +73,19 @@ public:
|
||||
inline size_t size() const {return p_->cols_;}
|
||||
inline T & operator [](size_t index) {return p_->mat[st_ + index];}
|
||||
inline const T & operator [](size_t index) const {return p_->mat[st_ + index];}
|
||||
inline T * data(size_t index = 0) {return p_->mat.data(st_ + index);}
|
||||
inline const T * data(size_t index = 0) const {return p_->mat.data(st_ + index);}
|
||||
inline Row & operator =(const Row & other) {
|
||||
if (p_ == other.p_ && st_ == other.st_) return *this;
|
||||
size_t sz = piMin<size_t>(p_->cols_, other.p_->cols_);
|
||||
p_->copyRow(st_, other.data(), sz);
|
||||
return *this;
|
||||
}
|
||||
inline Row & operator =(const PIVector<T> & other) {
|
||||
size_t sz = piMin<size_t>(p_->cols_, other.size());
|
||||
p_->copyRow(st_, other.data(), sz);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
class RowConst {
|
||||
@@ -82,11 +97,26 @@ public:
|
||||
public:
|
||||
inline size_t size() const {return p_->cols_;}
|
||||
inline const T & operator [](size_t index) const {return p_->mat[st_ + index];}
|
||||
inline const T * data(size_t index = 0) const {return p_->mat.data(st_ + index);}
|
||||
};
|
||||
|
||||
|
||||
inline Row operator[](size_t index) {return Row(this, index);}
|
||||
inline RowConst operator[](size_t index) const {return RowConst(this, index);}
|
||||
inline T * data(size_t index = 0) {return mat.data(index);}
|
||||
inline const T * data(size_t index = 0) const {return mat.data(index);}
|
||||
|
||||
inline Row row(size_t index) {return Row(this, index);}
|
||||
inline PIVector2D<T> & setRow(size_t row, const Row & other) {
|
||||
size_t sz = piMin<size_t>(cols_, other.p_->cols_);
|
||||
copyRow(cols_ * row, other.data(), sz);
|
||||
return *this;
|
||||
}
|
||||
inline PIVector2D<T> & setRow(size_t row, const PIVector<T> & other) {
|
||||
size_t sz = piMin<size_t>(cols_, other.size());
|
||||
copyRow(cols_ * row, other.data(), sz);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PIVector<PIVector<T> > toVectors() const {
|
||||
PIVector<PIVector<T> > ret;
|
||||
@@ -97,9 +127,13 @@ public:
|
||||
PIVector<T> toPlainVector() const {return mat;}
|
||||
|
||||
private:
|
||||
inline void copyRow(size_t start, const T * data, size_t size) {
|
||||
for (size_t i = 0; i < size; i++)
|
||||
mat[start + i] = data[i];
|
||||
}
|
||||
|
||||
size_t rows_, cols_;
|
||||
PIVector<T> mat;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/*! \file piinit.h
|
||||
* \brief Initialization
|
||||
*
|
||||
*
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
/*! \file pitime_win.h
|
||||
* \brief PITime conversions for Windows
|
||||
*
|
||||
* This file declare time conversions for Windows
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PITime conversions for Windows
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef PITIME_WIN_H
|
||||
#define PITIME_WIN_H
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Speed and quality in/out diagnostics
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Bychkov Andrey wapmobil@gmail.com
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PIPACKETEXTRACTOR_H
|
||||
#define PIPACKETEXTRACTOR_H
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Protocol, input/output channel (COM, UDP)
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Bychkov Andrey wapmobil@gmail.com
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Protocol, input/output channel (COM, UDP)
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Bychkov Andrey wapmobil@gmail.com
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
COM
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Bychkov Andrey wapmobil@gmail.com
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
COM
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Bychkov Andrey wapmobil@gmail.com
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
/*! \file pimathcomplex.h
|
||||
* \brief PIP math complex
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PIP math complex
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PIMATHCOMPLEX_H
|
||||
#define PIMATHCOMPLEX_H
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Mutex
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru
|
||||
Copyright (C) 2017 Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
Reference in New Issue
Block a user