#include "SALOME_KernelServices.hxx"
+#include <map>
+
+std::map<std::string,CORBA::Object_var> _compo_map;
+
namespace KERNEL {
/**
es.text = CORBA::string_dup(text);
return SALOME::SALOME_Exception(es);
}
-
+
+ void RegisterCompo(const std::string& compoName, CORBA::Object_var compoPtr)
+ {
+ _compo_map[compoName] = compoPtr;
+ }
+
+ CORBA::Object_var RetrieveCompo(const std::string& compoName)
+ {
+ auto it = _compo_map.find(compoName);
+ if( it != _compo_map.end() )
+ {
+ return (*it).second;
+ }
+ else
+ {
+ SALOME::SALOME_Exception ex(createSalomeException("RetrieveCompo : not implemented yet !"));
+ throw ex;
+ //GetLCC()->FindOrLoad_Component( "FactoryServer", compoName );
+ }
+ }
}
KERNELHELPERS_EXPORT CORBA::Object_ptr SObjectToObject(SALOMEDS::SObject_ptr);
-
+ KERNELHELPERS_EXPORT void RegisterCompo(const std::string& compoName, CORBA::Object_var compoPtr);
+ KERNELHELPERS_EXPORT CORBA::Object_var RetrieveCompo(const std::string& compoName);
/*!
* This template function provides you with the servant (CORBA
* object narrowed to its interface) corresponding to the specified