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

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


Hi Boris,  I'm sorry for the noise :-) , I forgot to attached the base classes to my first reply. As you can see there is nothing special to them.

Thank you,Alain-Serge
 

    On Tuesday, March 29, 2016 3:15 PM, Alain-Serge Nagni <asnagni at yahoo.com> wrote:
 

 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


   

  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CBaseSerializable.hpp
Type: text/x-c++hdr
Size: 2224 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/odb-users/attachments/20160329/14b178c8/CBaseSerializable.hpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CSerializableObject.hpp
Type: text/x-c++hdr
Size: 1689 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/odb-users/attachments/20160329/14b178c8/CSerializableObject.hpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CSerializableObject.cpp
Type: text/x-c++src
Size: 1147 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/odb-users/attachments/20160329/14b178c8/CSerializableObject.cpp


More information about the odb-users mailing list