| 1 | // tlb2java |
| 2 | package com.moesol.tests.com_server; |
| 3 | |
| 4 | /** |
| 5 | * |
| 6 | <!-- /xjavadoc/library[@name='COMSERVERLib']/struct[@name='TEST_NO_UUID_STRUCT']/javadoc/node()--> * <code>IDL: [ helpstring(""), ]<br/> |
| 7 | * struct/union</code> |
| 8 | */ |
| 9 | public class TEST_NO_UUID_STRUCT extends com.moesol.bindings.NativeStructure { |
| 10 | public static final Class TYPELIB = TYPELIB_E149EE62_34AE_4D0A_B9E2_3ACA3FAD59F8.class; |
| 11 | public static final com.moesol.bindings.platform_sdk.component_services.GUID UUID = new com.moesol.bindings.platform_sdk.component_services.GUID( |
| 12 | 0x00000000, (short)0x0000, (short)0x0000, |
| 13 | new byte[] { |
| 14 | (byte)0x00, (byte)0x00, |
| 15 | (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00 |
| 16 | } ); |
| 17 | |
| 18 | /** |
| 19 | * Create a new instance. |
| 20 | */ |
| 21 | public TEST_NO_UUID_STRUCT() { |
| 22 | super(new byte[sizeof()]); |
| 23 | } |
| 24 | /** |
| 25 | * Create a new instance on a byte buffer. |
| 26 | */ |
| 27 | public TEST_NO_UUID_STRUCT(java.nio.ByteBuffer bb) { |
| 28 | super(bb); |
| 29 | // set limit based on the dynamic size in byte in bb. |
| 30 | bb.limit(getDynamicSize()); |
| 31 | } |
| 32 | public static int sizeof() { |
| 33 | return 2; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Represent a native array of these structures |
| 38 | */ |
| 39 | public static class Array extends com.moesol.bindings.NativeArrayOfStructs { |
| 40 | public Array(java.nio.ByteBuffer bb) { |
| 41 | super(bb); |
| 42 | } |
| 43 | public TEST_NO_UUID_STRUCT get(int index) { |
| 44 | return new TEST_NO_UUID_STRUCT(getElementSlice(index, TEST_NO_UUID_STRUCT.sizeof())); |
| 45 | } |
| 46 | public void put(int index, TEST_NO_UUID_STRUCT value) { |
| 47 | get(index).putStruct(0, TEST_NO_UUID_STRUCT.sizeof(), value); |
| 48 | } |
| 49 | public int length() { |
| 50 | return _getByteBuffer().limit() / TEST_NO_UUID_STRUCT.sizeof(); |
| 51 | } |
| 52 | public int getDynamicSize() { |
| 53 | return _getByteBuffer().limit(); |
| 54 | } |
| 55 | public String toString() { |
| 56 | StringBuffer sb = new StringBuffer(); |
| 57 | for (int i = 0; i < length(); i++) { |
| 58 | sb.append(get(i)); |
| 59 | } |
| 60 | return sb.toString(); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | |
| 65 | |
| 66 | public static final int OFFSET_m_short_member = 0; |
| 67 | /** |
| 68 | * |
| 69 | <!-- /xjavadoc/library[@name='COMSERVERLib']/struct[@name='TEST_NO_UUID_STRUCT']/field[@name='m_short_member']/javadoc/node()--> |
| 70 | * @param v new m_short_member value |
| 71 | */ |
| 72 | public void set_m_short_member(short v) { |
| 73 | putShort(0, v); |
| 74 | } |
| 75 | /** |
| 76 | * |
| 77 | <!-- /xjavadoc/library[@name='COMSERVERLib']/struct[@name='TEST_NO_UUID_STRUCT']/field[@name='m_short_member']/javadoc/node()--> |
| 78 | * @return m_short_member value |
| 79 | */ |
| 80 | public short get_m_short_member() { |
| 81 | return getShort(0); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Get dynamic size in bytes. |
| 86 | * If this structure contains a variable size array, |
| 87 | * return the number of bytes needed to hold the fixed |
| 88 | * part and the variable sized array based on the [length_is()] |
| 89 | * attribute. Note that the sizeof method on returns the |
| 90 | * size of the fixed part plus the size of one array entry. |
| 91 | * |
| 92 | * @return dynamic size in bytes. |
| 93 | */ |
| 94 | public int getDynamicSize() { |
| 95 | return sizeof(); |
| 96 | } |
| 97 | |
| 98 | public String toString() { |
| 99 | StringBuffer sb = new StringBuffer(); |
| 100 | sb.append("\nTEST_NO_UUID_STRUCT("); |
| 101 | sb.append("m_short_member("); |
| 102 | sb.append(get_m_short_member()); |
| 103 | sb.append(")"); |
| 104 | |
| 105 | sb.append(')'); |
| 106 | return sb.toString(); |
| 107 | } |
| 108 | } |