transmit_as
Indica al compilatore di associare un tipo verificato che le applicazioni client e server modifica, con un tipo di trasmissione.
[ transmit_as(
type
) ]
Parametri
- type
Specifica il tipo di dati che viene trasmessa tra client e server.
Note
transmit_as L'attributo di C++ ha la stessa funzionalità di transmit_as Attributo MIDL.
Esempio
Il codice seguente viene illustrato un utilizzo di transmit_as attributo:
// cpp_attr_ref_transmit_as.cpp
// compile with: /LD
#include "windows.h"
[module(name="MyLibrary")];
[export] typedef struct _TREE_NODE_TYPE {
unsigned short data;
struct _TREE_NODE_TYPE * left;
struct _TREE_NODE_TYPE * right;
} TREE_NODE_TYPE;
[export] struct PACKED_NODE {
unsigned short data; // same as normal node
int index; // array index of parent
};
// A left node recursive built array of
// the nodes in the tree. Can be unpacked with
// that knowledge
[export] typedef struct _TREE_XMIT_TYPE {
int count;
[size_is(count)] PACKED_NODE node[];
} TREE_XMIT_TYPE;
[transmit_as(TREE_XMIT_TYPE)] typedef TREE_NODE_TYPE * TREE_TYPE;
Requisiti
contesto di attributo
Si applica a |
typedef |
ripetibile |
No |
attributi obbligatori |
Nessuno |
attributi non validi |
Nessuno |
per ulteriori informazioni sui contesti di attributo, vedere Associare ai contesti.