[odb-users] mapping complex, templatized value types

Andreas Pasternak MT-Robot AG a.pasternak at mt-robot.com
Sat Sep 19 07:53:33 EDT 2015


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



More information about the odb-users mailing list