more Data housekeeping

replaced more pointers with SharedPtr
This commit is contained in:
Aleksandar Fabijanic
2013-04-28 20:09:36 -05:00
parent a65d86a0b2
commit ebff906402
23 changed files with 368 additions and 277 deletions

View File

@@ -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;