[odb-users] Lazy pointers question

Lidia Kalinovsky lidia at lemur-soft.com
Tue Jun 3 12:36:44 EDT 2014


Hello all,

I have 2 persistent classes : A and B. B contains vector of As.
I would like them to be lazy_ptr and load at once only when required.

Should I fetch myself ( by some query using native view ) their's db ids,
load one-by-one and push to m_As vector ? Is there some another "magic" way
to do this ?

Any other suggestions are very appreciated.

Thanks.
Lidia.

class A
{
};

class B
{
    std::vector<lazy_shared_ptrr<A> > m_As;
};

////
//some id ;
std::shared_ptr<B> a = db.load<B>(id);

// need to get all As.
// here m_As vector is empty



-- 
Software integration and outsourcing services,
Lemur-Soft, Giv'at Nili
Israel, 37825
Phone : (+972) 545748325
Fax : (+972) 775345383
Email : lidia at lemur-soft.com
Web: www.lemur-soft.com


More information about the odb-users mailing list