How can I manage several assemblies in the same application?

CrossNet makes it very easy for you.

First the interface and object IDs (unique identifier for RTTI) are generated dynamically, so you won't have any collision with this.

Once you have all your assemblies generated, just include your assembly headers in the same order as their dependencies.
First include the base assembly header, then the assembly on top of it, etc... You can use as many assemblies as you want.

To initialize the assemblies, just call their Setup in the same order, and when you are done executing your script,
call the teardown in the inverse order.

So for example (with crossnet:unittest2 being built on top of crossnetunittest1):

#include "CrossNetSystem/CrossNetSystem.h"
#include "crossnetunittest1_method_definition.cpp"
#include "crossnetunittest2_method_definition.cpp"

void Run()
{
CrossNetRuntime::Setup(initOptions);
CrossNetRuntime::GCManager::SetTopOfStack();
crossnetunittest1__Setup();
crossnetunittest2__Setup();
CrossNetUnitTest2::Main::MainTest();
crossnetunittest2__Teardown();
crossnetunittest1__Teardown();
CrossNetRuntime::Teardown();
}

If you have several cpp files, you can include the class_definition_file.h anywhere. Obviously make sure to include the method_definition.cpp file somewhere one time and one time only.

Last edited Aug 31, 2007 at 5:55 AM by OlivierNallet, version 1

Comments

No comments yet.