Add mostly deobfuscated package, class and function name source

This commit is contained in:
Pyogenics
2025-05-09 17:55:37 +01:00
parent bbf438a33f
commit f8ac96858f
1034 changed files with 48614 additions and 40522 deletions

View File

@@ -0,0 +1,58 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodecStringLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecStringLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(String,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<String> = new Vector.<String>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = String(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<String> = Vector.<String>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,88 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodecStringLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecStringLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(String,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<String> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<String>> = new Vector.<Vector.<String>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<String>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = String(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<String> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<String>> = Vector.<Vector.<String>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,118 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodecStringLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecStringLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(String,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<String>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<String> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<String>>> = new Vector.<Vector.<Vector.<String>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<String>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<String>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = String(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<String>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<String> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<String>>> = Vector.<Vector.<Vector.<String>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Byte;
public class VectorCodecbyteLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecbyteLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Byte,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<int> = new Vector.<int>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = int(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<int> = Vector.<int>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Byte;
public class VectorCodecbyteLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecbyteLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Byte,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<int> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<int>> = new Vector.<Vector.<int>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<int>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = int(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<int> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<int>> = Vector.<Vector.<int>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Byte;
public class VectorCodecbyteLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecbyteLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Byte,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<int>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<int> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<int>>> = new Vector.<Vector.<Vector.<int>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<int>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<int>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = int(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<int>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<int> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<int>>> = Vector.<Vector.<Vector.<int>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,60 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Float;
public class VectorCodecfloatLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecfloatLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Float,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Number> = new Vector.<Number>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = Number(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var value:Number = NaN;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Number> = Vector.<Number>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Float;
public class VectorCodecfloatLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecfloatLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Float,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Number> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Number>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = Number(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Number> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Number>> = Vector.<Vector.<Number>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Float;
public class VectorCodecfloatLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecfloatLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Float,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<Number>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<Number> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<Number>>> = new Vector.<Vector.<Vector.<Number>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<Number>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<Number>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = Number(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<Number>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<Number> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<Number>>> = Vector.<Vector.<Vector.<Number>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,58 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodecintLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecintLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(int,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<int> = new Vector.<int>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = int(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<int> = Vector.<int>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,88 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodecintLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecintLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(int,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<int> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<int>> = new Vector.<Vector.<int>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<int>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = int(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<int> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<int>> = Vector.<Vector.<int>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,118 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodecintLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecintLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(int,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<int>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<int> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<int>>> = new Vector.<Vector.<Vector.<int>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<int>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<int>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = int(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<int>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<int> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<int>>> = Vector.<Vector.<Vector.<int>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
public class VectorCodeclongLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodeclongLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Long,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Long> = new Vector.<Long>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = Long(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Long> = Vector.<Long>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
public class VectorCodeclongLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodeclongLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Long,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Long> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Long>> = new Vector.<Vector.<Long>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Long>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = Long(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Long> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Long>> = Vector.<Vector.<Long>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
public class VectorCodeclongLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodeclongLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Long,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<Long>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<Long> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<Long>>> = new Vector.<Vector.<Vector.<Long>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<Long>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<Long>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = Long(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<Long>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<Long> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<Long>>> = Vector.<Vector.<Vector.<Long>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Short;
public class VectorCodecshortLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecshortLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Short,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<int> = new Vector.<int>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = int(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<int> = Vector.<int>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Short;
public class VectorCodecshortLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecshortLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Short,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<int> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<int>> = new Vector.<Vector.<int>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<int>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = int(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<int> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<int>> = Vector.<Vector.<int>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Short;
public class VectorCodecshortLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecshortLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Short,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<int>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<int> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<int>>> = new Vector.<Vector.<Vector.<int>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<int>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<int>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = int(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<int>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<int> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<int>>> = Vector.<Vector.<Vector.<int>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,113 @@
package _codec.commons
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Float;
import commons.A3DMatrix;
public class CodecA3DMatrix implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-Bx§:ICodec;
private var §_-Qh§:ICodec;
private var §_-ir§:ICodec;
private var §_-p§:ICodec;
private var §_-Kw§:ICodec;
private var §_-PP§:ICodec;
private var §_-e7§:ICodec;
private var §_-QE§:ICodec;
private var §_-SL§:ICodec;
private var §for §:ICodec;
private var §_-Hb§:ICodec;
private var §_-3B§:ICodec;
public function CodecA3DMatrix()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-Bx§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-Qh§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-ir§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-p§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-Kw§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-PP§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-e7§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-QE§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-SL§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§for § = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-Hb§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-3B§ = protocol.getCodec(new TypeCodecInfo(Float,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_a:Number = Number(this.§_-Bx§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","a",value_a);
var value_b:Number = Number(this.§_-Qh§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","b",value_b);
var value_c:Number = Number(this.§_-ir§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","c",value_c);
var value_d:Number = Number(this.§_-p§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","d",value_d);
var value_e:Number = Number(this.§_-Kw§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","e",value_e);
var value_f:Number = Number(this.§_-PP§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","f",value_f);
var value_g:Number = Number(this.§_-e7§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","g",value_g);
var value_h:Number = Number(this.§_-QE§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","h",value_h);
var value_i:Number = Number(this.§_-SL§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","i",value_i);
var value_j:Number = Number(this.§for §.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","j",value_j);
var value_k:Number = Number(this.§_-Hb§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","k",value_k);
var value_l:Number = Number(this.§_-3B§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","l",value_l);
return new A3DMatrix(value_a,value_b,value_c,value_d,value_e,value_f,value_g,value_h,value_i,value_j,value_k,value_l);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DMatrix = A3DMatrix(object);
this.§_-Bx§.encode(protocolBuffer,struct.a);
this.§_-Qh§.encode(protocolBuffer,struct.b);
this.§_-ir§.encode(protocolBuffer,struct.c);
this.§_-p§.encode(protocolBuffer,struct.d);
this.§_-Kw§.encode(protocolBuffer,struct.e);
this.§_-PP§.encode(protocolBuffer,struct.f);
this.§_-e7§.encode(protocolBuffer,struct.g);
this.§_-QE§.encode(protocolBuffer,struct.h);
this.§_-SL§.encode(protocolBuffer,struct.i);
this.§for §.encode(protocolBuffer,struct.j);
this.§_-Hb§.encode(protocolBuffer,struct.k);
this.§_-3B§.encode(protocolBuffer,struct.l);
}
}
}

View File

@@ -0,0 +1,46 @@
package _codec.commons
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
public class CodecId implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-2o§:ICodec;
public function CodecId()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(uint,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_id:uint = uint(this.§_-2o§.decode(protocolBuffer) as uint);
log.log("codec","struct %1 field %2 value %3","commons.Id","id",value_id);
return new Id(value_id);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:Id = Id(object);
this.§_-2o§.encode(protocolBuffer,struct.id);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.commons
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import commons.A3DMatrix;
public class VectorCodecA3DMatrixLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMatrixLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMatrix,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DMatrix> = new Vector.<A3DMatrix>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DMatrix(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DMatrix> = Vector.<A3DMatrix>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.commons
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import commons.A3DMatrix;
public class VectorCodecA3DMatrixLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMatrixLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMatrix,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DMatrix> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DMatrix>> = new Vector.<Vector.<A3DMatrix>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DMatrix>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DMatrix(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DMatrix> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DMatrix>> = Vector.<Vector.<A3DMatrix>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.commons
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import commons.A3DMatrix;
public class VectorCodecA3DMatrixLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMatrixLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMatrix,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DMatrix>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DMatrix> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DMatrix>>> = new Vector.<Vector.<Vector.<A3DMatrix>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DMatrix>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DMatrix>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DMatrix(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DMatrix>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DMatrix> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DMatrix>>> = Vector.<Vector.<Vector.<A3DMatrix>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.commons
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
public class VectorCodecIdLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecIdLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Id,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Id> = new Vector.<Id>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = Id(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Id> = Vector.<Id>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.commons
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
public class VectorCodecIdLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecIdLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Id,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Id> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Id>> = new Vector.<Vector.<Id>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Id>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = Id(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Id> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Id>> = Vector.<Vector.<Id>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.commons
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
public class VectorCodecIdLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecIdLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Id,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<Id>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<Id> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<Id>>> = new Vector.<Vector.<Vector.<Id>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<Id>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<Id>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = Id(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<Id>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<Id> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<Id>>> = Vector.<Vector.<Vector.<Id>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.UShort;
public class VectorCodecintLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecintLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(UShort,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<uint> = new Vector.<uint>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = uint(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<uint> = Vector.<uint>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.UShort;
public class VectorCodecintLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecintLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(UShort,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<uint> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<uint>> = new Vector.<Vector.<uint>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<uint>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = uint(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<uint> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<uint>> = Vector.<Vector.<uint>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.UShort;
public class VectorCodecintLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecintLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(UShort,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<uint>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<uint> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<uint>>> = new Vector.<Vector.<Vector.<uint>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<uint>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<uint>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = uint(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<uint>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<uint> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<uint>>> = Vector.<Vector.<Vector.<uint>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,58 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodeclongLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodeclongLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(uint,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<uint> = new Vector.<uint>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = uint(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<uint> = Vector.<uint>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,88 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodeclongLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodeclongLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(uint,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<uint> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<uint>> = new Vector.<Vector.<uint>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<uint>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = uint(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<uint> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<uint>> = Vector.<Vector.<uint>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,118 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
public class VectorCodeclongLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodeclongLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(uint,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<uint>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<uint> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<uint>>> = new Vector.<Vector.<Vector.<uint>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<uint>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<uint>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = uint(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<uint>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<uint> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<uint>>> = Vector.<Vector.<Vector.<uint>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.UByte;
public class VectorCodecshortLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecshortLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(UByte,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<uint> = new Vector.<uint>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = uint(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<uint> = Vector.<uint>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.UByte;
public class VectorCodecshortLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecshortLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(UByte,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<uint> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<uint>> = new Vector.<Vector.<uint>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<uint>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = uint(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<uint> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<uint>> = Vector.<Vector.<uint>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.unsigned
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.UByte;
public class VectorCodecshortLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecshortLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(UByte,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<uint>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<uint> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<uint>>> = new Vector.<Vector.<Vector.<uint>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<uint>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<uint>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = uint(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<uint>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<uint> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<uint>>> = Vector.<Vector.<Vector.<uint>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,83 @@
package _codec.versions.version1.a3d
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.A3D;
import versions.version1.a3d.geometry.A3DGeometry;
import versions.version1.a3d.materials.A3DImage;
import versions.version1.a3d.materials.A3DMap;
import versions.version1.a3d.materials.A3DMaterial;
import versions.version1.a3d.objects.A3DBox;
import versions.version1.a3d.objects.A3DObject;
public class CodecA3D implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-EA§:ICodec;
private var §_-PA§:ICodec;
private var §_-Sd§:ICodec;
private var §_-dB§:ICodec;
private var §_-77§:ICodec;
private var §_-1x§:ICodec;
public function CodecA3D()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-EA§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DBox,false),true,1));
this.§_-PA§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DGeometry,false),true,1));
this.§_-Sd§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DImage,false),true,1));
this.§_-dB§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DMap,false),true,1));
this.§_-77§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DMaterial,false),true,1));
this.§_-1x§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DObject,false),true,1));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_boxes:Vector.<A3DBox> = this.§_-EA§.decode(protocolBuffer) as Vector.<A3DBox>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","boxes",value_boxes);
var value_geometries:Vector.<A3DGeometry> = this.§_-PA§.decode(protocolBuffer) as Vector.<A3DGeometry>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","geometries",value_geometries);
var value_images:Vector.<A3DImage> = this.§_-Sd§.decode(protocolBuffer) as Vector.<A3DImage>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","images",value_images);
var value_maps:Vector.<A3DMap> = this.§_-dB§.decode(protocolBuffer) as Vector.<A3DMap>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","maps",value_maps);
var value_materials:Vector.<A3DMaterial> = this.§_-77§.decode(protocolBuffer) as Vector.<A3DMaterial>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","materials",value_materials);
var value_objects:Vector.<A3DObject> = this.§_-1x§.decode(protocolBuffer) as Vector.<A3DObject>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","objects",value_objects);
return new A3D(value_boxes,value_geometries,value_images,value_maps,value_materials,value_objects);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3D = A3D(object);
this.§_-EA§.encode(protocolBuffer,struct.boxes);
this.§_-PA§.encode(protocolBuffer,struct.geometries);
this.§_-Sd§.encode(protocolBuffer,struct.images);
this.§_-dB§.encode(protocolBuffer,struct.maps);
this.§_-77§.encode(protocolBuffer,struct.materials);
this.§_-1x§.encode(protocolBuffer,struct.objects);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.A3D;
public class VectorCodecA3DLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3D> = new Vector.<A3D>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3D(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3D> = Vector.<A3D>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.A3D;
public class VectorCodecA3DLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3D> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3D>> = new Vector.<Vector.<A3D>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3D>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3D(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3D> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3D>> = Vector.<Vector.<A3D>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.A3D;
public class VectorCodecA3DLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3D>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3D> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3D>>> = new Vector.<Vector.<Vector.<A3D>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3D>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3D>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3D(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3D>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3D> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3D>>> = Vector.<Vector.<Vector.<A3D>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,62 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
import versions.version1.a3d.geometry.A3DGeometry;
import versions.version1.a3d.geometry.A3DIndexBuffer;
import versions.version1.a3d.geometry.A3DVertexBuffer;
public class CodecA3DGeometry implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-2o§:ICodec;
private var §_-XF§:ICodec;
private var §_-U9§:ICodec;
public function CodecA3DGeometry()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-XF§ = protocol.getCodec(new TypeCodecInfo(A3DIndexBuffer,true));
this.§_-U9§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DVertexBuffer,false),true,1));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DGeometry","id",value_id);
var value_indexBuffer:A3DIndexBuffer = this.§_-XF§.decode(protocolBuffer) as A3DIndexBuffer;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DGeometry","indexBuffer",value_indexBuffer);
var value_vertexBuffers:Vector.<A3DVertexBuffer> = this.§_-U9§.decode(protocolBuffer) as Vector.<A3DVertexBuffer>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DGeometry","vertexBuffers",value_vertexBuffers);
return new A3DGeometry(value_id,value_indexBuffer,value_vertexBuffers);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DGeometry = A3DGeometry(object);
this.§_-2o§.encode(protocolBuffer,struct.id);
this.§_-XF§.encode(protocolBuffer,struct.indexBuffer);
this.§_-U9§.encode(protocolBuffer,struct.vertexBuffers);
}
}
}

View File

@@ -0,0 +1,53 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import flash.utils.ByteArray;
import versions.version1.a3d.geometry.A3DIndexBuffer;
public class CodecA3DIndexBuffer implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-GN§:ICodec;
private var §_-mz§:ICodec;
public function CodecA3DIndexBuffer()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-GN§ = protocol.getCodec(new TypeCodecInfo(ByteArray,true));
this.§_-mz§ = protocol.getCodec(new TypeCodecInfo(int,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_byteBuffer:ByteArray = this.§_-GN§.decode(protocolBuffer) as ByteArray;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DIndexBuffer","byteBuffer",value_byteBuffer);
var value_indexCount:int = int(this.§_-mz§.decode(protocolBuffer) as int);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DIndexBuffer","indexCount",value_indexCount);
return new A3DIndexBuffer(value_byteBuffer,value_indexCount);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DIndexBuffer = A3DIndexBuffer(object);
this.§_-GN§.encode(protocolBuffer,struct.byteBuffer);
this.§_-mz§.encode(protocolBuffer,struct.indexCount);
}
}
}

View File

@@ -0,0 +1,62 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Byte;
import alternativa.types.UShort;
import flash.utils.ByteArray;
import versions.version1.a3d.geometry.A3DVertexBuffer;
public class CodecA3DVertexBuffer implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-Lj§:ICodec;
private var §_-GN§:ICodec;
private var §_-hc§:ICodec;
public function CodecA3DVertexBuffer()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-Lj§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Byte,false),true,1));
this.§_-GN§ = protocol.getCodec(new TypeCodecInfo(ByteArray,true));
this.§_-hc§ = protocol.getCodec(new TypeCodecInfo(UShort,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_attributes:Vector.<int> = this.§_-Lj§.decode(protocolBuffer) as Vector.<int>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DVertexBuffer","attributes",value_attributes);
var value_byteBuffer:ByteArray = this.§_-GN§.decode(protocolBuffer) as ByteArray;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DVertexBuffer","byteBuffer",value_byteBuffer);
var value_vertexCount:uint = uint(this.§_-hc§.decode(protocolBuffer) as uint);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DVertexBuffer","vertexCount",value_vertexCount);
return new A3DVertexBuffer(value_attributes,value_byteBuffer,value_vertexCount);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DVertexBuffer = A3DVertexBuffer(object);
this.§_-Lj§.encode(protocolBuffer,struct.attributes);
this.§_-GN§.encode(protocolBuffer,struct.byteBuffer);
this.§_-hc§.encode(protocolBuffer,struct.vertexCount);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DGeometry;
public class VectorCodecA3DGeometryLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DGeometryLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DGeometry,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DGeometry> = new Vector.<A3DGeometry>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DGeometry(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DGeometry> = Vector.<A3DGeometry>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DGeometry;
public class VectorCodecA3DGeometryLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DGeometryLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DGeometry,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DGeometry> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DGeometry>> = new Vector.<Vector.<A3DGeometry>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DGeometry>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DGeometry(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DGeometry> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DGeometry>> = Vector.<Vector.<A3DGeometry>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DGeometry;
public class VectorCodecA3DGeometryLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DGeometryLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DGeometry,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DGeometry>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DGeometry> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DGeometry>>> = new Vector.<Vector.<Vector.<A3DGeometry>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DGeometry>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DGeometry>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DGeometry(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DGeometry>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DGeometry> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DGeometry>>> = Vector.<Vector.<Vector.<A3DGeometry>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DIndexBuffer;
public class VectorCodecA3DIndexBufferLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DIndexBufferLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DIndexBuffer,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DIndexBuffer> = new Vector.<A3DIndexBuffer>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DIndexBuffer(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DIndexBuffer> = Vector.<A3DIndexBuffer>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DIndexBuffer;
public class VectorCodecA3DIndexBufferLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DIndexBufferLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DIndexBuffer,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DIndexBuffer> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DIndexBuffer>> = new Vector.<Vector.<A3DIndexBuffer>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DIndexBuffer>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DIndexBuffer(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DIndexBuffer> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DIndexBuffer>> = Vector.<Vector.<A3DIndexBuffer>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DIndexBuffer;
public class VectorCodecA3DIndexBufferLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DIndexBufferLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DIndexBuffer,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DIndexBuffer>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DIndexBuffer> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DIndexBuffer>>> = new Vector.<Vector.<Vector.<A3DIndexBuffer>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DIndexBuffer>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DIndexBuffer>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DIndexBuffer(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DIndexBuffer>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DIndexBuffer> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DIndexBuffer>>> = Vector.<Vector.<Vector.<A3DIndexBuffer>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DVertexBuffer;
public class VectorCodecA3DVertexBufferLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DVertexBufferLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DVertexBuffer,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DVertexBuffer> = new Vector.<A3DVertexBuffer>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DVertexBuffer(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DVertexBuffer> = Vector.<A3DVertexBuffer>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DVertexBuffer;
public class VectorCodecA3DVertexBufferLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DVertexBufferLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DVertexBuffer,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DVertexBuffer> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DVertexBuffer>> = new Vector.<Vector.<A3DVertexBuffer>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DVertexBuffer>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DVertexBuffer(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DVertexBuffer> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DVertexBuffer>> = Vector.<Vector.<A3DVertexBuffer>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.geometry
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.geometry.A3DVertexBuffer;
public class VectorCodecA3DVertexBufferLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DVertexBufferLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DVertexBuffer,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DVertexBuffer>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DVertexBuffer> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DVertexBuffer>>> = new Vector.<Vector.<Vector.<A3DVertexBuffer>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DVertexBuffer>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DVertexBuffer>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DVertexBuffer(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DVertexBuffer>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DVertexBuffer> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DVertexBuffer>>> = Vector.<Vector.<Vector.<A3DVertexBuffer>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,46 @@
package _codec.versions.version1.a3d.id
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.id.ParentId;
public class CodecParentId implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-2o§:ICodec;
public function CodecParentId()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(uint,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_id:uint = uint(this.§_-2o§.decode(protocolBuffer) as uint);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.id.ParentId","id",value_id);
return new ParentId(value_id);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:ParentId = ParentId(object);
this.§_-2o§.encode(protocolBuffer,struct.id);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.id
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.id.ParentId;
public class VectorCodecParentIdLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecParentIdLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(ParentId,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<ParentId> = new Vector.<ParentId>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = ParentId(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<ParentId> = Vector.<ParentId>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.id
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.id.ParentId;
public class VectorCodecParentIdLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecParentIdLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(ParentId,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<ParentId> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<ParentId>> = new Vector.<Vector.<ParentId>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<ParentId>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = ParentId(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<ParentId> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<ParentId>> = Vector.<Vector.<ParentId>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.id
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.id.ParentId;
public class VectorCodecParentIdLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecParentIdLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(ParentId,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<ParentId>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<ParentId> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<ParentId>>> = new Vector.<Vector.<Vector.<ParentId>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<ParentId>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<ParentId>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = ParentId(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<ParentId>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<ParentId> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<ParentId>>> = Vector.<Vector.<Vector.<ParentId>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,53 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
import versions.version1.a3d.materials.A3DImage;
public class CodecA3DImage implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-2o§:ICodec;
private var §_-aV§:ICodec;
public function CodecA3DImage()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-aV§ = protocol.getCodec(new TypeCodecInfo(String,true));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DImage","id",value_id);
var value_url:String = this.§_-aV§.decode(protocolBuffer) as String;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DImage","url",value_url);
return new A3DImage(value_id,value_url);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DImage = A3DImage(object);
this.§_-2o§.encode(protocolBuffer,struct.id);
this.§_-aV§.encode(protocolBuffer,struct.url);
}
}
}

View File

@@ -0,0 +1,85 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Float;
import alternativa.types.UShort;
import commons.Id;
import versions.version1.a3d.materials.A3DMap;
public class CodecA3DMap implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-mC§:ICodec;
private var §_-2o§:ICodec;
private var §_-2N§:ICodec;
private var §_-K5§:ICodec;
private var §_-Q5§:ICodec;
private var §_-WH§:ICodec;
private var §_-kh§:ICodec;
public function CodecA3DMap()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-mC§ = protocol.getCodec(new TypeCodecInfo(UShort,false));
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-2N§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-K5§ = protocol.getCodec(new TypeCodecInfo(Float,true));
this.§_-Q5§ = protocol.getCodec(new TypeCodecInfo(Float,true));
this.§_-WH§ = protocol.getCodec(new TypeCodecInfo(Float,true));
this.§_-kh§ = protocol.getCodec(new TypeCodecInfo(Float,true));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_channel:uint = uint(this.§_-mC§.decode(protocolBuffer) as uint);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","channel",value_channel);
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","id",value_id);
var value_imageId:Id = this.§_-2N§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","imageId",value_imageId);
var value_uOffset:Number = Number(this.§_-K5§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","uOffset",value_uOffset);
var value_uScale:Number = Number(this.§_-Q5§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","uScale",value_uScale);
var value_vOffset:Number = Number(this.§_-WH§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","vOffset",value_vOffset);
var value_vScale:Number = Number(this.§_-kh§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","vScale",value_vScale);
return new A3DMap(value_channel,value_id,value_imageId,value_uOffset,value_uScale,value_vOffset,value_vScale);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DMap = A3DMap(object);
this.§_-mC§.encode(protocolBuffer,struct.channel);
this.§_-2o§.encode(protocolBuffer,struct.id);
this.§_-2N§.encode(protocolBuffer,struct.imageId);
this.§_-K5§.encode(protocolBuffer,struct.uOffset);
this.§_-Q5§.encode(protocolBuffer,struct.uScale);
this.§_-WH§.encode(protocolBuffer,struct.vOffset);
this.§_-kh§.encode(protocolBuffer,struct.vScale);
}
}
}

View File

@@ -0,0 +1,83 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
import versions.version1.a3d.materials.A3DMaterial;
public class CodecA3DMaterial implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-9A§:ICodec;
private var §_-hw§:ICodec;
private var §_-2o§:ICodec;
private var §_-Hu§:ICodec;
private var §_-GK§:ICodec;
private var §_-LZ§:ICodec;
private var §_-FU§:ICodec;
public function CodecA3DMaterial()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-9A§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-hw§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-Hu§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-GK§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-LZ§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-FU§ = protocol.getCodec(new TypeCodecInfo(Id,true));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_diffuseMapId:Id = this.§_-9A§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","diffuseMapId",value_diffuseMapId);
var value_glossinessMapId:Id = this.§_-hw§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","glossinessMapId",value_glossinessMapId);
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","id",value_id);
var value_lightMapId:Id = this.§_-Hu§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","lightMapId",value_lightMapId);
var value_normalMapId:Id = this.§_-GK§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","normalMapId",value_normalMapId);
var value_opacityMapId:Id = this.§_-LZ§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","opacityMapId",value_opacityMapId);
var value_specularMapId:Id = this.§_-FU§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","specularMapId",value_specularMapId);
return new A3DMaterial(value_diffuseMapId,value_glossinessMapId,value_id,value_lightMapId,value_normalMapId,value_opacityMapId,value_specularMapId);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DMaterial = A3DMaterial(object);
this.§_-9A§.encode(protocolBuffer,struct.diffuseMapId);
this.§_-hw§.encode(protocolBuffer,struct.glossinessMapId);
this.§_-2o§.encode(protocolBuffer,struct.id);
this.§_-Hu§.encode(protocolBuffer,struct.lightMapId);
this.§_-GK§.encode(protocolBuffer,struct.normalMapId);
this.§_-LZ§.encode(protocolBuffer,struct.opacityMapId);
this.§_-FU§.encode(protocolBuffer,struct.specularMapId);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DImage;
public class VectorCodecA3DImageLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DImageLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DImage,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DImage> = new Vector.<A3DImage>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DImage(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DImage> = Vector.<A3DImage>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DImage;
public class VectorCodecA3DImageLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DImageLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DImage,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DImage> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DImage>> = new Vector.<Vector.<A3DImage>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DImage>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DImage(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DImage> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DImage>> = Vector.<Vector.<A3DImage>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DImage;
public class VectorCodecA3DImageLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DImageLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DImage,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DImage>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DImage> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DImage>>> = new Vector.<Vector.<Vector.<A3DImage>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DImage>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DImage>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DImage(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DImage>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DImage> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DImage>>> = Vector.<Vector.<Vector.<A3DImage>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DMap;
public class VectorCodecA3DMapLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMapLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMap,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DMap> = new Vector.<A3DMap>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DMap(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DMap> = Vector.<A3DMap>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DMap;
public class VectorCodecA3DMapLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMapLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMap,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DMap> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DMap>> = new Vector.<Vector.<A3DMap>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DMap>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DMap(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DMap> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DMap>> = Vector.<Vector.<A3DMap>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DMap;
public class VectorCodecA3DMapLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMapLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMap,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DMap>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DMap> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DMap>>> = new Vector.<Vector.<Vector.<A3DMap>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DMap>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DMap>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DMap(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DMap>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DMap> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DMap>>> = Vector.<Vector.<Vector.<A3DMap>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DMaterial;
public class VectorCodecA3DMaterialLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMaterialLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMaterial,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DMaterial> = new Vector.<A3DMaterial>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DMaterial(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DMaterial> = Vector.<A3DMaterial>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DMaterial;
public class VectorCodecA3DMaterialLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMaterialLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMaterial,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DMaterial> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DMaterial>> = new Vector.<Vector.<A3DMaterial>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DMaterial>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DMaterial(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DMaterial> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DMaterial>> = Vector.<Vector.<A3DMaterial>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.materials
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.materials.A3DMaterial;
public class VectorCodecA3DMaterialLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DMaterialLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMaterial,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DMaterial>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DMaterial> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DMaterial>>> = new Vector.<Vector.<Vector.<A3DMaterial>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DMaterial>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DMaterial>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DMaterial(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DMaterial>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DMaterial> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DMaterial>>> = Vector.<Vector.<Vector.<A3DMaterial>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,55 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Float;
import commons.Id;
import versions.version1.a3d.objects.A3DBox;
public class CodecA3DBox implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-pM§:ICodec;
private var §_-2o§:ICodec;
public function CodecA3DBox()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-pM§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Float,false),true,1));
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_box:Vector.<Number> = this.§_-pM§.decode(protocolBuffer) as Vector.<Number>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DBox","box",value_box);
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DBox","id",value_id);
return new A3DBox(value_box,value_id);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DBox = A3DBox(object);
this.§_-pM§.encode(protocolBuffer,struct.box);
this.§_-2o§.encode(protocolBuffer,struct.id);
}
}
}

View File

@@ -0,0 +1,93 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
import versions.version1.a3d.id.ParentId;
import versions.version1.a3d.objects.A3DObject;
import versions.version1.a3d.objects.A3DSurface;
import versions.version1.a3d.objects.A3DTransformation;
public class CodecA3DObject implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-Dh§:ICodec;
private var §_-e§:ICodec;
private var §_-2o§:ICodec;
private var §_-XW§:ICodec;
private var §_-jk§:ICodec;
private var §_-Qr§:ICodec;
private var §_-9u§:ICodec;
private var §_-h9§:ICodec;
public function CodecA3DObject()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-Dh§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-e§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
this.§_-jk§ = protocol.getCodec(new TypeCodecInfo(ParentId,true));
this.§_-Qr§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DSurface,false),true,1));
this.§_-9u§ = protocol.getCodec(new TypeCodecInfo(A3DTransformation,true));
this.§_-h9§ = protocol.getCodec(new TypeCodecInfo(Boolean,true));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_boundBoxId:Id = this.§_-Dh§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","boundBoxId",value_boundBoxId);
var value_geometryId:Id = this.§_-e§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","geometryId",value_geometryId);
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","id",value_id);
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","name",value_name);
var value_parentId:ParentId = this.§_-jk§.decode(protocolBuffer) as ParentId;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","parentId",value_parentId);
var value_surfaces:Vector.<A3DSurface> = this.§_-Qr§.decode(protocolBuffer) as Vector.<A3DSurface>;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","surfaces",value_surfaces);
var value_transformation:A3DTransformation = this.§_-9u§.decode(protocolBuffer) as A3DTransformation;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","transformation",value_transformation);
var value_visible:Boolean = Boolean(this.§_-h9§.decode(protocolBuffer) as Boolean);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","visible",value_visible);
return new A3DObject(value_boundBoxId,value_geometryId,value_id,value_name,value_parentId,value_surfaces,value_transformation,value_visible);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DObject = A3DObject(object);
this.§_-Dh§.encode(protocolBuffer,struct.boundBoxId);
this.§_-e§.encode(protocolBuffer,struct.geometryId);
this.§_-2o§.encode(protocolBuffer,struct.id);
this.§_-XW§.encode(protocolBuffer,struct.name);
this.§_-jk§.encode(protocolBuffer,struct.parentId);
this.§_-Qr§.encode(protocolBuffer,struct.surfaces);
this.§_-9u§.encode(protocolBuffer,struct.transformation);
this.§_-h9§.encode(protocolBuffer,struct.visible);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import commons.Id;
import versions.version1.a3d.objects.A3DSurface;
public class CodecA3DSurface implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-AL§:ICodec;
private var §_-Av§:ICodec;
private var §_-pJ§:ICodec;
public function CodecA3DSurface()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-AL§ = protocol.getCodec(new TypeCodecInfo(int,false));
this.§_-Av§ = protocol.getCodec(new TypeCodecInfo(Id,true));
this.§_-pJ§ = protocol.getCodec(new TypeCodecInfo(int,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_indexBegin:int = int(this.§_-AL§.decode(protocolBuffer) as int);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DSurface","indexBegin",value_indexBegin);
var value_materialId:Id = this.§_-Av§.decode(protocolBuffer) as Id;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DSurface","materialId",value_materialId);
var value_numTriangles:int = int(this.§_-pJ§.decode(protocolBuffer) as int);
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DSurface","numTriangles",value_numTriangles);
return new A3DSurface(value_indexBegin,value_materialId,value_numTriangles);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DSurface = A3DSurface(object);
this.§_-AL§.encode(protocolBuffer,struct.indexBegin);
this.§_-Av§.encode(protocolBuffer,struct.materialId);
this.§_-pJ§.encode(protocolBuffer,struct.numTriangles);
}
}
}

View File

@@ -0,0 +1,47 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import commons.A3DMatrix;
import versions.version1.a3d.objects.A3DTransformation;
public class CodecA3DTransformation implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-dG§:ICodec;
public function CodecA3DTransformation()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-dG§ = protocol.getCodec(new TypeCodecInfo(A3DMatrix,true));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_matrix:A3DMatrix = this.§_-dG§.decode(protocolBuffer) as A3DMatrix;
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DTransformation","matrix",value_matrix);
return new A3DTransformation(value_matrix);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3DTransformation = A3DTransformation(object);
this.§_-dG§.encode(protocolBuffer,struct.matrix);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DBox;
public class VectorCodecA3DBoxLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DBoxLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DBox,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DBox> = new Vector.<A3DBox>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DBox(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DBox> = Vector.<A3DBox>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DBox;
public class VectorCodecA3DBoxLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DBoxLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DBox,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DBox> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DBox>> = new Vector.<Vector.<A3DBox>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DBox>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DBox(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DBox> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DBox>> = Vector.<Vector.<A3DBox>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DBox;
public class VectorCodecA3DBoxLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DBoxLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DBox,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DBox>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DBox> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DBox>>> = new Vector.<Vector.<Vector.<A3DBox>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DBox>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DBox>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DBox(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DBox>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DBox> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DBox>>> = Vector.<Vector.<Vector.<A3DBox>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DObject;
public class VectorCodecA3DObjectLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DObjectLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DObject,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DObject> = new Vector.<A3DObject>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DObject(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DObject> = Vector.<A3DObject>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DObject;
public class VectorCodecA3DObjectLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DObjectLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DObject,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DObject> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DObject>> = new Vector.<Vector.<A3DObject>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DObject>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DObject(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DObject> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DObject>> = Vector.<Vector.<A3DObject>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DObject;
public class VectorCodecA3DObjectLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DObjectLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DObject,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DObject>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DObject> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DObject>>> = new Vector.<Vector.<Vector.<A3DObject>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DObject>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DObject>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DObject(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DObject>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DObject> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DObject>>> = Vector.<Vector.<Vector.<A3DObject>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DSurface;
public class VectorCodecA3DSurfaceLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DSurfaceLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DSurface,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DSurface> = new Vector.<A3DSurface>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DSurface(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DSurface> = Vector.<A3DSurface>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DSurface;
public class VectorCodecA3DSurfaceLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DSurfaceLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DSurface,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DSurface> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DSurface>> = new Vector.<Vector.<A3DSurface>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DSurface>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DSurface(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DSurface> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DSurface>> = Vector.<Vector.<A3DSurface>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DSurface;
public class VectorCodecA3DSurfaceLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DSurfaceLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DSurface,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DSurface>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DSurface> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DSurface>>> = new Vector.<Vector.<Vector.<A3DSurface>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DSurface>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DSurface>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DSurface(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DSurface>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DSurface> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DSurface>>> = Vector.<Vector.<Vector.<A3DSurface>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DTransformation;
public class VectorCodecA3DTransformationLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DTransformationLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DTransformation,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3DTransformation> = new Vector.<A3DTransformation>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3DTransformation(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3DTransformation> = Vector.<A3DTransformation>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DTransformation;
public class VectorCodecA3DTransformationLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DTransformationLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DTransformation,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3DTransformation> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3DTransformation>> = new Vector.<Vector.<A3DTransformation>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3DTransformation>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3DTransformation(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3DTransformation> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3DTransformation>> = Vector.<Vector.<A3DTransformation>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version1.a3d.objects
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version1.a3d.objects.A3DTransformation;
public class VectorCodecA3DTransformationLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3DTransformationLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DTransformation,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3DTransformation>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3DTransformation> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3DTransformation>>> = new Vector.<Vector.<Vector.<A3DTransformation>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3DTransformation>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3DTransformation>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3DTransformation(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3DTransformation>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3DTransformation> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3DTransformation>>> = Vector.<Vector.<Vector.<A3DTransformation>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,174 @@
package _codec.versions.version2.a3d
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.A3D2;
import versions.version2.a3d.animation.A3D2AnimationClip;
import versions.version2.a3d.animation.A3D2Track;
import versions.version2.a3d.geometry.A3D2IndexBuffer;
import versions.version2.a3d.geometry.A3D2VertexBuffer;
import versions.version2.a3d.materials.A3D2CubeMap;
import versions.version2.a3d.materials.A3D2Image;
import versions.version2.a3d.materials.A3D2Map;
import versions.version2.a3d.materials.A3D2Material;
import versions.version2.a3d.objects.A3D2AmbientLight;
import versions.version2.a3d.objects.A3D2Box;
import versions.version2.a3d.objects.A3D2Decal;
import versions.version2.a3d.objects.A3D2DirectionalLight;
import versions.version2.a3d.objects.A3D2Joint;
import versions.version2.a3d.objects.A3D2Mesh;
import versions.version2.a3d.objects.A3D2Object;
import versions.version2.a3d.objects.A3D2OmniLight;
import versions.version2.a3d.objects.A3D2Skin;
import versions.version2.a3d.objects.A3D2SpotLight;
import versions.version2.a3d.objects.A3D2Sprite;
public class CodecA3D2 implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-8X§:ICodec;
private var §_-Fa§:ICodec;
private var §_-Aj§:ICodec;
private var §_-EA§:ICodec;
private var §_-lJ§:ICodec;
private var §_-9f§:ICodec;
private var §_-GC§:ICodec;
private var §_-Sd§:ICodec;
private var §_-76§:ICodec;
private var §_-3f§:ICodec;
private var §_-dB§:ICodec;
private var §_-77§:ICodec;
private var §_-PJ§:ICodec;
private var §_-1x§:ICodec;
private var §_-aP§:ICodec;
private var §_-e9§:ICodec;
private var §_-3y§:ICodec;
private var §_-E2§:ICodec;
private var §_-U9§:ICodec;
public function CodecA3D2()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-8X§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2AmbientLight,false),true,1));
this.§_-Fa§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2AnimationClip,false),true,1));
this.§_-Aj§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Track,false),true,1));
this.§_-EA§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Box,false),true,1));
this.§_-lJ§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2CubeMap,false),true,1));
this.§_-9f§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Decal,false),true,1));
this.§_-GC§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2DirectionalLight,false),true,1));
this.§_-Sd§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Image,false),true,1));
this.§_-76§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2IndexBuffer,false),true,1));
this.§_-3f§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Joint,false),true,1));
this.§_-dB§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Map,false),true,1));
this.§_-77§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Material,false),true,1));
this.§_-PJ§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Mesh,false),true,1));
this.§_-1x§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Object,false),true,1));
this.§_-aP§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2OmniLight,false),true,1));
this.§_-e9§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Skin,false),true,1));
this.§_-3y§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2SpotLight,false),true,1));
this.§_-E2§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Sprite,false),true,1));
this.§_-U9§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2VertexBuffer,false),true,1));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_ambientLights:Vector.<A3D2AmbientLight> = this.§_-8X§.decode(protocolBuffer) as Vector.<A3D2AmbientLight>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","ambientLights",value_ambientLights);
var value_animationClips:Vector.<A3D2AnimationClip> = this.§_-Fa§.decode(protocolBuffer) as Vector.<A3D2AnimationClip>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","animationClips",value_animationClips);
var value_animationTracks:Vector.<A3D2Track> = this.§_-Aj§.decode(protocolBuffer) as Vector.<A3D2Track>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","animationTracks",value_animationTracks);
var value_boxes:Vector.<A3D2Box> = this.§_-EA§.decode(protocolBuffer) as Vector.<A3D2Box>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","boxes",value_boxes);
var value_cubeMaps:Vector.<A3D2CubeMap> = this.§_-lJ§.decode(protocolBuffer) as Vector.<A3D2CubeMap>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","cubeMaps",value_cubeMaps);
var value_decals:Vector.<A3D2Decal> = this.§_-9f§.decode(protocolBuffer) as Vector.<A3D2Decal>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","decals",value_decals);
var value_directionalLights:Vector.<A3D2DirectionalLight> = this.§_-GC§.decode(protocolBuffer) as Vector.<A3D2DirectionalLight>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","directionalLights",value_directionalLights);
var value_images:Vector.<A3D2Image> = this.§_-Sd§.decode(protocolBuffer) as Vector.<A3D2Image>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","images",value_images);
var value_indexBuffers:Vector.<A3D2IndexBuffer> = this.§_-76§.decode(protocolBuffer) as Vector.<A3D2IndexBuffer>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","indexBuffers",value_indexBuffers);
var value_joints:Vector.<A3D2Joint> = this.§_-3f§.decode(protocolBuffer) as Vector.<A3D2Joint>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","joints",value_joints);
var value_maps:Vector.<A3D2Map> = this.§_-dB§.decode(protocolBuffer) as Vector.<A3D2Map>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","maps",value_maps);
var value_materials:Vector.<A3D2Material> = this.§_-77§.decode(protocolBuffer) as Vector.<A3D2Material>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","materials",value_materials);
var value_meshes:Vector.<A3D2Mesh> = this.§_-PJ§.decode(protocolBuffer) as Vector.<A3D2Mesh>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","meshes",value_meshes);
var value_objects:Vector.<A3D2Object> = this.§_-1x§.decode(protocolBuffer) as Vector.<A3D2Object>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","objects",value_objects);
var value_omniLights:Vector.<A3D2OmniLight> = this.§_-aP§.decode(protocolBuffer) as Vector.<A3D2OmniLight>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","omniLights",value_omniLights);
var value_skins:Vector.<A3D2Skin> = this.§_-e9§.decode(protocolBuffer) as Vector.<A3D2Skin>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","skins",value_skins);
var value_spotLights:Vector.<A3D2SpotLight> = this.§_-3y§.decode(protocolBuffer) as Vector.<A3D2SpotLight>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","spotLights",value_spotLights);
var value_sprites:Vector.<A3D2Sprite> = this.§_-E2§.decode(protocolBuffer) as Vector.<A3D2Sprite>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","sprites",value_sprites);
var value_vertexBuffers:Vector.<A3D2VertexBuffer> = this.§_-U9§.decode(protocolBuffer) as Vector.<A3D2VertexBuffer>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","vertexBuffers",value_vertexBuffers);
return new A3D2(value_ambientLights,value_animationClips,value_animationTracks,value_boxes,value_cubeMaps,value_decals,value_directionalLights,value_images,value_indexBuffers,value_joints,value_maps,value_materials,value_meshes,value_objects,value_omniLights,value_skins,value_spotLights,value_sprites,value_vertexBuffers);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3D2 = A3D2(object);
this.§_-8X§.encode(protocolBuffer,struct.ambientLights);
this.§_-Fa§.encode(protocolBuffer,struct.animationClips);
this.§_-Aj§.encode(protocolBuffer,struct.animationTracks);
this.§_-EA§.encode(protocolBuffer,struct.boxes);
this.§_-lJ§.encode(protocolBuffer,struct.cubeMaps);
this.§_-9f§.encode(protocolBuffer,struct.decals);
this.§_-GC§.encode(protocolBuffer,struct.directionalLights);
this.§_-Sd§.encode(protocolBuffer,struct.images);
this.§_-76§.encode(protocolBuffer,struct.indexBuffers);
this.§_-3f§.encode(protocolBuffer,struct.joints);
this.§_-dB§.encode(protocolBuffer,struct.maps);
this.§_-77§.encode(protocolBuffer,struct.materials);
this.§_-PJ§.encode(protocolBuffer,struct.meshes);
this.§_-1x§.encode(protocolBuffer,struct.objects);
this.§_-aP§.encode(protocolBuffer,struct.omniLights);
this.§_-e9§.encode(protocolBuffer,struct.skins);
this.§_-3y§.encode(protocolBuffer,struct.spotLights);
this.§_-E2§.encode(protocolBuffer,struct.sprites);
this.§_-U9§.encode(protocolBuffer,struct.vertexBuffers);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version2.a3d
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.A3D2;
public class VectorCodecA3D2Level1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2Level1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3D2> = new Vector.<A3D2>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3D2(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3D2> = Vector.<A3D2>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version2.a3d
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.A3D2;
public class VectorCodecA3D2Level2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2Level2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3D2> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3D2>> = new Vector.<Vector.<A3D2>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3D2>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3D2(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3D2> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3D2>> = Vector.<Vector.<A3D2>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version2.a3d
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.A3D2;
public class VectorCodecA3D2Level3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2Level3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3D2>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3D2> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3D2>>> = new Vector.<Vector.<Vector.<A3D2>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3D2>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3D2>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3D2(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3D2>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3D2> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3D2>>> = Vector.<Vector.<Vector.<A3D2>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,72 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import versions.version2.a3d.animation.A3D2AnimationClip;
public class CodecA3D2AnimationClip implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-2o§:ICodec;
private var §_-HX§:ICodec;
private var §_-XW§:ICodec;
private var §_-Td§:ICodec;
private var §_-Z-§:ICodec;
public function CodecA3D2AnimationClip()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
this.§_-HX§ = protocol.getCodec(new TypeCodecInfo(Boolean,false));
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
this.§_-Td§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Long,false),true,1));
this.§_-Z-§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(int,false),false,1));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","id",value_id);
var value_loop:Boolean = Boolean(this.§_-HX§.decode(protocolBuffer) as Boolean);
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","loop",value_loop);
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","name",value_name);
var value_objectIDs:Vector.<Long> = this.§_-Td§.decode(protocolBuffer) as Vector.<Long>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","objectIDs",value_objectIDs);
var value_tracks:Vector.<int> = this.§_-Z-§.decode(protocolBuffer) as Vector.<int>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","tracks",value_tracks);
return new A3D2AnimationClip(value_id,value_loop,value_name,value_objectIDs,value_tracks);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3D2AnimationClip = A3D2AnimationClip(object);
this.§_-2o§.encode(protocolBuffer,struct.id);
this.§_-HX§.encode(protocolBuffer,struct.loop);
this.§_-XW§.encode(protocolBuffer,struct.name);
this.§_-Td§.encode(protocolBuffer,struct.objectIDs);
this.§_-Z-§.encode(protocolBuffer,struct.tracks);
}
}
}

View File

@@ -0,0 +1,54 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Float;
import versions.version2.a3d.animation.A3D2Keyframe;
import versions.version2.a3d.objects.A3D2Transform;
public class CodecA3D2Keyframe implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-dk§:ICodec;
private var §_-S2§:ICodec;
public function CodecA3D2Keyframe()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-dk§ = protocol.getCodec(new TypeCodecInfo(Float,false));
this.§_-S2§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_time:Number = Number(this.§_-dk§.decode(protocolBuffer) as Number);
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Keyframe","time",value_time);
var value_transform:A3D2Transform = this.§_-S2§.decode(protocolBuffer) as A3D2Transform;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Keyframe","transform",value_transform);
return new A3D2Keyframe(value_time,value_transform);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3D2Keyframe = A3D2Keyframe(object);
this.§_-dk§.encode(protocolBuffer,struct.time);
this.§_-S2§.encode(protocolBuffer,struct.transform);
}
}
}

View File

@@ -0,0 +1,60 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2Keyframe;
import versions.version2.a3d.animation.A3D2Track;
public class CodecA3D2Track implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-2o§:ICodec;
private var §_-Ja§:ICodec;
private var §_-Fo§:ICodec;
public function CodecA3D2Track()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
this.§_-Ja§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Keyframe,false),false,1));
this.§_-Fo§ = protocol.getCodec(new TypeCodecInfo(String,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Track","id",value_id);
var value_keyframes:Vector.<A3D2Keyframe> = this.§_-Ja§.decode(protocolBuffer) as Vector.<A3D2Keyframe>;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Track","keyframes",value_keyframes);
var value_objectName:String = this.§_-Fo§.decode(protocolBuffer) as String;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Track","objectName",value_objectName);
return new A3D2Track(value_id,value_keyframes,value_objectName);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3D2Track = A3D2Track(object);
this.§_-2o§.encode(protocolBuffer,struct.id);
this.§_-Ja§.encode(protocolBuffer,struct.keyframes);
this.§_-Fo§.encode(protocolBuffer,struct.objectName);
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2AnimationClip;
public class VectorCodecA3D2AnimationClipLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2AnimationClipLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2AnimationClip,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3D2AnimationClip> = new Vector.<A3D2AnimationClip>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3D2AnimationClip(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3D2AnimationClip> = Vector.<A3D2AnimationClip>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2AnimationClip;
public class VectorCodecA3D2AnimationClipLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2AnimationClipLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2AnimationClip,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3D2AnimationClip> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3D2AnimationClip>> = new Vector.<Vector.<A3D2AnimationClip>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3D2AnimationClip>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3D2AnimationClip(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3D2AnimationClip> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3D2AnimationClip>> = Vector.<Vector.<A3D2AnimationClip>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2AnimationClip;
public class VectorCodecA3D2AnimationClipLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2AnimationClipLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2AnimationClip,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3D2AnimationClip>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3D2AnimationClip> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3D2AnimationClip>>> = new Vector.<Vector.<Vector.<A3D2AnimationClip>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3D2AnimationClip>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3D2AnimationClip>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3D2AnimationClip(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3D2AnimationClip>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3D2AnimationClip> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3D2AnimationClip>>> = Vector.<Vector.<Vector.<A3D2AnimationClip>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2Keyframe;
public class VectorCodecA3D2KeyframeLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2KeyframeLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Keyframe,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3D2Keyframe> = new Vector.<A3D2Keyframe>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3D2Keyframe(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3D2Keyframe> = Vector.<A3D2Keyframe>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2Keyframe;
public class VectorCodecA3D2KeyframeLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2KeyframeLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Keyframe,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3D2Keyframe> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3D2Keyframe>> = new Vector.<Vector.<A3D2Keyframe>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3D2Keyframe>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3D2Keyframe(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3D2Keyframe> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3D2Keyframe>> = Vector.<Vector.<A3D2Keyframe>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2Keyframe;
public class VectorCodecA3D2KeyframeLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2KeyframeLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Keyframe,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3D2Keyframe>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3D2Keyframe> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3D2Keyframe>>> = new Vector.<Vector.<Vector.<A3D2Keyframe>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3D2Keyframe>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3D2Keyframe>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3D2Keyframe(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3D2Keyframe>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3D2Keyframe> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3D2Keyframe>>> = Vector.<Vector.<Vector.<A3D2Keyframe>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2Track;
public class VectorCodecA3D2TrackLevel1 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2TrackLevel1(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Track,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<A3D2Track> = new Vector.<A3D2Track>(length,true);
for(var i:int = 0; i < length; i++)
{
result[i] = A3D2Track(this.elementCodec.decode(protocolBuffer));
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<A3D2Track> = Vector.<A3D2Track>(object);
var length:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length);
for(var i:int = 0; i < length; i++)
{
this.elementCodec.encode(protocolBuffer,data[i]);
}
}
}
}

View File

@@ -0,0 +1,89 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2Track;
public class VectorCodecA3D2TrackLevel2 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2TrackLevel2(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Track,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<A3D2Track> = null;
var i2:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<A3D2Track>> = new Vector.<Vector.<A3D2Track>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<A3D2Track>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; i2++)
{
items2[i2] = A3D2Track(this.elementCodec.decode(protocolBuffer));
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<A3D2Track> = null;
var length2:int = 0;
var i2:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<A3D2Track>> = Vector.<Vector.<A3D2Track>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
this.elementCodec.encode(protocolBuffer,items2[i2]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,119 @@
package _codec.versions.version2.a3d.animation
{
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import versions.version2.a3d.animation.A3D2Track;
public class VectorCodecA3D2TrackLevel3 implements ICodec
{
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecA3D2TrackLevel3(optionalElement:Boolean)
{
super();
this.optionalElement = optionalElement;
}
public function init(protocol:IProtocol) : void
{
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Track,false));
if(this.optionalElement)
{
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
var length2:int = 0;
var items2:Vector.<Vector.<A3D2Track>> = null;
var i2:int = 0;
var length3:int = 0;
var items3:Vector.<A3D2Track> = null;
var i3:int = 0;
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
var result:Vector.<Vector.<Vector.<A3D2Track>>> = new Vector.<Vector.<Vector.<A3D2Track>>>(length1,true);
for(var i1:int = 0; i1 < length1; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
items2 = new Vector.<Vector.<A3D2Track>>(length2,true);
result[i1] = items2;
for(i2 = 0; i2 < length2; )
{
if(!protocolBuffer.optionalMap.OptionalMap())
{
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
items3 = new Vector.<A3D2Track>(length3,true);
items2[i2] = items3;
for(i3 = 0; i3 < length3; i3++)
{
items3[i3] = A3D2Track(this.elementCodec.decode(protocolBuffer));
}
}
i2++;
}
}
i1++;
}
return result;
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
var items2:Vector.<Vector.<A3D2Track>> = null;
var length2:int = 0;
var i2:int = 0;
var items3:Vector.<A3D2Track> = null;
var length3:int = 0;
var i3:int = 0;
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var data:Vector.<Vector.<Vector.<A3D2Track>>> = Vector.<Vector.<Vector.<A3D2Track>>>(object);
var length1:int = int(data.length);
LengthCodecHelper.encodeLength(protocolBuffer,length1);
for(var i1:int = 0; i1 < length1; i1++)
{
items2 = data[i1];
if(items2 != null)
{
protocolBuffer.optionalMap.addBit(false);
length2 = int(items2.length);
LengthCodecHelper.encodeLength(protocolBuffer,length2);
for(i2 = 0; i2 < length2; i2++)
{
items3 = items2[i1];
if(items3 != null)
{
protocolBuffer.optionalMap.addBit(false);
length3 = int(items3.length);
LengthCodecHelper.encodeLength(protocolBuffer,length3);
for(i3 = 0; i3 < length3; i3++)
{
this.elementCodec.encode(protocolBuffer,items3[i3]);
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
else
{
protocolBuffer.optionalMap.addBit(true);
}
}
}
}
}

View File

@@ -0,0 +1,59 @@
package _codec.versions.version2.a3d.geometry
{
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import flash.utils.ByteArray;
import versions.version2.a3d.geometry.A3D2IndexBuffer;
public class CodecA3D2IndexBuffer implements ICodec
{
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var §_-GN§:ICodec;
private var §_-2o§:ICodec;
private var §_-mz§:ICodec;
public function CodecA3D2IndexBuffer()
{
super();
}
public function init(protocol:IProtocol) : void
{
this.§_-GN§ = protocol.getCodec(new TypeCodecInfo(ByteArray,false));
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
this.§_-mz§ = protocol.getCodec(new TypeCodecInfo(int,false));
}
public function decode(protocolBuffer:ProtocolBuffer) : Object
{
log = IClientLog(OSGi.getInstance().getService(IClientLog));
var value_byteBuffer:ByteArray = this.§_-GN§.decode(protocolBuffer) as ByteArray;
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2IndexBuffer","byteBuffer",value_byteBuffer);
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2IndexBuffer","id",value_id);
var value_indexCount:int = int(this.§_-mz§.decode(protocolBuffer) as int);
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2IndexBuffer","indexCount",value_indexCount);
return new A3D2IndexBuffer(value_byteBuffer,value_id,value_indexCount);
}
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
{
if(object == null)
{
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var struct:A3D2IndexBuffer = A3D2IndexBuffer(object);
this.§_-GN§.encode(protocolBuffer,struct.byteBuffer);
this.§_-2o§.encode(protocolBuffer,struct.id);
this.§_-mz§.encode(protocolBuffer,struct.indexCount);
}
}
}

Some files were not shown because too many files have changed in this diff Show More