Skip to content

Commit

Permalink
Implement Name() on Variant data type (#633)
Browse files Browse the repository at this point in the history
* implement Name() on Variant data type

* Single source string
  • Loading branch information
siddhukrs authored and cglzaguilar committed Jul 17, 2019
1 parent c6a28aa commit d52d38f
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/core/TypeDefiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void TypeDefiner::DefineStandardTypes(TypeManagerRef tm)
Define(tm, "Object", "DataPointer");
Define(tm, "Array", "DataPointer"); // Object with Rank > 0
Define(tm, "Array1D", "DataPointer");
Define(tm, "Variant", "DataPointer"); // TODO(PaulAustin): is this any different from the Type type if the type has a default value?
Define(tm, tsVariantType, "DataPointer"); // TODO(PaulAustin): is this any different from the Type type if the type has a default value?

Define(tm, "ErrorCluster", ERROR_CLUST_TYPE_STRING);
Define(tm, "NIPath", "c(e(a(String *) components) e(String type))");
Expand Down
1 change: 1 addition & 0 deletions source/include/Variants.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class VariantType : public TypeCommon
NIError InitData(void* pData, TypeRef pattern = nullptr) override;
NIError CopyData(const void* pData, void* pDataCopy) override;
NIError ClearData(void* pData) override;
SubString Name() override { return SubString(tsVariantType); }

public: // static methods
static VariantTypeRef New(TypeManagerRef typeManager);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dataItem_Output: (((0 0) 1 (1 2 3) (_data:null _attributes:null)) ((0 0) 1 (6 3 4) (_data:null _attributes:null)))
47 changes: 47 additions & 0 deletions test-it/ViaTests/ConvertWaveformOfInt64ToWaveformOfInt32.via
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
define (Application%3A%3AFunction%2Egviweb dv(.VirtualInstrument (
Locals: c( // Data Space
e(dv(.String 'Application::Function.gviweb')local0)
ce(dv(a(.AnalogWaveform<Int64> *) (((0 0) 1 (1 2 3) ()) ((0 0) 1 (6 3 4) ())))c1)
e(.Int32 local2)
ce(dv(.Int32 0)c3)
e(.Int32 local4)
e(.Int32 local5)
e(.AnalogWaveform<Int64> local6)
e(.AnalogWaveform<Int32> local7)
e(a(.AnalogWaveform<Int32> *) local8)
ce(a(.AnalogWaveform<Int32> *) c9)
e(a(.AnalogWaveform<Int32> *) local10)
e(a(.AnalogWaveform<Int32> *) dataItem_Output)
e(a(.AnalogWaveform<Int32> *) local12)
e(.Boolean local13)
ce(dv(.Int32 0)c14)
ce(a(.AnalogWaveform<Int32> *) c15)
)
clump(1
ArrayLength(c1 local2 )
IsGE(c3 local2 local13)
BranchIfTrue(1 local13)
Branch(2)
Perch(2)
Copy(c14 local4)
Copy(local2 local5)
Copy(c15 local8)
Perch(3)
ArrayIndex(c1 local6 local4 )
Convert(local6 local7)
ArrayConcatenate(local8 local8 local7 )
Increment(local4 local4 )
BranchIfGE(4 local4 local5)
Branch(3)
Perch(4)
Copy(local8 local10)
Branch(0)
Perch(1)
Copy(c9 local10)
Branch(0)
Perch(0)
Copy(local10 dataItem_Output)
Printf("dataItem_Output: %z\n" dataItem_Output)
/* Clump Ended. */ )
)))
enqueue (Application%3A%3AFunction%2Egviweb)
1 change: 1 addition & 0 deletions test-it/testList.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"ControlRefBasic.via",
"ConvertStringNumber.via",
"ConvertFloatToIntegral.via",
"ConvertWaveformOfInt64ToWaveformOfInt32.via",
"CopyAlignmentError.via",
"CopyAndReset.via",
"CopyingVIs.via",
Expand Down

0 comments on commit d52d38f

Please sign in to comment.