示例#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
文件: Time.cpp 项目: Kampbell/poco
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());
	}
}
 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();
     }
 }
 BootstrapConfig::SP getBootstrapConfig() {
     auto snapshot = _config.get();
     return snapshot->getBootstrapConfig();
 }
 virtual void reconfigure(std::shared_ptr<ProtonConfigSnapshot> cfg) override {
     std::lock_guard<std::mutex> guard(_mutex);
     _config.set(cfg);
     _configured = true;
 }