git-svn-id: svn://db.shs.com.ru/pip@804 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -35,6 +35,7 @@ template <typename T>
|
|||||||
class PIDeque {
|
class PIDeque {
|
||||||
public:
|
public:
|
||||||
inline PIDeque(): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) {
|
inline PIDeque(): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) {
|
||||||
|
//piCout << "PIDeque";
|
||||||
PIINTROSPECTION_CONTAINER_NEW(T)
|
PIINTROSPECTION_CONTAINER_NEW(T)
|
||||||
}
|
}
|
||||||
inline PIDeque(const PIDeque<T> & other): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) {
|
inline PIDeque(const PIDeque<T> & other): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) {
|
||||||
@@ -52,6 +53,7 @@ public:
|
|||||||
resize(pid_size, f);
|
resize(pid_size, f);
|
||||||
}
|
}
|
||||||
inline virtual ~PIDeque() {
|
inline virtual ~PIDeque() {
|
||||||
|
//piCout << "~PIDeque";
|
||||||
PIINTROSPECTION_CONTAINER_DELETE(T)
|
PIINTROSPECTION_CONTAINER_DELETE(T)
|
||||||
PIINTROSPECTION_CONTAINER_FREE(T, (pid_rsize)*sizeof(T))
|
PIINTROSPECTION_CONTAINER_FREE(T, (pid_rsize)*sizeof(T))
|
||||||
deleteT(pid_data + pid_start, pid_size);
|
deleteT(pid_data + pid_start, pid_size);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#define PISTRING_H
|
#define PISTRING_H
|
||||||
|
|
||||||
#include "pibytearray.h"
|
#include "pibytearray.h"
|
||||||
|
|
||||||
#define PIStringAscii PIString::fromAscii
|
#define PIStringAscii PIString::fromAscii
|
||||||
|
|
||||||
|
|
||||||
@@ -36,7 +37,7 @@ class PIP_EXPORT PIString: public PIDeque<PIChar>
|
|||||||
friend PIByteArray & operator >>(PIByteArray & s, PIString & v);
|
friend PIByteArray & operator >>(PIByteArray & s, PIString & v);
|
||||||
public:
|
public:
|
||||||
//! Contructs an empty string
|
//! Contructs an empty string
|
||||||
PIString(): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--;}
|
PIString(): PIDeque<PIChar>() {}
|
||||||
|
|
||||||
//inline PIString & operator +=(const char c) {push_back(c); return *this;}
|
//inline PIString & operator +=(const char c) {push_back(c); return *this;}
|
||||||
PIString & operator +=(const PIChar & c) {push_back(c); return *this;}
|
PIString & operator +=(const PIChar & c) {push_back(c); return *this;}
|
||||||
@@ -46,55 +47,55 @@ public:
|
|||||||
PIString & operator +=(const PIString & str);
|
PIString & operator +=(const PIString & str);
|
||||||
|
|
||||||
//PIString(const char c) {*this += c;}
|
//PIString(const char c) {*this += c;}
|
||||||
PIString(const PIString & o): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += o;}
|
PIString(const PIString & o): PIDeque<PIChar>() {*this += o;}
|
||||||
|
|
||||||
|
|
||||||
//! Contructs string with single symbol "c"
|
//! Contructs string with single symbol "c"
|
||||||
PIString(const PIChar & c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += c;}
|
PIString(const PIChar & c): PIDeque<PIChar>() {*this += c;}
|
||||||
PIString(const char c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += PIChar(c);}
|
PIString(const char c): PIDeque<PIChar>() {*this += PIChar(c);}
|
||||||
|
|
||||||
/*! \brief Contructs string from c-string "str"
|
/*! \brief Contructs string from c-string "str"
|
||||||
* \details "str" should be null-terminated\n
|
* \details "str" should be null-terminated\n
|
||||||
* Example: \snippet pistring.cpp PIString(char * ) */
|
* Example: \snippet pistring.cpp PIString(char * ) */
|
||||||
PIString(const char * str): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += str;}
|
PIString(const char * str): PIDeque<PIChar>() {*this += str;}
|
||||||
|
|
||||||
/*! \brief Contructs string from \c wchar_t c-string "str"
|
/*! \brief Contructs string from \c wchar_t c-string "str"
|
||||||
* \details "str" should be null-terminated\n
|
* \details "str" should be null-terminated\n
|
||||||
* Example: \snippet pistring.cpp PIString(wchar_t * ) */
|
* Example: \snippet pistring.cpp PIString(wchar_t * ) */
|
||||||
PIString(const wchar_t * str): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += str;}
|
PIString(const wchar_t * str): PIDeque<PIChar>() {*this += str;}
|
||||||
|
|
||||||
//! Contructs string from byte array "ba"
|
//! Contructs string from byte array "ba"
|
||||||
PIString(const PIByteArray & ba): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += ba;}
|
PIString(const PIByteArray & ba): PIDeque<PIChar>() {*this += ba;}
|
||||||
|
|
||||||
//! \brief Contructs string from "len" characters of buffer "str"
|
//! \brief Contructs string from "len" characters of buffer "str"
|
||||||
PIString(const PIChar * str, const int len): PIDeque<PIChar>(str, size_t(len)) {/*reserve(4); */piMonitor.strings++; piMonitor.containers--;}
|
PIString(const PIChar * str, const int len): PIDeque<PIChar>(str, size_t(len)) {}
|
||||||
|
|
||||||
/*! \brief Contructs string from "len" characters of buffer "str"
|
/*! \brief Contructs string from "len" characters of buffer "str"
|
||||||
* \details Example: \snippet pistring.cpp PIString(char * , int) */
|
* \details Example: \snippet pistring.cpp PIString(char * , int) */
|
||||||
PIString(const char * str, const int len): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; appendFromChars(str, len);}
|
PIString(const char * str, const int len): PIDeque<PIChar>() {appendFromChars(str, len);}
|
||||||
|
|
||||||
/*! \brief Contructs string as sequence of characters "c" of buffer with length "len"
|
/*! \brief Contructs string as sequence of characters "c" of buffer with length "len"
|
||||||
* \details Example: \snippet pistring.cpp PIString(int, char) */
|
* \details Example: \snippet pistring.cpp PIString(int, char) */
|
||||||
PIString(const int len, const char c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; for (int i = 0; i < len; ++i) push_back(c);}
|
PIString(const int len, const char c): PIDeque<PIChar>() {for (int i = 0; i < len; ++i) push_back(c);}
|
||||||
|
|
||||||
/*! \brief Contructs string as sequence of symbols "c" of buffer with length "len"
|
/*! \brief Contructs string as sequence of symbols "c" of buffer with length "len"
|
||||||
* \details Example: \snippet pistring.cpp PIString(int, PIChar) */
|
* \details Example: \snippet pistring.cpp PIString(int, PIChar) */
|
||||||
PIString(const int len, const PIChar & c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; for (int i = 0; i < len; ++i) push_back(c);}
|
PIString(const int len, const PIChar & c): PIDeque<PIChar>() {for (int i = 0; i < len; ++i) push_back(c);}
|
||||||
|
|
||||||
|
|
||||||
// PIString(const short & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const short & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const ushort & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const ushort & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const int & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const int & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const uint & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const uint & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const long & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const long & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const ulong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const ulong & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const llong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const llong & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const ullong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const ullong & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const float & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const float & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
// PIString(const double & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
// PIString(const double & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||||
|
|
||||||
|
|
||||||
~PIString() {piMonitor.strings--; piMonitor.containers++;}
|
~PIString() {}
|
||||||
|
|
||||||
|
|
||||||
PIString & operator =(const PIString & o) {if (this == &o) return *this; clear(); *this += o; return *this;}
|
PIString & operator =(const PIString & o) {if (this == &o) return *this; clear(); *this += o; return *this;}
|
||||||
|
|||||||
@@ -29,7 +29,13 @@ class PITimer;
|
|||||||
class PIPeer;
|
class PIPeer;
|
||||||
class PIIntrospection;
|
class PIIntrospection;
|
||||||
|
|
||||||
#define __PIINTROSPECTION_SINGLETON__(T) \
|
#define __PIINTROSPECTION_SINGLETON_H__(T) \
|
||||||
static PIIntrospection##T##Interface * instance() {static PIIntrospection##T##Interface ret; return &ret;} \
|
static PIIntrospection##T##Interface * instance();
|
||||||
|
|
||||||
|
#define __PIINTROSPECTION_SINGLETON_CPP__(T) \
|
||||||
|
PIIntrospection##T##Interface * PIIntrospection##T##Interface::instance() {\
|
||||||
|
static PIIntrospection##T##Interface ret;\
|
||||||
|
return &ret;\
|
||||||
|
}
|
||||||
|
|
||||||
#endif // PIINTROSPECTION_BASE_H
|
#endif // PIINTROSPECTION_BASE_H
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#include "piintrospection_containers.h"
|
#include "piintrospection_containers.h"
|
||||||
#include "piintrospection_containers_p.h"
|
#include "piintrospection_containers_p.h"
|
||||||
|
|
||||||
|
__PIINTROSPECTION_SINGLETON_CPP__(Containers)
|
||||||
|
|
||||||
|
|
||||||
PIIntrospectionContainersInterface::PIIntrospectionContainersInterface() {
|
PIIntrospectionContainersInterface::PIIntrospectionContainersInterface() {
|
||||||
p = new PIIntrospectionContainers();
|
p = new PIIntrospectionContainers();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
class PIIntrospectionContainers;
|
class PIIntrospectionContainers;
|
||||||
|
|
||||||
#define PIINTROSPECTION_CONTAINERS (PIIntrospectionContainersInterface::instance())
|
#define PIINTROSPECTION_CONTAINERS (PIIntrospectionContainersInterface::instance())//(PIIntrospectionContainersInterface::instance())
|
||||||
|
|
||||||
//#if defined(__PIIS__)
|
//#if defined(__PIIS__)
|
||||||
//# undef __PIIS__
|
//# undef __PIIS__
|
||||||
@@ -55,11 +55,12 @@ class PIIntrospectionContainers;
|
|||||||
# define PIINTROSPECTION_CONTAINER_UNUSED(t, cnt)
|
# define PIINTROSPECTION_CONTAINER_UNUSED(t, cnt)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
class PIP_EXPORT PIIntrospectionContainersInterface {
|
class PIP_EXPORT PIIntrospectionContainersInterface {
|
||||||
friend class PIIntrospection;
|
friend class PIIntrospection;
|
||||||
friend class PIIntrospectionServer;
|
friend class PIIntrospectionServer;
|
||||||
public:
|
public:
|
||||||
__PIINTROSPECTION_SINGLETON__(Containers)
|
__PIINTROSPECTION_SINGLETON_H__(Containers)
|
||||||
|
|
||||||
void containerNew (const char * tn);
|
void containerNew (const char * tn);
|
||||||
void containerDelete(const char * tn);
|
void containerDelete(const char * tn);
|
||||||
@@ -68,12 +69,13 @@ public:
|
|||||||
void containerUsed (const char * tn, ullong cnt);
|
void containerUsed (const char * tn, ullong cnt);
|
||||||
void containerUnused(const char * tn, ullong cnt);
|
void containerUnused(const char * tn, ullong cnt);
|
||||||
|
|
||||||
|
PIIntrospectionContainers * p;
|
||||||
private:
|
private:
|
||||||
PIIntrospectionContainersInterface();
|
PIIntrospectionContainersInterface();
|
||||||
~PIIntrospectionContainersInterface();
|
~PIIntrospectionContainersInterface();
|
||||||
|
|
||||||
PIIntrospectionContainers * p;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // PIINTROSPECTION_CONTAINERS_H
|
#endif // PIINTROSPECTION_CONTAINERS_H
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ PIIntrospectionContainers::Type::Type() {
|
|||||||
|
|
||||||
|
|
||||||
PIIntrospectionContainers::PIIntrospectionContainers() {
|
PIIntrospectionContainers::PIIntrospectionContainers() {
|
||||||
|
//printf("PIIntrospectionContainers %p\n", this);
|
||||||
crc = standardCRC_32();
|
crc = standardCRC_32();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,24 +52,32 @@ void PIIntrospectionContainers::containerDelete(const char * tn) {
|
|||||||
|
|
||||||
|
|
||||||
void PIIntrospectionContainers::containerAlloc(const char * tn, ullong cnt) {
|
void PIIntrospectionContainers::containerAlloc(const char * tn, ullong cnt) {
|
||||||
|
//printf(" alloc %s %d\n", tn, cnt);
|
||||||
|
if (cnt == 0) return;
|
||||||
PIMutexLocker _ml(mutex);
|
PIMutexLocker _ml(mutex);
|
||||||
data[typeID(tn)].bytes_allocated += cnt;
|
data[typeID(tn)].bytes_allocated += cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIIntrospectionContainers::containerFree(const char * tn, ullong cnt) {
|
void PIIntrospectionContainers::containerFree(const char * tn, ullong cnt) {
|
||||||
|
//printf(" free %s %d\n", tn, cnt);
|
||||||
|
if (cnt == 0) return;
|
||||||
PIMutexLocker _ml(mutex);
|
PIMutexLocker _ml(mutex);
|
||||||
data[typeID(tn)].bytes_allocated -= cnt;
|
data[typeID(tn)].bytes_allocated -= cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIIntrospectionContainers::containerUsed(const char * tn, ullong cnt) {
|
void PIIntrospectionContainers::containerUsed(const char * tn, ullong cnt) {
|
||||||
|
//printf(" used %s %d\n", tn, cnt);
|
||||||
|
if (cnt == 0) return;
|
||||||
PIMutexLocker _ml(mutex);
|
PIMutexLocker _ml(mutex);
|
||||||
data[typeID(tn)].bytes_used += cnt;
|
data[typeID(tn)].bytes_used += cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIIntrospectionContainers::containerUnused(const char * tn, ullong cnt) {
|
void PIIntrospectionContainers::containerUnused(const char * tn, ullong cnt) {
|
||||||
|
//printf("unused %s %d\n", tn, cnt);
|
||||||
|
if (cnt == 0) return;
|
||||||
PIMutexLocker _ml(mutex);
|
PIMutexLocker _ml(mutex);
|
||||||
data[typeID(tn)].bytes_used -= cnt;
|
data[typeID(tn)].bytes_used -= cnt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,21 +29,15 @@ PRIVATE_DEFINITION_END(PIIntrospectionServer)
|
|||||||
|
|
||||||
PIIntrospectionServer::PIIntrospectionServer(): PIPeer(genName()) {
|
PIIntrospectionServer::PIIntrospectionServer(): PIPeer(genName()) {
|
||||||
PRIVATE->process_info = PIIntrospection::getInfo();
|
PRIVATE->process_info = PIIntrospection::getInfo();
|
||||||
CONNECTU(&itimer, tickEvent, this, timerEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PIIntrospectionServer::~PIIntrospectionServer() {
|
PIIntrospectionServer::~PIIntrospectionServer() {
|
||||||
itimer.stop(false);
|
|
||||||
if (!itimer.waitForFinish(1000)) {
|
|
||||||
PIINTROSPECTION_CONTAINERS->p->mutex.unlock();
|
|
||||||
}
|
|
||||||
PIPeer::stop();
|
PIPeer::stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIIntrospectionServer::start() {
|
void PIIntrospectionServer::start() {
|
||||||
itimer.start(1000);
|
|
||||||
PIPeer::start();
|
PIPeer::start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,14 +48,24 @@ PIString PIIntrospectionServer::genName() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIIntrospectionServer::timerEvent() {
|
void PIIntrospectionServer::dataReceived(const PIString & from, const PIByteArray & data) {
|
||||||
|
if (data.size() < 8) return;
|
||||||
|
PIByteArray rba(data);
|
||||||
|
uint _sign(0); rba >> _sign;
|
||||||
|
if (_sign != PIIntrospection::sign) return;
|
||||||
|
PIIntrospection::RequiredInfo ri;
|
||||||
|
rba >> ri;
|
||||||
PIChunkStream cs;
|
PIChunkStream cs;
|
||||||
cs.add(1, PIIntrospection::packInfo())
|
if (ri.types[PIIntrospection::itInfo])
|
||||||
.add(2, PIIntrospection::packContainers())
|
cs.add(PIIntrospection::itInfo, PIIntrospection::packInfo());
|
||||||
.add(3, PIIntrospection::packThreads())
|
if (ri.types[PIIntrospection::itContainers])
|
||||||
.add(4, PIIntrospection::packObjects());
|
cs.add(PIIntrospection::itContainers, PIIntrospection::packContainers());
|
||||||
|
if (ri.types[PIIntrospection::itThreads])
|
||||||
|
cs.add(PIIntrospection::itThreads, PIIntrospection::packThreads());
|
||||||
|
if (ri.types[PIIntrospection::itObjects])
|
||||||
|
cs.add(PIIntrospection::itObjects, PIIntrospection::packObjects());
|
||||||
PIByteArray ba;
|
PIByteArray ba;
|
||||||
ba << PIIntrospection::sign;
|
ba << PIIntrospection::sign;
|
||||||
ba.append(cs.data());
|
ba.append(cs.data());
|
||||||
send("__introspection_client__", ba);
|
send(from, ba);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,12 +44,11 @@ private:
|
|||||||
~PIIntrospectionServer();
|
~PIIntrospectionServer();
|
||||||
NO_COPY_CLASS(PIIntrospectionServer)
|
NO_COPY_CLASS(PIIntrospectionServer)
|
||||||
|
|
||||||
EVENT_HANDLER(void, timerEvent);
|
|
||||||
PIString genName();
|
PIString genName();
|
||||||
|
virtual void dataReceived(const PIString & from, const PIByteArray & data);
|
||||||
|
|
||||||
PRIVATE_DECLARATION
|
PRIVATE_DECLARATION
|
||||||
PITimer itimer;
|
PITimer itimer;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PIINTROSPECTION_SERVER_H
|
#endif // PIINTROSPECTION_SERVER_H
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ const uint PIIntrospection::sign = 0x0F1C2B3A;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PIIntrospection::RequiredInfo::RequiredInfo() {
|
||||||
|
types = itInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PIIntrospection::ProcessInfo::ProcessInfo() {
|
PIIntrospection::ProcessInfo::ProcessInfo() {
|
||||||
processorsCount = 0;
|
processorsCount = 0;
|
||||||
}
|
}
|
||||||
@@ -91,6 +96,27 @@ PIByteArray & operator <<(PIByteArray & s, const std::unordered_map<uint, PIIntr
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIByteArray & operator <<(PIByteArray & b, const PIIntrospection::RequiredInfo & v) {
|
||||||
|
PIChunkStream cs;
|
||||||
|
cs.add(1, v.types);
|
||||||
|
b << cs.data();
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIByteArray & operator >>(PIByteArray & b, PIIntrospection::RequiredInfo & v) {
|
||||||
|
PIByteArray csba; b >> csba;
|
||||||
|
PIChunkStream cs(csba);
|
||||||
|
while (!cs.atEnd()) {
|
||||||
|
switch (cs.read()) {
|
||||||
|
case 1: cs.get(v.types); break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PIByteArray & operator <<(PIByteArray & b, const PIIntrospection::ProcessInfo & v) {
|
PIByteArray & operator <<(PIByteArray & b, const PIIntrospection::ProcessInfo & v) {
|
||||||
PIChunkStream cs;
|
PIChunkStream cs;
|
||||||
cs.add(1, v.architecture).add(2, v.execCommand).add(3, v.execDateTime).add(4, v.hostname).add(5, v.OS_name)
|
cs.add(1, v.architecture).add(2, v.execCommand).add(3, v.execDateTime).add(4, v.hostname).add(5, v.OS_name)
|
||||||
|
|||||||
@@ -30,6 +30,18 @@
|
|||||||
class PIIntrospection {
|
class PIIntrospection {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
enum InfoTypes {
|
||||||
|
itInfo = 0x01,
|
||||||
|
itContainers = 0x02,
|
||||||
|
itObjects = 0x04,
|
||||||
|
itThreads = 0x08,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RequiredInfo {
|
||||||
|
RequiredInfo();
|
||||||
|
PIFlags<InfoTypes> types;
|
||||||
|
};
|
||||||
|
|
||||||
struct ProcessInfo {
|
struct ProcessInfo {
|
||||||
ProcessInfo();
|
ProcessInfo();
|
||||||
|
|
||||||
@@ -70,6 +82,9 @@ public:
|
|||||||
|
|
||||||
PIByteArray & operator <<(PIByteArray & s, const std::unordered_map<uint, PIIntrospectionContainers::Type> & v);
|
PIByteArray & operator <<(PIByteArray & s, const std::unordered_map<uint, PIIntrospectionContainers::Type> & v);
|
||||||
|
|
||||||
|
PIByteArray & operator <<(PIByteArray & b, const PIIntrospection::RequiredInfo & v);
|
||||||
|
PIByteArray & operator >>(PIByteArray & b, PIIntrospection::RequiredInfo & v);
|
||||||
|
|
||||||
PIByteArray & operator <<(PIByteArray & b, const PIIntrospection::ProcessInfo & v);
|
PIByteArray & operator <<(PIByteArray & b, const PIIntrospection::ProcessInfo & v);
|
||||||
PIByteArray & operator >>(PIByteArray & b, PIIntrospection::ProcessInfo & v);
|
PIByteArray & operator >>(PIByteArray & b, PIIntrospection::ProcessInfo & v);
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#include "piintrospection_threads.h"
|
#include "piintrospection_threads.h"
|
||||||
#include "piintrospection_threads_p.h"
|
#include "piintrospection_threads_p.h"
|
||||||
|
|
||||||
|
__PIINTROSPECTION_SINGLETON_CPP__(Threads)
|
||||||
|
|
||||||
|
|
||||||
PIIntrospectionThreadsInterface::PIIntrospectionThreadsInterface() {
|
PIIntrospectionThreadsInterface::PIIntrospectionThreadsInterface() {
|
||||||
p = new PIIntrospectionThreads();
|
p = new PIIntrospectionThreads();
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class PIIntrospectionThreads;
|
|||||||
class PIP_EXPORT PIIntrospectionThreadsInterface {
|
class PIP_EXPORT PIIntrospectionThreadsInterface {
|
||||||
friend class PIIntrospection;
|
friend class PIIntrospection;
|
||||||
public:
|
public:
|
||||||
__PIINTROSPECTION_SINGLETON__(Threads)
|
__PIINTROSPECTION_SINGLETON_H__(Threads)
|
||||||
|
|
||||||
void threadNew (PIThread * t);
|
void threadNew (PIThread * t);
|
||||||
void threadDelete (PIThread * t);
|
void threadDelete (PIThread * t);
|
||||||
|
|||||||
Reference in New Issue
Block a user