mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-08 04:05:26 +02:00
more Data housekeeping
replaced more pointers with SharedPtr
This commit is contained in:
@@ -194,24 +194,19 @@ template <>
|
||||
class TypeHandler<Person>
|
||||
{
|
||||
public:
|
||||
static void bind(std::size_t pos, const Person& obj, AbstractBinder* pBinder, AbstractBinder::Direction dir)
|
||||
static void bind(std::size_t pos, const Person& obj, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir)
|
||||
{
|
||||
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
|
||||
poco_assert_dbg (pBinder != 0);
|
||||
poco_assert_dbg (!pBinder.isNull());
|
||||
pBinder->bind(pos++, obj.getLastName(), dir);
|
||||
pBinder->bind(pos++, obj.getFirstName(), dir);
|
||||
pBinder->bind(pos++, obj.getAddress(), dir);
|
||||
pBinder->bind(pos++, obj.getAge(), dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, const Person& obj, AbstractPreparator* pPrepare)
|
||||
static void prepare(std::size_t pos, const Person& obj, AbstractPreparator::Ptr pPrepare)
|
||||
{
|
||||
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
pPrepare->prepare(pos++, obj.getLastName());
|
||||
pPrepare->prepare(pos++, obj.getFirstName());
|
||||
pPrepare->prepare(pos++, obj.getAddress());
|
||||
pPrepare->prepare(pos++, obj.getAge());
|
||||
// no-op (SQLite is prepare-less connector)
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@@ -219,9 +214,9 @@ public:
|
||||
return 4;
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, Person& obj, const Person& defVal, AbstractExtractor* pExt)
|
||||
static void extract(std::size_t pos, Person& obj, const Person& defVal, AbstractExtractor::Ptr pExt)
|
||||
{
|
||||
poco_assert_dbg (pExt != 0);
|
||||
poco_assert_dbg (!pExt.isNull());
|
||||
std::string lastName;
|
||||
std::string firstName;
|
||||
std::string address;
|
||||
|
Reference in New Issue
Block a user