Пример #1
0
Var::operator CLOB () const
{
	VarHolder* pHolder = content();

	if (!pHolder)
		throw InvalidAccessException("Can not convert empty value.");

	if (typeid(CLOB) == pHolder->type())
		return extract<CLOB>();
	else
	{
		std::string result;
		pHolder->convert(result);
		return CLOB(result);
	}
}
Пример #2
0
Var::operator Time () const
{
	VarHolder* pHolder = content();

	if (!pHolder)
		throw InvalidAccessException("Can not convert empty value.");

	if (typeid(Time) == pHolder->type())
		return extract<Time>();
	else
	{
		Poco::DateTime result;
		pHolder->convert(result);
		return Time(result);
	}
}
Пример #3
0
Var::operator BLOB () const
{
	VarHolder* pHolder = content();

	if (!pHolder)
		throw InvalidAccessException("Can not convert empty value.");

	if (typeid(BLOB) == pHolder->type())
		return extract<BLOB>();
	else
	{
		std::string result;
		pHolder->convert(result);
		return BLOB(reinterpret_cast<const unsigned char*>(result.data()),
			result.size());
	}
}
Пример #4
0
 DocumentDBConfig::SP getDocumentDBConfig(const vespalib::string &name)
 {
     auto snapshot = _config.get();
     auto &dbcs = snapshot->getDocumentDBConfigs();
     auto dbitr = dbcs.find(DocTypeName(name));
     if (dbitr != dbcs.end()) {
         return dbitr->second;
     } else {
         return DocumentDBConfig::SP();
     }
 }
Пример #5
0
 BootstrapConfig::SP getBootstrapConfig() {
     auto snapshot = _config.get();
     return snapshot->getBootstrapConfig();
 }
Пример #6
0
 virtual void reconfigure(std::shared_ptr<ProtonConfigSnapshot> cfg) override {
     std::lock_guard<std::mutex> guard(_mutex);
     _config.set(cfg);
     _configured = true;
 }