Overview

The IMarshalSource family provides the low-level source-side interface used by the marshalling library to extract data from a bound object and flatten it into a representation that can cross the assembly boundary. The concrete helper class MarshalSource derives from these interfaces and is what the public marshal helpers normally create internally.

The exact set of members present on this type varies significantly between specializations. In general, the specializations cover the same families of operations as the higher level Marshal::In and Marshal::Ret wrappers: whole-object marshalling, marshal without move where applicable, and container-specific access for STL types such as std::vector, std::array, std::basic_string, std::pair, and std::tuple.

Member Families

Marshalling methods

Source specializations provide methods that return a marshalled copy of the bound object, and where supported, a variant that preserves the source object instead of moving from it.

Container metadata

STL container specializations provide size, capacity, and empty queries where those operations make sense for the bound type.

Element retrieval

Specializations for indexed or composite types expose element-specific retrieval functions so that the target side can reconstruct the original object layout safely.

Usage

Application code normally does not create IMarshalSource objects directly. The class exists to support the internals of the higher level marshal helpers, and the public source wrapper MarshalSource should be preferred whenever direct use is required.

See also