示例#1
0
        public static SpTypeManager Import(string proto)
        {
            SpTypeManager instance = new SpTypeManager();

            new SpProtoParser(instance).Parse(proto);
            return(instance);
        }
示例#2
0
        public static SpTypeManager Import(Stream stream)
        {
            SpTypeManager instance = new SpTypeManager();

            new SpProtoParser(instance).Parse(stream);
            return(instance);
        }
示例#3
0
        public static SpRpc Create(SpTypeManager tm, string package)
        {
            if (tm == null)
            {
                return(null);
            }

            SpType t = tm.GetType(package);

            if (t == null)
            {
                return(null);
            }

            SpRpc rpc = new SpRpc(tm, t);

            return(rpc);
        }
示例#4
0
 public void Attach(SpTypeManager tm)
 {
     mAttachTypeManager = tm;
 }
示例#5
0
 public void Attach(string proto)
 {
     Attach(SpTypeManager.Import(proto));
 }
示例#6
0
 public SpRpc(SpTypeManager tm, SpType t)
 {
     mHostTypeManager = tm;
     mHeaderType      = t;
 }
示例#7
0
 public static SpRpc Create(string proto, string package)
 {
     return(Create(SpTypeManager.Import(proto), package));
 }
示例#8
0
 public SpProtoParser(SpTypeManager m)
 {
     mTypeManager = m;
     mTypes       = new List <SpType>();
 }
示例#9
0
 public SpCodec(SpTypeManager m)
 {
     mTypeManager = m;
 }