[odb-users] Inverse pragma statement issue (circular relationship)

Alain-Serge Nagni asnagni at yahoo.com
Tue Mar 29 15:15:20 EDT 2016


Hi Boris,  Ok I go your point. Was not sure about what you wanted. If I have to send you theses files that will be lot of files to clean up and they are in separate libraries (Serializer, Memory pool, Dynamic object creation etc...). I spent this morning looking into this again and this is what I found out and it is pretty interesting. When I changed the data member type (please see below) in the class CMyContactMessages (CMyContactMessages.hpp) it does compile an it is running properly: 

1) Original statement (this doesn't work):            #pragma db inverse (Connexion::CMyContact::m_pVectortOfPrivateMessages)
            std::weak_ptr<NagniFramework::CBaseSerializable> m_pContact;           

2) Second statement (that works):          #pragma db inverse (m_pVectortOfPrivateMessages)
          std::weak_ptr<Connexion::CMyContact> m_pContact;      


It looks like to be able to use the inverse pragma we can not use the base class type with the std::weak_ptr. The polymorphism same to not work. 


After having this working with the second statement, I did try to move the pragma in the CMyContactMessagesPragmas.hpp and it didn't work. This is statment (It's working and running without any problem):       #pragma db member (Connexion::CMyContactMessages::m_pContact) inverse (m_pVectortOfPrivateMessages)


Does is make sense to you what I'm seeing.
Thank you,Alain-Serge

 

    On Tuesday, March 29, 2016 11:21 AM, Boris Kolpackov <boris at codesynthesis.com> wrote:
 

 Hi Alain-Serge,

Can you reduce it to the minimal but complete (i.e., compilable) test
case? Headers that you sent include headers that I don't have.

Boris


  


More information about the odb-users mailing list