Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public fields | Public static fields | Public Member Functions | Static Public Member Functions | List of all members
Loyc.SyncLib.FieldId Struct Reference

The data type of a field name in SyncLib, which can be implicitly converted from a string. It includes both a Name string and an Id integer, in order to support both string-keyed fields (e.g. JSON) and int-keyed fields (e.g. Protocol Buffers). By convention, an Id of int.MinValue indicates that int-keyed implementations of ISyncManager should choose an ID automatically based on the field order. More...


Source file:

Remarks

The data type of a field name in SyncLib, which can be implicitly converted from a string. It includes both a Name string and an Id integer, in order to support both string-keyed fields (e.g. JSON) and int-keyed fields (e.g. Protocol Buffers). By convention, an Id of int.MinValue indicates that int-keyed implementations of ISyncManager should choose an ID automatically based on the field order.

Public fields

readonly string Name
 Name chosen by the user, or null if unspecified. More...
 
readonly int Id
 Id code chosen by the user, or int.MinValue if unspecified. More...
 

Public static fields

static readonly FieldId Missing = new FieldId(null, int.MinValue)
 Represents the case where a data stream lacks a Field ID. Array elements lack field IDs, and a simple binary format could omit field IDs from all objects. More...
 

Public Member Functions

 FieldId (string?name, int id)
 
override string ToString ()
 

Static Public Member Functions

static implicit operator string? (FieldId field)
 
static implicit operator FieldId (string?name)
 
static implicit operator FieldId ((string?, int) p)
 
static operator FieldId (Symbol?name)
 This conversion from Symbol to FieldId must only be used for symbols in a private SymbolPool, not global symbols. A global symbol has an ID that can change each time a program runs, which makes the ID useless for serialization or deserialization. More...
 

Member Function Documentation

static Loyc.SyncLib.FieldId.operator FieldId ( Symbol name)
explicitstatic

This conversion from Symbol to FieldId must only be used for symbols in a private SymbolPool, not global symbols. A global symbol has an ID that can change each time a program runs, which makes the ID useless for serialization or deserialization.

Member Data Documentation

readonly int Loyc.SyncLib.FieldId.Id

Id code chosen by the user, or int.MinValue if unspecified.

readonly FieldId Loyc.SyncLib.FieldId.Missing = new FieldId(null, int.MinValue)
static

Represents the case where a data stream lacks a Field ID. Array elements lack field IDs, and a simple binary format could omit field IDs from all objects.

readonly string Loyc.SyncLib.FieldId.Name

Name chosen by the user, or null if unspecified.