git-svn-id: svn://db.shs.com.ru/libs@1 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
2015-02-28 21:28:53 +00:00
commit ba8bc27298
2358 changed files with 336795 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]