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

Alain-SergeNagni asnagni at yahoo.com
Sun Mar 27 07:33:30 EDT 2016


Hi guys,
   I have an issue when trying to use the inverse pragma statement. I read chapter 6.2.2, chapter 8.2, and chapter 14.4.14 and it looks that I cannot solve this issue. Some hep will be appreciated.

So I have 2 classes that have a circular relationship. Both classes are deriving from the same parent class. The classes are also define in separate header files to keep things cleaner.

When I try to use the inverse pragma I will have the following compiler error:
                                  error:  . ')'  expected at the end of db pragma inverse
 
I couldn't find any help in the document or at least the root cause of this compiler issue.


1) in the first class I have defined a data member like this:

namespace connection
{
      class CMyContact : public Framework::CBaseSerializable
      {
            .....
            ......
            std::shared_ptr<Framework::CBaseSerializable> m_pSerialiazableObjects;
      };
}

#ifdef ODB_COMPILER
     #include  "CMyContactMessage.hpp"
#endif





2) in the second class I have define a dats member like this:

namespace connection
{
      class CMyContactMessage :  public Framework::CBaseSerializable
      {
            .....
            ......
            #pragma db inverse (CMyContact::m_pSerialiazableObjects)
            std::weak_ptr<Framework::CBaseSerializable> m_pMyContact;
      };
}




If needed I can provide the code for more details I just wanted to avoid overloading  this email  ;-) . On a side note, It's also important to point out that trough our evaluation, it's the only real issue that we are facing everything else same to work nicely the way it's advertised. Nice job guys. You also have a great documentation.

Thank you for your help,
Alain-Serge


Sent from my iPad


More information about the odb-users mailing list