64 throw Exception(
"Runtime is not yet initialized");
88 _builtinCatalog =
new Catalog(
"builtins");
89 std::map<std::string,TypeCode*>& typeMap=_builtinCatalog->_typeMap;
110 char* valenv=getenv(
"YACS_TRACELEVEL");
113 std::istringstream iss(valenv);
120 char *maxThreadStr = getenv(
"YACS_MAX_THREADS");
121 if (maxThreadStr != NULL)
123 int maxThreads = atoi(maxThreadStr);
124 DEBTRACE(
"maxThreads = " << maxThreads);
129 char *threadStackSizeStr = getenv(
"YACS_THREADS_STACK_SIZE");
130 if (threadStackSizeStr != NULL)
132 size_t threadStackSize = strtoul(threadStackSizeStr, NULL, 0);
133 DEBTRACE(
"threadStackSize = " << threadStackSize);
145 delete _builtinCatalog;
156 for(std::vector<Catalog *>::iterator it=_catalogs.begin();it !=_catalogs.end();it++)
163 std::list<TypeCodeObjref *> ltc)
169 const std::string& name,
182 throw Exception(
"InDataNode factory not implemented");
187 throw Exception(
"OutDataNode factory not implemented");
192 throw Exception(
"FuncNode factory not implemented");
197 throw Exception(
"ScriptNode factory not implemented");
202 throw Exception(
"RefNode factory not implemented");
207 throw Exception(
"CompoNode factory not implemented");
212 throw Exception(
"SInlineNode factory not implemented");
216 const std::string& kind)
218 throw Exception(
"ComponentInstance factory not implemented");
223 throw Exception(
"Container factory not implemented");
228 return new Proc(name);
233 return new Bloc(name);
264 const std::string& kind,
Proc * procForTypes)
266 return new OptimizerLoop(name,algLib,factoryName,algInitOnFile,
true, procForTypes);
287 if (_catalogLoaderFactoryMap.find(sourceKind) == _catalogLoaderFactoryMap.end())
289 throw Exception(
"This type of catalog loader does not exist: " + sourceKind);
295 proto->
load(cata,path);
307 _catalogLoaderFactoryMap[name]=factory;
316 return _builtinCatalog;
325 _catalogs.push_back(catalog);
335 if (_builtinCatalog->_typeMap.count(name) != 0)
336 return _builtinCatalog->_typeMap[name];
337 for(std::vector<Catalog *>::const_iterator it=_catalogs.begin();it !=_catalogs.end();it++)
339 if ((*it)->_typeMap.count(name) != 0)
340 return (*it)->_typeMap[name];
357 throw Exception(
"convertNeutral is not implemented by your runtime");
371 throw Exception(
"convertNeutralAsString is not implemented by your runtime");
: Interface for management of storage of data formated dynamically in its TypeCode....
Composed node to group elementary and composed nodes.
class for YACS catalog loader.
virtual void load(Catalog *cata, const std::string &path)
Base class for all component instances.
Class for data parameters specification.
InputPort * edGetNbOfBranchesPort()
static size_t _threadStackSize
Loop node for parametric calculation.
Class for calculation node (function) inlined (and executed) in the schema.
Class for calculation node (script) inlined (and executed) in the schema.
Base class for all nodes.
class to build optimization loops
Base class for all schema objects.
static unsigned int _totalCnt
Catalog * getBuiltinCatalog()
Get the catalog of base nodes (elementary and composed)
static const char RUNTIME_ENGINE_INTERACTION_IMPL_NAME[]
virtual ServiceNode * createRefNode(const std::string &kind, const std::string &name)
virtual OptimizerLoop * createOptimizerLoop(const std::string &name, const std::string &algLib, const std::string &factoryName, bool algInitOnFile, const std::string &kind="", Proc *procForTypes=NULL)
static YACS::ENGINE::TypeCode * _tc_double
virtual InlineFuncNode * createFuncNode(const std::string &kind, const std::string &name)
virtual std::string convertNeutralAsString(TypeCode *type, Any *data)
Convert a YACS::ENGINE::Any object to a string to be used in GUI for example.
virtual Switch * createSwitch(const std::string &name)
virtual void addCatalog(Catalog *catalog)
Add a catalog of types and nodes to the runtime.
virtual InputDataStreamPort * createInputDataStreamPort(const std::string &name, Node *node, TypeCode *type)
static YACS::ENGINE::TypeCode * _tc_bool
virtual ForLoop * createForLoop(const std::string &name)
virtual ServiceInlineNode * createSInlineNode(const std::string &kind, const std::string &name)
virtual InlineNode * createScriptNode(const std::string &kind, const std::string &name)
virtual DataNode * createOutDataNode(const std::string &kind, const std::string &name)
virtual Container * createContainer(const std::string &kind="")
virtual TypeCode * getTypeCode(const std::string &name)
Get a typecode by its name from runtime catalogs.
virtual TypeCode * createInterfaceTc(const std::string &id, const std::string &name, std::list< TypeCodeObjref * > ltc)
virtual ForEachLoop * createForEachLoop(const std::string &name, TypeCode *type)
virtual Bloc * createBloc(const std::string &name)
virtual Catalog * loadCatalog(const std::string &sourceKind, const std::string &path)
Load a catalog of calculation to use as factory.
virtual TypeCode * createSequenceTc(const std::string &id, const std::string &name, TypeCode *content)
virtual OutputDataStreamPort * createOutputDataStreamPort(const std::string &name, Node *node, TypeCode *type)
virtual void setCatalogLoaderFactory(const std::string &name, CatalogLoader *factory)
Add a catalog loader factory to the map _catalogLoaderFactoryMap under the name name.
virtual DataNode * createInDataNode(const std::string &kind, const std::string &name)
virtual Proc * createProc(const std::string &name)
virtual ForEachLoopDyn * createForEachLoopDyn(const std::string &name, TypeCode *type)
static YACS::ENGINE::TypeCode * _tc_file
virtual ServiceNode * createCompoNode(const std::string &kind, const std::string &name)
static Runtime * _singleton
virtual TypeCodeStruct * createStructTc(const std::string &id, const std::string &name)
static YACS::ENGINE::TypeCode * _tc_propvec
virtual void removeRuntime()
virtual ComponentInstance * createComponentInstance(const std::string &name, const std::string &kind="")
static YACS::ENGINE::TypeCode * _tc_int
static YACS::ENGINE::TypeCode * _tc_stringpair
virtual WhileLoop * createWhileLoop(const std::string &name)
static YACS::ENGINE::TypeCode * _tc_string
virtual void * convertNeutral(TypeCode *type, Any *data)
Convert a YACS::ENGINE::Any object to an external object with type type.
Class for calculation node associated with a component service.
Control node that emulates the C switch.
Class for reference objects.
Class for sequence objects.
virtual void addMember(const std::string &name, TypeCode *tc)
The only non const method.
Base class for all type objects.
static TypeCode * interfaceTc(const char *id, const char *name)
static factory of object reference type given an id and a name
static TypeCode * sequenceTc(const char *id, const char *name, TypeCode *content)
static factory of sequence type given an id, a name and a content type
static TypeCode * structTc(const char *id, const char *name)
static factory of struct type given an id and a name
YACSLIBENGINE_EXPORT Runtime * getRuntime()