Пример #1
0
// Serialize the current Log::Level of Channel objects and return them as a Config instance
Config::Ptr Manager::getChannelConfig(void) {
    Config::Ptr ConfigPtr(new Config("ChannelConfig"));

    Channel::Map::const_iterator iChannel;
    for (iChannel  = mChannelMap.begin();
         iChannel != mChannelMap.end();
         ++iChannel) {
        ConfigPtr->setValue(iChannel->first.c_str(), Log::toString(iChannel->second->getLevel()));
    }

    return ConfigPtr;
}
Пример #2
0
void LayeredConfiguration::add(AbstractConfiguration* pConfig, int priority, bool writeable, bool shared)
{
	ConfigItem item;
	item.pConfig   = ConfigPtr(pConfig, shared);
	item.priority  = priority;
	item.writeable = writeable;
	
	ConfigList::iterator it = _configs.begin();
	while (it != _configs.end() && it->priority < priority)
		++it;
		
	_configs.insert(it, item);
}