Confirmed users
699
edits
| Line 180: | Line 180: | ||
'''virtual''' '''void''' RecvFoo('''const''' '''int'''& paramter) = 0; | '''virtual''' '''void''' RecvFoo('''const''' '''int'''& paramter) = 0; | ||
IPDL has two categories of built-in types. The first is C++ types that IPDL "imports" (described in more detail below) automatically, on behalf of the IPDL author. These builtin types include the C/C++ integer types (bool, char, int, ..., int8_t, uint16_t, ...) and string types (<code>nsString</code>, <code>nsCString</code>). IPDL does this because these types are common, and library code already exists to serialize and deserialize parameters of those types. These builtin types are in flux and will certainly change. See <code>ipc/ipdl/ipdl/builtins.py</code> for the most up-to-date reference. | |||
The builtin types are insufficient for all protocols. When you need to send data of type other than one built into IPDL, you can add a <code>'''using'''</code> declaration of the type in an IPDL specification, and in C++ define your own data serializer and deserializer. The details of this are beyond the scope of this document; see <code>dom/plugins/ | The second category of built-ins are types that are native to IPDL. These are IPDL unions and arrays and are described below. These native IPDL types translate into C++ types. | ||
The builtin types are insufficient for all protocols. When you need to send data of type other than one built into IPDL, you can add a <code>'''using'''</code> declaration of the type in an IPDL specification, and in C++ define your own data serializer and deserializer. The details of this are beyond the scope of this document; see <code>dom/plugins/PPluginInstance.ipdl</code> and <code>dom/plugins/PluginMessageUtils.h</code> for examples of how this is done. | |||
=== Semantics === | === Semantics === | ||