Class AddressCreator.

Inherits HelperRowCreator

The AddressCreator ensures that a set of addresses exist in the database and that their addresses are known.

You have to create an object, then execute it. It'll use a subtransaction and implicitly block your transaction until the IDs are known.

AddressCreator::AddressCreator( Address * address, Transaction * t )

Constructs an AddressCreator which will ensure that address has an Address::id(), using a subtransaction if t for its work.

AddressCreator::AddressCreator( Dict<Address> * addresses, Transaction * t )

Constructs an AddressCreator which will ensure that all the addresses have an Address::id(), using a subtransaction if t for its work.

AddressCreator::AddressCreator( List<Address> * addresses, Transaction * t )

Constructs an AddressCreator which will ensure that all the addresses have an Address::id(), using a subtransaction if t for its work.

void AddressCreator::execute()

This overloads HelperRowCreator::execute() and conditionally replaces its state machine with one that's faster for large address sets.

Reimplements HelperRowCreator::execute().

static EString AddressCreator::key( Address * a )

Returns a EString derived from a in a unique fashion. Two addresses that are the same according to the RFC rules have the same key().

Query * AddressCreator::makeSelect()

Creates a select to look for as many addresses as possible, but binding no more than 128 strings.

Reimplements HelperRowCreator::makeSelect().

uint AddressCreator::param( Dict<uint> * b, const EString & s, uint & n, Query * q )

This private helper looks for s in b, inserts it if not present, and returns its number. Uses n to generate a new unique number if necessary, and binds s to n in q.

b has to use key() as key for each member. Nothing will work if you break this rule. This sounds a little fragile, but I can't think of a good alternative right now.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.