-// Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2016 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
using namespace YACS::ENGINE;
using namespace std;
+const char SalomeContainer::KIND[]="Salome";
+
+const char SalomeContainer::TYPE_PROPERTY_STR[]="type";
+
SalomeContainer::SalomeContainer():_launchModeType(new SalomeContainerMonoHelper),_shutdownLevel(999)
{
}
{
}
-SalomeContainer::SalomeContainer(const Container& other, const SalomeContainerTools& sct, SalomeContainerHelper *lmt,
+SalomeContainer::SalomeContainer(const Container& other, const SalomeContainerTools& sct, const SalomeContainerHelper *lmt,
const std::vector<std::string>& componentNames, int shutdownLev):Container(other),_componentNames(componentNames),
- _launchModeType(lmt),_shutdownLevel(shutdownLev),_sct(sct)
+ _launchModeType(const_cast<SalomeContainerHelper *>(lmt)),_shutdownLevel(shutdownLev),_sct(sct)
{
if(lmt)
lmt->incrRef();
_mutex.unLock();
}
+std::string SalomeContainer::getKind() const
+{
+ return KIND;
+}
+
Container *SalomeContainer::clone() const
{
if(_isAttachedOnCloning)
void SalomeContainer::setProperty(const std::string& name, const std::string& value)
{
- if (name == "type")
+ if (name == AOC_ENTRY)
+ {
+ std::istringstream iss(value);
+ int val;
+ iss >> val;
+ setAttachOnCloningStatus((bool)val);
+ }
+ else if (name == TYPE_PROPERTY_STR)
{
if (value == SalomeContainerMonoHelper::TYPE_NAME)
{
}
else
throw Exception("SalomeContainer::setProperty : type value is not correct (mono or multi): " + value);
- return ;
}
_sct.setProperty(name,value);
}
std::string SalomeContainer::getProperty(const std::string& name) const
{
+ if (name == TYPE_PROPERTY_STR)
+ return _launchModeType->getType();
+ if (name==AOC_ENTRY)
+ {
+ int reti(_isAttachedOnCloning);
+ std::ostringstream oss; oss << reti;
+ return oss.str();
+ }
return _sct.getProperty(name);
}