public T UnpackStructure <T>(MessageElementStructure m)
        {
            if (m == null)
            {
                return(default(T));
            }
            ostruct2 s = new ostruct2();

            s.a1 = MessageElementUtil.UnpackArray <double>(MessageElement.FindElement(m.Elements, "a1"));
            T st; try { st = (T)((object)s); } catch (InvalidCastException) { throw new DataTypeMismatchException("Wrong structuretype"); }

            return(st);
        }
 public MessageElementNestedElementList PackStructure(object s1)
 {
     using (vectorptr_messageelement m = new vectorptr_messageelement())
     {
         if (s1 == null)
         {
             return(null);
         }
         ostruct2 s = (ostruct2)s1;
         MessageElementUtil.AddMessageElementDispose(m, MessageElementUtil.PackArray <double>("a1", s.a1));
         return(new MessageElementNestedElementList(DataTypes.structure_t, "com.robotraconteur.testing.TestService2.ostruct2", m));
     }
 }
        public MessageElementStructure PackStructure(object s1)
        {
            List <MessageElement> m = new List <MessageElement>();

            if (s1 == null)
            {
                return(null);
            }
            ostruct2 s = (ostruct2)s1;

            MessageElementUtil.AddMessageElement(m, MessageElementUtil.PackArray <double>("a1", s.a1));
            return(new MessageElementStructure("com.robotraconteur.testing.TestService2.ostruct2", m));
        }
        public T UnpackStructure <T>(MessageElementNestedElementList m)
        {
            if (m == null)
            {
                return(default(T));
            }
            ostruct2 s = new ostruct2();

            using (vectorptr_messageelement mm = m.Elements)
            {
                s.a1 = MessageElementUtil.UnpackArray <double>(MessageElement.FindElement(mm, "a1"));
                T st; try { st = (T)((object)s); } catch (InvalidCastException) { throw new DataTypeMismatchException("Wrong structuretype"); }
                return(st);
            }
        }