mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 13:47:10 +01:00
removed std::pair binding/extraction (not needed)
This commit is contained in:
@@ -1350,120 +1350,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class K, class V>
|
|
||||||
class Binding<std::pair<K, V> >: public AbstractBinding
|
|
||||||
/// Specialization for std::multimap.
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit Binding(std::pair<K, V>& val,
|
|
||||||
const std::string& name = "",
|
|
||||||
Direction direction = PD_IN):
|
|
||||||
AbstractBinding(name, direction),
|
|
||||||
_val(val),
|
|
||||||
_bound(false)
|
|
||||||
/// Creates the Binding.
|
|
||||||
{
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
~Binding()
|
|
||||||
/// Destroys the Binding.
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t numOfColumnsHandled() const
|
|
||||||
{
|
|
||||||
return TypeHandler<K>::size() + TypeHandler<V>::size();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t numOfRowsHandled() const
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool canBind() const
|
|
||||||
{
|
|
||||||
return !_bound;
|
|
||||||
}
|
|
||||||
|
|
||||||
void bind(std::size_t pos)
|
|
||||||
{
|
|
||||||
poco_assert_dbg(getBinder() != 0);
|
|
||||||
poco_assert_dbg(canBind());
|
|
||||||
TypeHandler<K>::bind(pos, _val.first, getBinder(), getDirection());
|
|
||||||
TypeHandler<V>::bind(pos+1, _val.second, getBinder(), getDirection());
|
|
||||||
_bound = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void reset()
|
|
||||||
{
|
|
||||||
_bound = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::pair<K, V>& _val;
|
|
||||||
bool _bound;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <class K, class V>
|
|
||||||
class CopyBinding<std::pair<K, V> >: public AbstractBinding
|
|
||||||
/// Specialization for std::multimap.
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit CopyBinding(std::pair<K, V>& val,
|
|
||||||
const std::string& name = "",
|
|
||||||
Direction direction = PD_IN):
|
|
||||||
AbstractBinding(name, direction),
|
|
||||||
_pVal(new std::pair<K, V>(val)),
|
|
||||||
_bound(false)
|
|
||||||
/// Creates the Binding.
|
|
||||||
{
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
~CopyBinding()
|
|
||||||
/// Destroys the Binding.
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t numOfColumnsHandled() const
|
|
||||||
{
|
|
||||||
return TypeHandler<K>::size() + TypeHandler<V>::size();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t numOfRowsHandled() const
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool canBind() const
|
|
||||||
{
|
|
||||||
return !_bound;
|
|
||||||
}
|
|
||||||
|
|
||||||
void bind(std::size_t pos)
|
|
||||||
{
|
|
||||||
poco_assert_dbg(getBinder() != 0);
|
|
||||||
poco_assert_dbg(canBind());
|
|
||||||
TypeHandler<K>::bind(pos, _pVal->first, getBinder(), getDirection());
|
|
||||||
TypeHandler<V>::bind(pos+1, _pVal->second, getBinder(), getDirection());
|
|
||||||
_bound = true;;
|
|
||||||
}
|
|
||||||
|
|
||||||
void reset()
|
|
||||||
{
|
|
||||||
_bound = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef typename TypeWrapper<std::pair<K, V> >::TYPE ValueType;
|
|
||||||
SharedPtr<ValueType> _pVal;
|
|
||||||
bool _bound;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
namespace Keywords {
|
namespace Keywords {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -764,61 +764,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class K, class V>
|
|
||||||
class Extraction<std::pair<K, V> >: public AbstractExtraction
|
|
||||||
/// Map Data Type specialization for extraction of values from a query result set.
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Extraction(std::pair<K, V>& result, const Position& pos = Position(0)):
|
|
||||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
|
||||||
_rResult(result),
|
|
||||||
_default()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Extraction(std::pair<K, V>& result, const std::pair<K, V>& def, const Position& pos = Position(0)):
|
|
||||||
AbstractExtraction(Limit::LIMIT_UNLIMITED, pos.value()),
|
|
||||||
_rResult(result),
|
|
||||||
_default(def)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
~Extraction()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t numOfColumnsHandled() const
|
|
||||||
{
|
|
||||||
return TypeHandler<K>::size() + TypeHandler<V>::size();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t numOfRowsHandled() const
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t numOfRowsAllowed() const
|
|
||||||
{
|
|
||||||
return getLimit();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t extract(std::size_t pos)
|
|
||||||
{
|
|
||||||
TypeHandler<std::pair<K, V> >::extract(pos, _rResult, _default, getExtractor());
|
|
||||||
return 1u;
|
|
||||||
}
|
|
||||||
|
|
||||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
|
||||||
{
|
|
||||||
return new Prepare<V>(pPrep, pos, _default);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::pair<K, V>& _rResult;
|
|
||||||
std::pair<K, V> _default;
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace Keywords {
|
namespace Keywords {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user