|
Boost : |
From: Jonathan de Halleux (dehalleux_at_[hidden])
Date: 2003-09-11 04:43:31
[snipped]
Very (very) interresting. I know you mention that "it is not intended to
provide a full-fledged relational database framework" but could it be
possible to support basic join operations.
Suppose that we have:
struct client
{
int id;
bool operator<(const client& e)const{return id<e.id;}
};
struct order
{
int id;
int client_id; // foreign key to client
bool operator<(const order& o)const{return id<o.id;}
};
Ok, so the indexed sets for these would be:
typedef indexed_set<
client,
index_list<
unique<identity<client>
>
> client_set;
typedef indexed_set<
order,
index_list<
unique<identity<order> >,
non_unique< tag<client>, member<order,int,&employee::client_id> > >
> order_set;
Now that I have my two sets, I would like to get all the orders done by a
particular client ?
-----------------------------------------------------------------------------------
Jonathan de Halleux, Research Assistant
Center for Systems Engineering and Applied Mechanics (CESAME)
Universite catholique de Louvain
Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595
B-1348 Louvain-la-Neuve Belgium
E-mail : dehalleux_at_[hidden]
-----------------------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk