Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Serializer Interface Reference

Serialization general interface. More...

Inheritance diagram for Serializer:
[legend]

Public Member Functions

proto bool Write (void value_out)
 
proto bool Read (void value_in)
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Protected Member Functions

void Serializer ()
 
void ~Serializer ()
 

Detailed Description

Serialization general interface.

Serializer API works with:

Note
Serializer provides deep serialization (it serialize class memebers and their members etc). To avoid serialization of certain class variable, use NonSerialized attribute.

Usage:

class MyData
{
int m_id;
string m_dbg; // I don't want to serialize this variable
}
void Serialize(Serializer s)
{
int statArray[4] = {6,9,2,3};
array<int> dynArray = {8,5,6,4};
MyData data = new MyData();
data.m_id = 965;
data.m_values = map<string, float>;
data.m_values.Insert("value1", 5.98);
data.m_values.Insert("value2", 4.36);
s.Write(10);
s.Write("Hello");
s.Write(statArray);
s.Write(dynArray);
s.Write(data);
}
void Deserialize(Serializer s)
{
int statArray[4];
array<int> dynArray;
MyData data;
int someInt;
string someString;
s.Read(someInt);
s.Read(someString);
s.Read(statArray);
s.Read(dynArray);
s.Read(data);
}
Definition: Serializer.c:114
Serialization general interface.
Definition: Serializer.c:59
proto bool Read(void value_in)
proto bool Write(void value_out)
Definition: Types.c:150
Associative array template.
Definition: Types.c:481

Constructor & Destructor Documentation

◆ Serializer()

void Serializer.Serializer ( )
protected

◆ ~Serializer()

void Serializer.~Serializer ( )
protected

Member Function Documentation

◆ Read()

proto bool Serializer.Read ( void  value_in)

◆ Write()

proto bool Serializer.Write ( void  value_out)

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