Container as remote parameter

Input parameters to GetListOfMeshes are then declared as:
InGetListOfMeshes *inParams = new(ma)InGetListOfMeshes(ma, NULL);
And the input parameter values are set :
inParams->analysisID->putString((char*)analysisID.data());
inParams->timeStep->putReal(timeStep);

In the example a wrapper around edmiRemoteExecuteCppMethod, ExecuteRemoteCppMethod is used. Therefore will a call to GetListOfMeshes on the EDM application server look like:
RvGetListOfMeshes *retVal = new(ma)RvGetListOfMeshes(ma, NULL);
ExecuteRemoteCppMethod(repository, model, "GetListOfMeshes", inParams, retVal);
Within the C++ plug-in the dll_main method will look like the following:
extern "C" EDMLONG __declspec(dllexport) dll_main(
char *repositoryName,
char *modelName,
char *methodName,
EDMLONG nOfParameters,
cppRemoteParameter *parameters,
EDMLONG nOfReturnValues,
cppRemoteParameter *returnValues,
void **threadObject)
{
Below the code within the main switch within dll_main is shown. At his time in the execution the correct EDM model is opened, a memory allocator "ma" is created and the main plug-in object is ready to execute the GetListOfMeshes method. We also see that objects referring input parameters and return values are created. They are convenient wrappers around the actual parameters transferred from client program and buffers for return values.
if (strEQL(methodName, "GetListOfMeshes")) {
RvGetListOfMeshes *results = new(ma)RvGetListOfMeshes(NULL, returnValues);
InGetListOfMeshes *inParams = new(ma)InGetListOfMeshes(NULL, parameters);
rstat = plugin->GetListOfMeshes(modelId, inParams, results);

The next step is the code that retrieves mesh information from the database and moves it to mesh info records in the mesh info container. The mesh info container is declared:
Container<MeshInfo> *meshContainer = new(ma)Container<MeshInfo>(ma);

For all meshes within the specified analysis and time step within the specified EDM model the following is code applies. The fem::mesh pointer mesh is a pointer to the database object that holds information about the mesh and it is an attribute in time step database object.
fem::Mesh *mesh = ts->get_mesh();

For each mesh a new mesh info record is created in the mesh info container by createNext().
MeshInfo *mi = meshContainer->createNext();

Then the mesh information is moved into the mesh info record.
strcpy(mi->name, mesh->get_name());
mi->nElements = mesh->get_elements()->size();
mi->nVertices = mesh->get_nodes()->size();

When all mesh info records are created the time has come for return to client program. Then set return values:
retVal->mesh_info_list->putContainer(meshContainer);
retVal>status>putString("OK");
retVal>report>putString("");

When the client program get the return values from the server and the status return value is equal to "OK", it can create a container that takes its content from the buffers that are returned from the server.
Container<MeshInfo> *meshInfos;
meshInfos = new(ma)Container<MeshInfo>(ma, retVal->mesh_info_list);
Then the container can be handled as it was created locally. For example if the mesh information shall be written to file, it can look like this:
MeshInfo *mi = meshInfos->firstp();
while (mi) {
mi = meshInfos->nextp();
printf(filep, "%s, %Ul, %ul\n", mi->name, mi->n_elements, mi-> vertices);
}