コード例 #1
0
ファイル: Logger.cpp プロジェクト: diverger/dnp3
	Logger* Logger::GetSubLogger(std::string aSubName, int aFilterBits)
	{
		std::ostringstream oss;
		oss << mName << "." << aSubName;
		Logger* pLogger = mpLog->GetLogger(LEV_WARNING, oss.str());
		pLogger->SetVarName(mVarName);
		pLogger->mLevel = aFilterBits;
		return pLogger;
	}
コード例 #2
0
ファイル: AsyncStackManager.cpp プロジェクト: diverger/dnp3
IDataObserver* AsyncStackManager::AddSlave( const std::string& arPortName, const std::string& arStackName, FilterLevel aLevel, ICommandAcceptor* apCmdAcceptor,
											const SlaveStackConfig& arCfg)
{
	Port* pPort = this->AllocatePort(arPortName);
	Logger* pLogger = mpLogger->GetSubLogger(arStackName, aLevel);
	pLogger->SetVarName(arStackName);
	SlaveStack* pSlave = new SlaveStack(pLogger, &mTimerSrc, apCmdAcceptor, arCfg);	
	this->OnAddStack(arStackName, pSlave, pPort, arCfg.link.LocalAddr);
	return pSlave->mSlave.GetDataObserver();
}
コード例 #3
0
ファイル: AsyncStackManager.cpp プロジェクト: diverger/dnp3
ICommandAcceptor* AsyncStackManager::AddMaster( const std::string& arPortName, const std::string& arStackName, FilterLevel aLevel, IDataObserver* apPublisher,
											    const MasterStackConfig& arCfg)
{
	Port* pPort = this->AllocatePort(arPortName);
	Logger* pLogger = mpLogger->GetSubLogger(arStackName, aLevel);
	pLogger->SetVarName(arStackName);
	MasterStack* pMaster = new MasterStack(pLogger, &mTimerSrc, apPublisher, pPort->GetGroup(), arCfg);	
	this->OnAddStack(arStackName, pMaster, pPort, arCfg.link.LocalAddr);
	return pMaster->mMaster.GetCmdAcceptor();
}