git-svn-id: svn://db.shs.com.ru/pip@6 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2015-02-28 18:37:44 +00:00
parent 02fdf8b415
commit 0891d1ba2d
319 changed files with 10557 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
#include "pip.h"
//! [main]
class ElementA: public PIObject {
PIOBJECT(ElementA)
// ...
};
ADD_NEW_TO_COLLECTION(ab_group, ElementA)
class ElementB: public PIObject {
PIOBJECT(ElementB)
// ...
};
ADD_NEW_TO_COLLECTION(ab_group, ElementB)
class ElementC: public PIObject {
PIOBJECT(ElementC)
// ...
};
ADD_NEW_TO_COLLECTION(c_group, ElementC)
class ElementD: public PIObject {
PIOBJECT(ElementD)
// ...
};
int main() {
ElementD * el_d = new ElementD();
ADD_TO_COLLECTION(ab_group, el_d)
PIStringList gl = PICollection::groups();
piCout << gl; // {"ab_group", "c_group"}
piForeachC (PIString g, gl) {
PIVector<const PIObject * > go = PICollection::groupElements(g);
piCout << "group" << g << ":";
piForeachC (PIObject * o, go)
piCout << Tab << o->className();
}
/*
group ab_group :
ElementA
ElementB
ElementD
group c_group :
ElementC
*/
};
//! [main]