Changeset - ce67e1623fee
[Not reviewed]
0 2 0
HanzZ - 13 years ago 2012-04-30 14:13:56
hanzz.k@gmail.com
Fixed unhandled exception when admin_jid is not set
2 files changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
include/transport/config.h
Show inline comments
 
@@ -25,19 +25,19 @@
 
#include <boost/format.hpp>
 
#include <boost/algorithm/string.hpp>
 
#include <boost/assign.hpp>
 
#include <boost/bind.hpp>
 
#include <boost/signal.hpp>
 

	
 

	
 
#define CONFIG_HAS_KEY(PTR, KEY) (*PTR).hasKey(KEY)
 
#define CONFIG_STRING(PTR, KEY) (*PTR)[KEY].as<std::string>()
 
#define CONFIG_INT(PTR, KEY) (*PTR)[KEY].as<int>()
 
#define CONFIG_BOOL(PTR, KEY) (*PTR)[KEY].as<bool>()
 
#define CONFIG_LIST(PTR, KEY) (*PTR)[KEY].as<std::list<std::string> >()
 
#define CONFIG_VECTOR(PTR, KEY) (*PTR)[KEY].as<std::vector<std::string> >()
 
#define CONFIG_HAS_KEY(PTR, KEY) (*PTR).hasKey(KEY)
 
#define CONFIG_VECTOR(PTR, KEY) ((*PTR).hasKey(KEY) ? (*PTR)[KEY].as<std::vector<std::string> >() : std::vector<std::string>())
 

	
 

	
 
namespace Transport {
 

	
 
/// Represents variable:value pairs.
 
typedef boost::program_options::variables_map Variables;
 

	
spectrum_manager/src/managerconfig.h
Show inline comments
 
@@ -65,12 +65,16 @@ class ManagerConfig {
 
		/// For variables in sections you can use "section.variable" key format.
 
		/// \param key config variable name
 
		const boost::program_options::variable_value &operator[] (const std::string &key) {
 
			return m_variables[key];
 
		}
 

	
 
		bool hasKey(const std::string &key) {
 
			return m_variables.find(key) != m_variables.end();
 
		}
 

	
 
		/// Returns path to config file from which data were loaded.
 
		const std::string &getManagerConfigFile() { return m_file; }
 

	
 
		/// This signal is emitted when config is loaded/reloaded.
 
		boost::signal<void ()> onManagerConfigReloaded;
 
	
0 comments (0 inline, 0 general)