LLVM API Documentation

llvm::SerializeTrait< T > Struct Template Reference

#include <Serialization.h>

List of all members.

Static Public Member Functions

static void Emit (Serializer &S, const T &X)
static void Read (Deserializer &D, T &X)
static T * Create (Deserializer &D)
template<typename Arg1>
static T * Create (Deserializer &D, Arg1 &arg1)


Detailed Description

template<typename T>
struct llvm::SerializeTrait< T >

SerializeTrait - SerializeTrait bridges between the Serializer/Deserializer and the functions that serialize objects of specific types. The default behavior is to call static methods of the class for the object being serialized, but this behavior can be changed by specializing this template. Classes only need to implement the methods corresponding to the serialization scheme they want to support. For example, "Read" and "ReadVal" correspond to different deserialization schemes which make sense for different types; a class need only implement one of them. Serialization and deserialization of pointers are specially handled by the Serializer and Deserializer using the EmitOwnedPtr, etc. methods. To serialize the actual object referred to by a pointer, the class of the object either must implement the methods called by the default behavior of SerializeTrait, or specialize SerializeTrait. This latter is useful when one cannot add methods to an existing class (for example).

Definition at line 37 of file Serialization.h.


Member Function Documentation

template<typename T>
static void llvm::SerializeTrait< T >::Emit ( Serializer &  S,
const T &  X 
) [inline, static]

Definition at line 38 of file Serialization.h.

template<typename T>
static void llvm::SerializeTrait< T >::Read ( Deserializer &  D,
T &  X 
) [inline, static]

Definition at line 39 of file Serialization.h.

template<typename T>
static T* llvm::SerializeTrait< T >::Create ( Deserializer &  D  )  [inline, static]

Definition at line 40 of file Serialization.h.

template<typename T>
template<typename Arg1>
static T* llvm::SerializeTrait< T >::Create ( Deserializer &  D,
Arg1 &  arg1 
) [inline, static]

Definition at line 43 of file Serialization.h.


The documentation for this struct was generated from the following file: