fix some warnings, add some doc

This commit is contained in:
2021-08-04 14:31:36 +03:00
parent cba6db4f38
commit 0c7ce272e6
11 changed files with 44 additions and 25 deletions

View File

@@ -31,7 +31,7 @@ class PIP_CLOUD_EXPORT PICloudClient: public PIIODevice, public PICloudBase
{
PIIODEVICE(PICloudClient)
public:
//!
//! PICloudClient
explicit PICloudClient(const PIString & path = PIString(), PIIODevice::DeviceMode mode = PIIODevice::ReadWrite);
virtual ~PICloudClient();

View File

@@ -31,7 +31,7 @@ class PIP_CLOUD_EXPORT PICloudServer: public PIIODevice, public PICloudBase
{
PIIODEVICE(PICloudServer)
public:
//!
//! PICloudServer
explicit PICloudServer(const PIString & path = PIString(), PIIODevice::DeviceMode mode = PIIODevice::ReadWrite);
virtual ~PICloudServer();

View File

@@ -1,4 +1,4 @@
/*! \file pivecto2d.h
/*! \file pivector2d.h
* \brief 2D wrapper around PIVector
*
* This file declares PIVector

View File

@@ -37,7 +37,12 @@
class PIString;
class PIByteArray;
/*! \brief The PIByteArray class provides an array of bytes
* \details PIByteArray used to store raw bytes.
* It can be constructed from any data and size.
* You can use PIByteArray as binary stream
* to serialize/deserialize any objects and data.
*/
class PIP_EXPORT PIByteArray: public PIDeque<uchar>
{
public:
@@ -87,14 +92,15 @@ public:
//! Return converted to Base 64 data
PIByteArray toBase64() const;
//! Return converted from Base 64 data
PIByteArray & compressRLE(uchar threshold = 192);
PIByteArray & decompressRLE(uchar threshold = 192);
PIByteArray compressedRLE(uchar threshold = 192) {PIByteArray ba(*this); ba.compressRLE(threshold); return ba;}
PIByteArray decompressedRLE(uchar threshold = 192) {PIByteArray ba(*this); ba.decompressRLE(threshold); return ba;}
PIString toString(int base = 16) const;
//! Returns a hex encoded copy of the byte array.
//! The hex encoding uses the numbers 0-9 and the letters a-f.
PIString toHex() const;
//! Add to the end data "data" with size "size"
@@ -106,10 +112,18 @@ public:
//! Add to the end "t"
PIByteArray & append(uchar t) {push_back(t); return *this;}
//! Returns plain 8-bit checksum
//! Returns 8-bit checksum
//! sum all bytes, add 1, inverse
//! Pseudocode:
//! sum += at(i);
//! return ~(sum + 1)
uchar checksumPlain8() const;
//! Returns plain 32-bit checksum
//! Returns 32-bit checksum
//! sum all bytes multiplyed by index+1, add 1, inverse
//! Pseudocode:
//! sum += at(i) * (i + 1);
//! return ~(sum + 1)
uint checksumPlain32() const;
//! Returns hash
@@ -122,7 +136,10 @@ public:
PIByteArray & operator =(PIByteArray && o) {swap(o); return *this;}
static PIByteArray fromUserInput(PIString str);
static PIByteArray fromHex(PIString str);
//! Return converted from Base 64 data
static PIByteArray fromBase64(const PIByteArray & base64);
static PIByteArray fromBase64(const PIString & base64);

View File

@@ -754,30 +754,30 @@ private:
};
//! \relatesalso PIString \relatesalso PICout \brief Output operator to PICout
//! \relatesalso PICout \brief Output operator to PICout
PIP_EXPORT PICout operator <<(PICout s, const PIString & v);
//! \relatesalso PIString \relatesalso PIByteArray \brief Output operator to PIByteArray
//! \relatesalso PIByteArray \brief Output operator to PIByteArray
inline PIByteArray & operator <<(PIByteArray & s, const PIString & v) {s << *(PIDeque<PIChar>*)&v; return s;}
//! \relatesalso PIString \relatesalso PIByteArray \brief Input operator from PIByteArray
//! \relatesalso PIByteArray \brief Input operator from PIByteArray
inline PIByteArray & operator >>(PIByteArray & s, PIString & v) {v.clear(); s >> *(PIDeque<PIChar>*)&v; return s;}
//! \relatesalso PIString \brief Return concatenated string
//! \brief Return concatenated string
inline PIString operator +(const PIString & str, const PIString & f) {PIString s(str); s += f; return s;}
//! \relatesalso PIString \brief Return concatenated string
//! \brief Return concatenated string
inline PIString operator +(const PIString & f, const char * str) {PIString s(f); s += str; return s;}
//! \relatesalso PIString \brief Return concatenated string
//! \brief Return concatenated string
inline PIString operator +(const char * str, const PIString & f) {return PIString(str) + f;}
//! \relatesalso PIString \brief Return concatenated string
inline PIString operator +(const char c, const PIString & f) {return PIChar(c) + f;}
//! \relatesalso PIString \brief Return concatenated string
//! \brief Return concatenated string
inline PIString operator +(const PIString & f, const char c) {return f + PIChar(c);}

View File

@@ -76,7 +76,7 @@ public:
PIStringList & removeDuplicates();
//! \brief Trim all strings
//! \details Example: \snippet pistring.cpp PIStringList::trim
//! \details Example: \snippet pistring.cpp PIString::trim
PIStringList & trim() {for (uint i = 0; i < size(); ++i) (*this)[i].trim(); return *this;}
//! Return sum of lengths of all strings
@@ -97,13 +97,13 @@ public:
};
//! \relatesalso PIStringList \relatesalso PIByteArray \brief Output operator to PIByteArray
//! \relatesalso PIByteArray \brief Output operator to PIByteArray
inline PIByteArray & operator <<(PIByteArray & s, const PIStringList & v) {s << int(v.size_s()); for (int i = 0; i < v.size_s(); ++i) s << v[i]; return s;}
//! \relatesalso PIStringList \relatesalso PIByteArray \brief Input operator from PIByteArray
//! relatesalso PIByteArray \brief Input operator from PIByteArray
inline PIByteArray & operator >>(PIByteArray & s, PIStringList & v) {int sz; s >> sz; v.resize(sz); for (int i = 0; i < sz; ++i) s >> v[i]; return s;}
//! \relatesalso PIStringList \relatesalso PICout \brief Output operator to PICout
//! \relatesalso PICout \brief Output operator to PICout
inline PICout operator <<(PICout s, const PIStringList & v) {s.space(); s.setControl(0, true); s << "{"; for (uint i = 0; i < v.size(); ++i) {s << "\"" << v[i] << "\""; if (i < v.size() - 1) s << ", ";} s << "}"; s.restoreControl(); return s;}
#endif // PISTRINGLIST_H

View File

@@ -167,7 +167,7 @@ private:
};
//! \relatesalso PICout \relatesalso PICout \brief Output operator to PICout
//! \relatesalso PICout \brief Output operator to PICout
inline PICout operator <<(PICout s, const PISystemTime & v) {s.space(); s.setControl(0, true); s << "(" << v.seconds << " s, " << v.nanoseconds << " ns)"; s.restoreControl(); return s;}
@@ -191,7 +191,7 @@ inline bool operator !=(const PITime & t0, const PITime & t1) {return !(t0 == t1
inline bool operator <=(const PITime & t0, const PITime & t1) {return !(t0 > t1);}
inline bool operator >=(const PITime & t0, const PITime & t1) {return !(t0 < t1);}
//! \relatesalso PICout \relatesalso PICout \brief Output operator to PICout
//! \relatesalso PICout \brief Output operator to PICout
PIP_EXPORT PICout operator <<(PICout s, const PITime & v);
@@ -213,7 +213,7 @@ inline bool operator !=(const PIDate & t0, const PIDate & t1) {return !(t0 == t1
inline bool operator <=(const PIDate & t0, const PIDate & t1) {return !(t0 > t1);}
inline bool operator >=(const PIDate & t0, const PIDate & t1) {return !(t0 < t1);}
//! \relatesalso PICout \relatesalso PICout \brief Output operator to PICout
//! \relatesalso PICout \brief Output operator to PICout
PIP_EXPORT PICout operator <<(PICout s, const PIDate & v);
@@ -258,7 +258,7 @@ inline bool operator >=(const PIDateTime & t0, const PIDateTime & t1) {return !(
inline PIByteArray & operator <<(PIByteArray & s, const PIDateTime & v) {s << v.year << v.month << v.day << v.hours << v.minutes << v.seconds << v.milliseconds; return s;}
inline PIByteArray & operator >>(PIByteArray & s, PIDateTime & v) {s >> v.year >> v.month >> v.day >> v.hours >> v.minutes >> v.seconds >> v.milliseconds; return s;}
//! \relatesalso PICout \relatesalso PICout \brief Output operator to PICout
//! \relatesalso PICout \brief Output operator to PICout
PIP_EXPORT PICout operator <<(PICout s, const PIDateTime & v);

View File

@@ -324,7 +324,7 @@ private:
PIByteArray user_header;
};
//! \relatesalso PICout \relatesalso PIBinaryLog::BinLogInfo \brief Output operator to PICout
//! \relatesalso PICout \brief Output operator PIBinaryLog::BinLogInfo to PICout
inline PICout operator <<(PICout s, const PIBinaryLog::BinLogInfo & bi) {
s.space();
s.setControl(0, true);

View File

@@ -45,7 +45,7 @@
* Application should use class \a PIPluginLoader to load
* plugin. Main function is \a load(PIString name).
* "name" is base name of library, %PIPluginLoader
* try to use sevaral names, <name>, lib<name> and
* try to use sevaral names, \<name\>, lib\<name\> and
* "dll", "so" and "dylib" extensions, depends on system.
* For example:
* \code

View File

@@ -87,6 +87,7 @@ public:
* exceeding the queue's capacity, returning true upon success and false if this queue is full.
*
* @param v the element to add
* @param timeoutMs the timeout waiting for inserting if que is full, if timeout = 0, then returns immediately
* @return true if the element was added to this queue, else false
*/
bool offer(const T & v, int timeoutMs = 0) {

View File

@@ -2,6 +2,7 @@
#include "piresources.h"
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
#define CL_TARGET_OPENCL_VERSION 120
#ifdef MAC_OS
# include "cl.h"
#else