#1 2015-06-11 09:51:44

jaclas
Member
Registered: 2014-09-12
Posts: 215

Method params type restriction

When I register the service with a method that contains a parameter of type UInt16 (Word):

procedure RemoveValue(const aAPIKey: RawUTF8; aIdValue: UInt16);

I get the error:

"TInterfaceFactoryRTTI.Create:
IAdministrationService.RemoveValue "aIdValue" parameter has unexpected type Word - use integer / cardinal instead "

Why I can not use a type of 16-bit?

--
kind regards

Offline

#2 2015-06-11 11:04:13

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Method params type restriction

Smallest types are not implemented, for code maintainability.
word/byte/shortint/smallint are not available, and should be declared as integer or cardinal.

So you can define aIdValue: cardinal and put a UInt16 value within.

Offline

#3 2015-07-30 16:02:28

coolmarat
Member
Registered: 2015-07-30
Posts: 3

Re: Method params type restriction

Hello, ab. Mormot is a great framework. But I have similar problem with "TSQLRecordClass". Is it possible to solve this problem?

Offline

#4 2015-07-30 16:27:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Method params type restriction

coolmarat wrote:

Hello, ab. Mormot is a great framework. But I have similar problem with "TSQLRecordClass". Is it possible to solve this problem?

What do you mean?
You want to transmit a TSQLRecordClass parameter over the wire?
It does not make much sense, unless you have the TSQLRecord class on both sides.

You may transmit it as RawUTF8, then use the TSQLModel to retrieve the actual class type on the other side.

Offline

#5 2015-07-30 16:36:58

coolmarat
Member
Registered: 2015-07-30
Posts: 3

Re: Method params type restriction

Pls, show how can I transmit it as RawUTF8, then use the TSQLModel to retrieve the actual class type.

but I have my DataModel shared between server and client.
I want to write "universal" getter for all my entities, so I want to transmit only name of type then make list of instances on the server side and transmit it back.

Last edited by coolmarat (2015-07-30 16:40:36)

Offline

Board footer

Powered by FluxBB