[odb-users] Strange crash with composite primary key.

Davide Anastasia Davide.Anastasia at qualitycapital.com
Mon Apr 2 12:48:49 EDT 2012


Hi,

I am trying to obtain a composite primary key using this snippet:

 

#pragma db object id()

class ClipSize

{

private:

    // forward declaration

    class ClipKey;

 

public:

    ClipSize(const std::string& instrumentName,

             const std::string& broker,

             int clipSize):

        m_id(instrumentName, broker),

        m_clipSize(clipSize)

    { }

 

    const

 

    int clipSize() const

    {

        return m_clipSize;

    }

 

    const std::string& instrumentName() const

    {

        return m_id.m_instrumentName;

    }

 

    const std::string& broker() const

    {

        return m_id.m_broker;

    }

 

private:

#pragma db value

    struct ClipKey

    {

    public:

        ClipKey(const std::string& instrumentName,

                const std::string& broker):

            m_instrumentName(instrumentName),

            m_broker(broker)

        {}

 

        std::string m_instrumentName;

        std::string m_broker;

    private:

        ClipKey();

 

        friend class odb::access;

    };

 

    ClipSize();

 

    friend class odb::access;

 

#pragma db id

    ClipKey m_id;

 

#pragma db not_null

    int m_clipSize;

 

};

 

Unfortunately, when this piece of code goes into the ODB compiler, I get
this error:

 

[ 18%] Building ODB for clipsize.h

terminate called after throwing an instance of
'cutl::compiler::context::no_entry'

  what():  N4cutl8compiler7context8no_entryE

*** WARNING *** there are active plugins, do not report this as a bug
unless you can reproduce it without enabling any plugins.

Event                            | Plugins

PLUGIN_START_UNIT                | odb

PLUGIN_PRAGMAS                   | odb

PLUGIN_OVERRIDE_GATE             | odb

In file included from <standard-odb-epilogue>:8:0:

/opt/odb-1.8.0/include/odb/tr1/pointer-traits.hxx:95:1: internal
compiler error: Aborted

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

 

Any idea of how I can solve this problem?

 

Best,

 

Davide Anastasia
Analyst, Research & Development


Quality Capital Management Ltd.
QCM House * Horizon Business Village
No. 1 Brooklands Road
Weybridge * Surrey KT13 0TJ
United Kingdom

Tel: +44 (0) 1932 334 400
Fax: +44 (0) 1932 334 415
Email: Davide.Anastasia at QualityCapital.com
<mailto:Davide.Anastasia at QualityCapital.com> 

www.qualitycapital.com <http://www.qualitycapital.com/> 

________________________________

This email and any attachments are confidential and intended solely for
the use of the individual(s) to whom it is addressed. 

Any views or opinions presented are solely those of the author and do
not necessarily represent those of Quality Capital Management Ltd. If
you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, printing,
forwarding or copying of this email is strictly prohibited. Please
contact the sender if you have received this email in error. You should
also be aware that emails are susceptible to interference and you should
not assume that the contents of this email originated from the sender
above or that they have been accurately reproduced in their original
form. Quality Capital Management Ltd is authorised and regulated by the
Financial Services Authority in the UK and is a member of the National
Futures Association in the US. 

________________________________

 



More information about the odb-users mailing list