You've already forked lazarus-ccr
TComplexEnumContentRemotable implementation
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1854 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -593,6 +593,16 @@ type
|
|||||||
end;
|
end;
|
||||||
TBaseComplexSimpleContentRemotableClass = class of TBaseComplexSimpleContentRemotable;
|
TBaseComplexSimpleContentRemotableClass = class of TBaseComplexSimpleContentRemotable;
|
||||||
|
|
||||||
|
{ TComplexEnumContentRemotable }
|
||||||
|
|
||||||
|
TComplexEnumContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
||||||
|
protected
|
||||||
|
class procedure SaveValue(AObject : TBaseRemotable; AStore : IFormatterBase);override;
|
||||||
|
class procedure LoadValue(var AObject : TObject; AStore : IFormatterBase);override;
|
||||||
|
class function GetEnumTypeInfo() : PTypeInfo;virtual;abstract;
|
||||||
|
function GetValueAddress() : Pointer;virtual;abstract;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TComplexInt8UContentRemotable }
|
{ TComplexInt8UContentRemotable }
|
||||||
|
|
||||||
TComplexInt8UContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
TComplexInt8UContentRemotable = class(TBaseComplexSimpleContentRemotable)
|
||||||
@@ -1743,6 +1753,24 @@ uses
|
|||||||
type
|
type
|
||||||
PObject = ^TObject;
|
PObject = ^TObject;
|
||||||
|
|
||||||
|
TEnumBuffer = Record
|
||||||
|
Case TOrdType Of
|
||||||
|
otSByte : (ShortIntData : ShortInt);
|
||||||
|
otUByte : (ByteData : Byte);
|
||||||
|
otSWord : (SmallIntData : SmallInt);
|
||||||
|
otUWord : (WordData : Word);
|
||||||
|
otSLong : (SLongIntData : LongInt);
|
||||||
|
otULong : (ULongIntData : LongWord);
|
||||||
|
End;
|
||||||
|
TFloatBuffer = Record
|
||||||
|
Case TFloatType Of
|
||||||
|
ftSingle : (SingleData : Single);
|
||||||
|
ftDouble : (DoubleData : Double);
|
||||||
|
ftExtended : (ExtendedData : Extended);
|
||||||
|
ftCurr : (CurrencyData : Currency);
|
||||||
|
ftComp : (CompData : Comp);
|
||||||
|
End;
|
||||||
|
|
||||||
var
|
var
|
||||||
TypeRegistryInstance : TTypeRegistry = Nil;
|
TypeRegistryInstance : TTypeRegistry = Nil;
|
||||||
|
|
||||||
@@ -1968,6 +1996,7 @@ begin
|
|||||||
Result := pstOptional;
|
Result := pstOptional;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
function IsStoredPropClass(AClass : TClass;PropInfo : PPropInfo) : TPropStoreType;
|
function IsStoredPropClass(AClass : TClass;PropInfo : PPropInfo) : TPropStoreType;
|
||||||
{var
|
{var
|
||||||
@@ -2014,23 +2043,6 @@ end;
|
|||||||
|
|
||||||
{ TBaseComplexRemotable }
|
{ TBaseComplexRemotable }
|
||||||
Type
|
Type
|
||||||
TEnumBuffer = Record
|
|
||||||
Case TOrdType Of
|
|
||||||
otSByte : (ShortIntData : ShortInt);
|
|
||||||
otUByte : (ByteData : Byte);
|
|
||||||
otSWord : (SmallIntData : SmallInt);
|
|
||||||
otUWord : (WordData : Word);
|
|
||||||
otSLong : (SLongIntData : LongInt);
|
|
||||||
otULong : (ULongIntData : LongWord);
|
|
||||||
End;
|
|
||||||
TFloatBuffer = Record
|
|
||||||
Case TFloatType Of
|
|
||||||
ftSingle : (SingleData : Single);
|
|
||||||
ftDouble : (DoubleData : Double);
|
|
||||||
ftExtended : (ExtendedData : Extended);
|
|
||||||
ftCurr : (CurrencyData : Currency);
|
|
||||||
ftComp : (CompData : Comp);
|
|
||||||
End;
|
|
||||||
|
|
||||||
{ TSerializeOptions }
|
{ TSerializeOptions }
|
||||||
|
|
||||||
@@ -5594,6 +5606,29 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF USE_SERIALIZE}
|
{$ENDIF USE_SERIALIZE}
|
||||||
|
|
||||||
|
{ TComplexEnumContentRemotable }
|
||||||
|
|
||||||
|
class procedure TComplexEnumContentRemotable.SaveValue(
|
||||||
|
AObject : TBaseRemotable;
|
||||||
|
AStore : IFormatterBase
|
||||||
|
);
|
||||||
|
begin
|
||||||
|
AStore.PutScopeInnerValue(GetEnumTypeInfo(),(AObject as TComplexEnumContentRemotable).GetValueAddress()^);
|
||||||
|
end;
|
||||||
|
|
||||||
|
class procedure TComplexEnumContentRemotable.LoadValue(
|
||||||
|
var AObject : TObject;
|
||||||
|
AStore : IFormatterBase
|
||||||
|
);
|
||||||
|
var
|
||||||
|
locObject : TComplexEnumContentRemotable;
|
||||||
|
locBuffer : Pointer;
|
||||||
|
begin
|
||||||
|
locObject := AObject as TComplexEnumContentRemotable;
|
||||||
|
locBuffer := locObject.GetValueAddress();
|
||||||
|
AStore.GetScopeInnerValue(GetEnumTypeInfo(),locBuffer^);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TComplexInt32SContentRemotable }
|
{ TComplexInt32SContentRemotable }
|
||||||
|
|
||||||
class procedure TComplexInt32SContentRemotable.SaveValue(
|
class procedure TComplexInt32SContentRemotable.SaveValue(
|
||||||
|
Reference in New Issue
Block a user