[odb-users] mapping complex, templatized value types

Christian Sell christian at gsvitec.com
Sat Sep 19 09:01:48 EDT 2015


an observation:
 
template instances do not work, neither directly nor through alias or typedef,
e.g.:

using DTA = ::std::shared_ptr<SimpleProperty<std::string>>; //NOT usable

subclassing the template class does work:

class DTA : public ::std::shared_ptr<SimpleProperty<std::string>> {}

this is of course no real solution. I still hope there is a workaround..

Christian

> Andreas Pasternak MT-Robot AG <a.pasternak at mt-robot.com> hat am 19. September
> 2015 um 13:53 geschrieben:
>
>
> Did you try an C++11 type alias?
>
> using SPI = ::std::shared_ptr< ::FlexisBase::SimplePr...
> #pragma db value(SPI ) type("VARCHAR")
>
> ----------------original message-----------------
> From: Christian Sell [christian at gsvitec.com ]
> To: odb-users at codesynthesis.com Date: Sat, 19 Sep 2015 12:38:57 +0200 (CEST)
> -------------------------------------------------
>
>
> > Hello,
> > I am trying to map custom value types using the value_traits
> > approach mentioned
> > in the manual and exemplified in the mapping example from odb-examples. I
> > can
> > succefully map a simple type like:
> >
> > class Data {
> > string something;
> > }
> >
> > but I am failing to map complex templatized types like:
> > ::std::shared_ptr< ::FlexisBase::SimplePropertyImp<
> > ::std::basic_string< char >,
> > ::FlexisBase::NoValidation< ::std::basic_string< char >, 2 >, 2 > >
> >
> > I have defined value_traits for both types, and as I said, the first type is
> > picked up correctly. The second already fails in the
> >
> > #pragma db value(X) type("VARCHAR")
> >
> > line.
> >
> > Question: what restrictions exist with regard to the types that can be
> > mapped
> > using this approach? What can I do to map the second type?
> >
> > thanks,
> > Christian
> >
> >
>
>
> --
>
>
> MT Robot AG
>
> Riedstrasse 16
>
> CH-4222 Zwingen
> Tel. - +41 (0)61 775 20 20
> Direkt - +41 (0)61 775 20 26
> Mobile - +41 (0)76 489 21 16
> Fax - +41 (0)61 775 20 21
> Email - [ mailto:a.pasternak at mt-robot.com %20%20 ->
> a.pasternak at mt-robot.com ]
> Web - www.mt-robot.com
> Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte
> Informationen enthalten.Wenn Sie nicht der richtige Adressat sind oder
> diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort
> den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren
> sowie die unbefugte Weitergabe dieser E-Mail sind nicht gestattet.
>
> This e-mail may contain confidential and/or privileged information. If
> you are not the intended recipien
>
Christian Sell

GS Vitec GmbH
Im Ziegelhaus 6-8
D-63571 Gelnhausen

mail: christian at gsvitec.com
mobil: +49 (0) 173 5384289

Tel: +49 (0) 6051 601.26-90
Fax: +49 (0) 6051 601.26-91



More information about the odb-users mailing list