26

Re: How to learn what overloads is at dll?

MasterZiv wrote:

If you did not note small nuance, I want to pay to it attention.
You speak about function RtlMoveMemory , and refer to the documentation on function MoveMemory .
You did not note a small difference in their title?
These are different functions.

Certainly, noted. But after all it is written:

wrote:

This function is defined as the RtlMoveMemory function.

And it means that:

wrote:

This function i.e. MoveMemory is defined as function RtlMoveMemory

I so understand, they identical. Under the signature and on parameter to ess th since overloads as above told are not present. I already understood why.

27

Re: How to learn what overloads is at dll?

Basil A. Sidorov wrote:

it is passed...
As far as I understand, it is a counter was specific mql - the same export is imported with two different signatures for convenience of usage.
You the trader - to you and to understand, but pluses does not concern in any way.

Very much, hardly. In  generally the plainly is not present anything, except  functions. I already shoveled the documentation any time. Too all is primitive there. Especially, usage this one, and here we deal with an explicit call that-whether with different arguments. I here am itself did not understand, till now.

28

Re: How to learn what overloads is at dll?

hoz wrote:

I here am itself did not understand, till now.

Well also hammer. Use standard memcpy () or mommove (). They and  also work
Faster at some good luck.

29

Re: How to learn what overloads is at dll?

rdb_dev wrote:

At the export table there is only one function RtlMoveMemory and it is used for all these overloads with different types. If attentively to get accustomed, to overloads it is possible to note that they are overloads with different types of the same function which moves an amount byte (length):

void RtlMoveMemory (char *dest, char const *src, size_t length);

Differently, all these overloads are made for convenience of a spelling and code perception. Nothing hinders to make an own overload - with the types, not to block up the code with coercion of types by call RtlMoveMemory.

. Yes, I see. But to do overloads most when the overload is only an occasion to swap of arguments strange. Somehow on me, it has no neither sense, nor convenience. After all the same Arguments. At me similar happens, but it when is in the end  values, instead of so.

30

Re: How to learn what overloads is at dll?

hoz wrote:

here we deal with an explicit call that-whether with different arguments

There is an exported function with quite specific signature.
There is an import of this function for usage in other language (not the C/C ++) in it "other language" is possibility to declare different signatures for unique export. It is natural, provided that these signatures are actually equivalent .
If attentively to look, declared  - are equivalent.
What for it is made so is already a question to function usage in MQL. To a C/C ++, I will repeat, it is all does not concern in any way.

31

Re: How to learn what overloads is at dll?

hoz wrote:

Hm. Yes, I see. But to do overloads most when the overload is only an occasion to swap of arguments strange. Somehow on me, it has no neither sense, nor convenience. After all the same Arguments. At me similar happens, but it when is in the end  values, instead of so.

So in mql is not present either normal pointers, or operation of obtaining of the address. Here also reboots for each used type are used. You in any way do not receive the address of an array in the form of number.

32

Re: How to learn what overloads is at dll?

Basil A. Sidorov wrote:

it is passed...
There is an exported function with quite specific signature.
There is an import of this function for usage in other language (not the C/C ++) in it "other language" is possibility to declare different signatures for unique export. It is natural, provided that these signatures are actually equivalent .
If attentively to look, declared  - are equivalent.
What for it is made so is already a question to function usage in MQL. To a C/C ++, I will repeat, it is all does not concern in any way.

As a matter of fact, yes. I agree. One question on this subject remained. How you generally are guided in such moments? Here is on function RtlMoveMemory the documentation. We see:

VOID RtlMoveMemory (
_Out_ VOID UNALIGNED *Destination;
_In_ const VOID UNALIGNED *Source;
_In_ SIZE_T Length
);

As I understood, _Out_ it is parameter, the means which will return value as a result of function working off, and _In_ - parameter, for acceptance of arguments. Here it is clear, if I am right.
UNALIGNED as I understood from that read is necessary for pointer transmission that the compiler would assume that the pier the pointer will be not aligned . Though it is not clear, what for.
With type SIZE_T all is clear. And here the first 2 parameters have type VOID.  sideways that to learn, what type to transfer?
After all in the example resulted by me:

void RtlMoveMemory (intptr_t dest, const uchar &array [], size_t length);
void RtlMoveMemory (uchar &array [], intptr_t src, size_t length);
void RtlMoveMemory (intptr_t dest, const MqlRates &array [], size_t length);
void RtlMoveMemory (MqlRates &array [], intptr_t src, size_t length);
void RtlMoveMemory (intptr_t dest, const MqlTick &value,size_t length);
void RtlMoveMemory (MqlTick &value,intptr_t src, size_t length);
void RtlMoveMemory (intptr_t &dest,intptr_t src, size_t length);

Types are transferred, except known SIZE_T also long and it is less on the size.

33

Re: How to learn what overloads is at dll?

Barlone wrote:

it is passed...
So in mql is not present either normal pointers, or operation of obtaining of the address. Here also reboots for each used type are used. You in any way do not receive the address of an array in the form of number.

It yes. Besides all types are not successors of objects. And it too . In Java it is possible to transfer everything, then to lead to type and all it is stable. And in  not a variant. It is a lot of , but. I need to check up some things. At once to skip somewhere else it is difficult.

34

Re: How to learn what overloads is at dll?

hoz wrote:

As you generally are guided in such moments?

I am not guided.
In the given specific case I used "a correctness presumption": time the code (presumably working (any) sense in it is.
Then I paid attention that, actually, all these signatures are equivalent "two pointers and number".
As first approximation it suited me - I do not plan to understand details MQL.

35

Re: How to learn what overloads is at dll?

hoz wrote:

As I understood, _Out_ it is parameter, the means which will return value as a result of function working off, and _In_ - parameter, for acceptance of arguments. Here it is clear, if I am right.
UNALIGNED as I understood from that read is necessary for pointer transmission that the compiler would assume that the pier the pointer will be not aligned . Though it is not clear, what for.
With type SIZE_T all is clear. And here the first 2 parameters have type VOID.  sideways that to learn, what type to transfer?
After all in the example resulted by me:

void RtlMoveMemory (intptr_t dest, const uchar &array [], size_t length);
void RtlMoveMemory (uchar &array [], intptr_t src, size_t length);
void RtlMoveMemory (intptr_t dest, const MqlRates &array [], size_t length);
void RtlMoveMemory (MqlRates &array [], intptr_t src, size_t length);
void RtlMoveMemory (intptr_t dest, const MqlTick &value,size_t length);
void RtlMoveMemory (MqlTick &value,intptr_t src, size_t length);
void RtlMoveMemory (intptr_t &dest,intptr_t src, size_t length);

Types are transferred, except known SIZE_T also long and it is less on the size.

That what type means "to transfer"? At MoveMemory first two parameters - pointers. Addresses that is. It Also copies lenth bytes from storage to second address in storage to first address. That you should copy, and it is necessary to transfer the address of that. The link to a variable is just the address. Me here interests more, whence there addresses in the form of the whole values appear. Probably, from any another api functions which the pointer returns. Crutches.

36

Re: How to learn what overloads is at dll?

Barlone wrote:

That what type means "to transfer"?

It not in course that such "pointers".

37

Re: How to learn what overloads is at dll?

Dimitry Sibiryakov wrote:

it is passed...
It not in course that such "pointers".

Certainly, I know. They can be dereferenced. But in  there are no pointers are normal. They there are called so, but, unlike With ++, they are as they name . And it is restricted . I would name .

38

Re: How to learn what overloads is at dll?

Barlone wrote:

it is passed...
What does what type mean "to transfer"? At MoveMemory first two parameters - pointers. Addresses that is. It Also copies lenth bytes from storage to second address in storage to first address. That you should copy, and it is necessary to transfer the address of that. The link to a variable is just the address. Me here interests more, whence there addresses in the form of the whole values appear. Probably, from any another api functions which the pointer returns. Crutches.

All there is. In other library, for example, I saw, where it takes the pointer:

#import "kernel32.dll"
void RtlMoveMemory (intptr_t dest, const uchar &array [], size_t length);
void RtlMoveMemory (uchar &array [], intptr_t src, size_t length);
#import
//==================================================================================================================================================================================
//Copy the memory contents pointed by src to array. Array parameter should be initialized to the desired size. ====================================================================
void ArrayFromPointer (uchar &array [], intptr_t src, int count = WHOLE_ARRAY) {
int size = (count == WHOLE_ARRAY)? ArraySize (array): count;
RtlMoveMemory (array, src, (size_t) size);
}

39

Re: How to learn what overloads is at dll?

Further here function invocation and ArrayFromPointer and pointer assignment:

void getColumn (int i, uchar &blob []) const {
int len = sqlite3_column_bytes (m_ref, i);
if (len == 0) {
ArrayFree (blob);
return;
}
intptr_t blobp = sqlite3_column_blob (m_ref, i);
ArrayResize (blob, len);
ArrayFromPointer (blob, blobp, len);
}

40

Re: How to learn what overloads is at dll?

hoz;
What you eventually want to learn?
In  there is no concept of types, there are only addresses of the data. And all these wrappers - they simply it show (from a word a demon - the demonstrator of measurements, ). And all operations of copying with invented in mql types == memcpy == RtlMoveMemory

41

Re: How to learn what overloads is at dll?

NekZ wrote:

it is passed...
It already 100 times told above.

And the sense was?

42

Re: How to learn what overloads is at dll?

hoz wrote:

Further here function invocation and ArrayFromPointer and pointer assignment:

void getColumn (int i, uchar &blob []) const {
int len = sqlite3_column_bytes (m_ref, i);
if (len == 0) {
ArrayFree (blob);
return;
}
intptr_t blobp = sqlite3_column_blob (m_ref, i);
ArrayResize (blob, len);
ArrayFromPointer (blob, blobp, len);
}

Aha, well here, sqlite3_column_blob returns the pointer on the data. In a C ++ it would be possible to work dataful immediately in this buffer. And in mql it is necessary to copy them at first.

43

Re: How to learn what overloads is at dll?

hoz wrote:

Hm. Yes, I see. But to do overloads most when the overload is only an occasion to swap of arguments strange. Somehow on me, it has no neither sense, nor convenience. After all the same Arguments.

Why has no neither sense, nor convenience? Has!... At least not to paint long coercions of type, like these:

template <class T>
__ INLINE
void MoveMemoryOf (T& dst, const T& src)
{
std:: memmove (
reinterpret_cast <char *> (&dst);
reinterpret_cast <const char *> (&src);
sizeof (T));
}

44

Re: How to learn what overloads is at dll?

Sorry ! As usual - did not check up.

#include <mem.h>
template <class T>
__ INLINE
void MoveMemoryOf (T& dst, const T& src)
{
memmove (
reinterpret_cast <void *> (&dst);
reinterpret_cast <const void *> (&src);
sizeof (T));
}