本文整理汇总了C++中ObjectFactory::find_aggregate_meta_class方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectFactory::find_aggregate_meta_class方法的具体用法?C++ ObjectFactory::find_aggregate_meta_class怎么用?C++ ObjectFactory::find_aggregate_meta_class使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectFactory
的用法示例。
在下文中一共展示了ObjectFactory::find_aggregate_meta_class方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void TestObjectFactory::init( SuifEnv* suif ) {
_object_factory = suif->get_object_factory();
ObjectFactory *of = _object_factory;
MetaClass* intMetaClass = of->lookupMetaClass("int");
assert( intMetaClass );
AggregateMetaClass* meta_SuifObject = of->find_aggregate_meta_class(SuifObject::get_class_name());
AggregateMetaClass* testX = 0;
testX = of->create_object_meta_class( TestX::get_class_name(),
sizeof( TestX ),
TestX::constructorFunction,
meta_SuifObject );
PointerMetaClass* owningPointerToTestX = of->get_pointer_meta_class( testX, true );
testX-> add_field_description( "i", intMetaClass, OFFSETOF(TestX,i) );
testX-> add_field_description( "x1", owningPointerToTestX, OFFSETOF(TestX,x1) );
testX-> add_field_description( "x2", owningPointerToTestX, OFFSETOF(TestX,x2) );
STLMetaClass* meta_TestX_vector =of-> get_stl_meta_class("LIST:suif_vector<TestX*>",
new STLDescriptor< suif_vector<TestX*> >( owningPointerToTestX ) );
PointerMetaClass* meta_TestX_owner = of->get_pointer_meta_class(meta_TestX_vector,true,true);
testX-> add_field_description( "_vector", meta_TestX_owner, OFFSETOF(TestX,_vector) );
testX->add_virtual_field( "int", "i" );
testX->add_virtual_field( "pointers", "x1;x2" );
testX->add_virtual_field( "TestX", "x1/*;x2/*" );
testX->add_virtual_field( "int-indirect", "i;x1/i;x2/i" );
testX->add_virtual_field( "vectorPtr", "_vector" );
testX->add_virtual_field( "vector", "_vector/*" );
testX->add_virtual_field( "vectorContents", "_vector/*/*" );
// ------------ make meta class for TestY -------------
AggregateMetaClass* testY = 0;
testY = of->create_object_meta_class( TestY::get_class_name(),
sizeof( TestY ),
TestY::constructorFunction,
testX );
testY-> add_field_description( "x3", owningPointerToTestX, OFFSETOF(TestY,x3) );
testY->add_virtual_field( "int", "i" );
testY->add_virtual_field( "pointers", "^;x3" );
testY->add_virtual_field( "TestX", "^;x3/*" );
}