コード例 #1
0
 public void MergeFrom(Container other)
 {
     if (other == null)
     {
         return;
     }
     if (other.OwnerID.Length != 0)
     {
         OwnerID = other.OwnerID;
     }
     if (other.Salt.Length != 0)
     {
         Salt = other.Salt;
     }
     if (other.Capacity != 0UL)
     {
         Capacity = other.Capacity;
     }
     if (other.rules_ != null)
     {
         if (rules_ == null)
         {
             Rules = new global::Netmap.PlacementRule();
         }
         Rules.MergeFrom(other.Rules);
     }
     if (other.BasicACL != 0)
     {
         BasicACL = other.BasicACL;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
コード例 #2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    OwnerID = input.ReadBytes();
                    break;
                }

                case 18: {
                    Salt = input.ReadBytes();
                    break;
                }

                case 24: {
                    Capacity = input.ReadUInt64();
                    break;
                }

                case 34: {
                    if (rules_ == null)
                    {
                        Rules = new global::Netmap.PlacementRule();
                    }
                    input.ReadMessage(Rules);
                    break;
                }

                case 40: {
                    BasicACL = input.ReadUInt32();
                    break;
                }
                }
            }
        }