43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
#include "pip.h"
|
|
|
|
class A: public PIObject {
|
|
PIOBJECT(A)
|
|
public:
|
|
EVENT_HANDLER1(void, eh, PIByteArray, i) {piCout << "eh" << i.toHex();}
|
|
};
|
|
|
|
class B: public PIObject {
|
|
PIOBJECT(B)
|
|
public:
|
|
EVENT2(eh, PIByteArray, i, PIString, str);
|
|
};
|
|
|
|
template <typename S, typename T, typename std::enable_if<
|
|
std::is_same<T, PIVector<S>>::value
|
|
, int>::type = 0> PIVector<S> rrr(PIVector<T>) {
|
|
piCout << std::is_same<T, PIVector<S>>::value;
|
|
return PIVector<S>();
|
|
}
|
|
|
|
|
|
int main() {
|
|
A a;
|
|
B b;
|
|
CONNECTU_QUEUED(&b, eh, &a, eh, &a);
|
|
b.eh(PIByteArray::fromHex("102030"), "str");
|
|
a.maybeCallQueuedEvents();
|
|
/*PIDeque<int> x;
|
|
x.resize(16, [](size_t i) {return i+1;});
|
|
piCout << x;
|
|
PIDeque<PIDeque<int>> m = x.reshape(2,8);
|
|
piCout << m;
|
|
piCout << x.reshape(4,4,PIDeque<int>::byColumn);
|
|
piCout << x.reshape(2,8);
|
|
piCout << x.reshape(2,8,PIDeque<int>::byColumn);
|
|
PIDeque<int> y;
|
|
y = m.reshape<int>();
|
|
piCout << y;
|
|
piCout << m.reshape<int>(PIDeque<int>::byColumn);*/
|
|
return 0;
|
|
}
|