本文整理汇总了C++中Simulator::CreateObject方法的典型用法代码示例。如果您正苦于以下问题:C++ Simulator::CreateObject方法的具体用法?C++ Simulator::CreateObject怎么用?C++ Simulator::CreateObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simulator
的用法示例。
在下文中一共展示了Simulator::CreateObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
void IonChannel::Load(CStdXml &oXml, RealisticNeuralModule *lpNS)
{
Simulator *lpSim = lpNS->GetSimulator();
if(!lpSim)
THROW_ERROR(Al_Err_lSimulationNotDefined, Al_Err_strSimulationNotDefined);
oXml.IntoElem(); //Into IonChannel Element
m_strID = oXml.GetChildString("ID");
m_strName = oXml.GetChildString("Name", "");
m_bEnabled = oXml.GetChildBool("Enabled", m_bEnabled);
m_fltGmax = oXml.GetChildFloat("Gmax");
m_fltMPower = oXml.GetChildFloat("MPower");
m_fltHPower = oXml.GetChildFloat("HPower");
m_fltEquilibriumPotential = oXml.GetChildFloat("EqPot");
m_fltM = oXml.GetChildFloat("Minit");
m_fltNm = oXml.GetChildFloat("Nm");
//Load Minf
oXml.IntoChildElement("Minf");
string strModuleName = oXml.GetChildString("ModuleName", "");
string strType = oXml.GetChildString("Type");
oXml.OutOfElem(); //OutOf Gain Element
m_lpMinf = dynamic_cast<AnimatLibrary::Gains::Gain *>(lpSim->CreateObject(strModuleName, "Gain", strType));
if(!m_lpMinf)
THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType, "Gain");
m_lpMinf->Load(oXml);
//Load Tm
oXml.IntoChildElement("Tm");
strModuleName = oXml.GetChildString("ModuleName", "");
strType = oXml.GetChildString("Type");
oXml.OutOfElem(); //OutOf Gain Element
m_lpTm = dynamic_cast<AnimatLibrary::Gains::Gain *>(lpSim->CreateObject(strModuleName, "Gain", strType));
if(!m_lpTm)
THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType, "Gain");
m_lpTm->Load(oXml);
m_fltH = oXml.GetChildFloat("Hinit");
m_fltNh = oXml.GetChildFloat("Nh");
//Load Hinf
oXml.IntoChildElement("Hinf");
strModuleName = oXml.GetChildString("ModuleName", "");
strType = oXml.GetChildString("Type");
oXml.OutOfElem(); //OutOf Gain Element
m_lpHinf = dynamic_cast<AnimatLibrary::Gains::Gain *>(lpSim->CreateObject(strModuleName, "Gain", strType));
if(!m_lpHinf)
THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType, "Gain");
m_lpHinf->Load(oXml);
//Load Th
oXml.IntoChildElement("Th");
strModuleName = oXml.GetChildString("ModuleName", "");
strType = oXml.GetChildString("Type");
oXml.OutOfElem(); //OutOf Gain Element
m_lpTh = dynamic_cast<AnimatLibrary::Gains::Gain *>(lpSim->CreateObject(strModuleName, "Gain", strType));
if(!m_lpTh)
THROW_TEXT_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType, "Gain");
m_lpTh->Load(oXml);
oXml.OutOfElem(); //OutOf IonChannel Element
}