VVContactRepository::insert
The insert member function of VVContactRepository takes an instance of VVContact and inserts it into the table associated with this instance of VVContactRepository.
 
VVContactRepository&
VVContactRepository::insert(const VVContact& aContact) //1
{
RWDBInserter anInserter = table_.inserter(); //2
anInserter << aContact; //3
return *this;
}
//1 This is the definition of the insert() member function of the VVContactRepository class. It accepts one argument, a single instance of VVContact.
//2 Here an inserter object is produced from the table associated with this instance of VVContactRepository. Through this new instance of RWDBInserter, new rows are inserted into the table.
//3 The inserter object behaves somewhat like an input stream. On this line, an instance of VVContact is shifted into the inserter. The effect is to insert the new customer into the table. This line is actually an invocation of an overloaded operator<<(). It takes an RWDBInserter instance as the left argument and a VVContact instance as the right argument. The code of the overloaded operator is described below.