PCL
Variant.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.4.7
6 // ----------------------------------------------------------------------------
7 // pcl/Variant.h - Released 2020-12-17T15:46:29Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2020 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_Variant_h
53 #define __PCL_Variant_h
54 
56 
57 #include <pcl/Defs.h>
58 #include <pcl/Diagnostics.h>
59 
60 #include <pcl/ByteArray.h>
61 #include <pcl/Complex.h>
62 #include <pcl/Matrix.h>
63 #include <pcl/Point.h>
64 #include <pcl/Rectangle.h>
65 #include <pcl/StringList.h>
66 #include <pcl/TimePoint.h>
67 #include <pcl/Vector.h>
68 
69 namespace pcl
70 {
71 
72 // ----------------------------------------------------------------------------
73 
168 namespace VariantType
169 {
170  enum value_type
171  {
172  Invalid = 0,
173 
174  Bool,
175  Boolean = Bool,
176 
177  Int8,
178  Char = Int8,
179  Int16,
180  Short = Int16,
181  Int32,
182  Integer = Int32,
183  Int64,
184 
185  UInt8,
186  Byte = UInt8,
187  UInt16,
188  UShort = UInt16,
189  UInt32,
190  UInt = UInt32,
191  UInt64,
192 
193  Float32,
194  Float = Float32,
195  Float64,
196  Double = Float64,
197  Real = Double,
198 
199  Complex32,
200  FComplex = Complex32,
201  Complex64,
202  DComplex = Complex64,
203  Complex = DComplex,
204 
205  TimePoint,
206 
207  I32Point,
208  Point = I32Point,
209  F32Point,
210  FPoint = F32Point,
211  F64Point,
212  DPoint = F64Point,
213 
214  I32Rect,
215  Rect = I32Rect,
216  F32Rect,
217  FRect = F32Rect,
218  F64Rect,
219  DRect = F64Rect,
220 
221  I8Vector,
222  CharVector = I8Vector,
223  UI8Vector,
224  ByteVector = UI8Vector,
225  I16Vector,
226  UI16Vector,
227  I32Vector,
228  IVector = I32Vector,
229  UI32Vector,
230  UIVector = UI32Vector,
231  I64Vector,
232  UI64Vector,
233  F32Vector,
234  FVector = F32Vector,
235  F64Vector,
236  DVector = F64Vector,
237  C32Vector,
238  C64Vector,
239 
240  I8Matrix,
241  CharMatrix = I8Matrix,
242  UI8Matrix,
243  ByteMatrix = UI8Matrix,
244  I16Matrix,
245  UI16Matrix,
246  I32Matrix,
247  IMatrix = I32Matrix,
248  UI32Matrix,
249  UIMatrix = UI32Matrix,
250  I64Matrix,
251  UI64Matrix,
252  F32Matrix,
253  FMatrix = F32Matrix,
254  F64Matrix,
255  DMatrix = F64Matrix,
256  C32Matrix,
257  C64Matrix,
258 
259  ByteArray,
260 
261  String,
262  IsoString,
263 
264  StringList,
265  IsoStringList,
266 
267  StringKeyValue,
268  IsoStringKeyValue,
269 
270  StringKeyValueList,
271  IsoStringKeyValueList,
272 
273  NumberOfVariantTypes,
274 
275  FirstCustomType = 1024
276  };
277 }
278 
279 // ----------------------------------------------------------------------------
280 
331 class PCL_CLASS Variant
332 {
333 public:
334 
338  typedef VariantType::value_type data_type;
339 
344  : m_type( VariantType::Invalid )
345  {
346  m_data.anyValue = 0;
347  }
348 
352  Variant( bool b )
353  : m_type( VariantType::Bool )
354  {
355  m_data.boolValue = b;
356  }
357 
361  Variant( int8 i8 )
362  : m_type( VariantType::Int8 )
363  {
364  m_data.int8Value = i8;
365  }
366 
370  Variant( int16 i16 )
371  : m_type( VariantType::Int16 )
372  {
373  m_data.int16Value = i16;
374  }
375 
379  Variant( int32 i32 )
380  : m_type( VariantType::Int32 )
381  {
382  m_data.int32Value = i32;
383  }
384 
388  Variant( int64 i64 )
389  : m_type( VariantType::Int64 )
390  {
391  m_data.int64Value = i64;
392  }
393 
398  : m_type( VariantType::UInt8 )
399  {
400  m_data.uint8Value = u8;
401  }
402 
407  : m_type( VariantType::UInt16 )
408  {
409  m_data.uint16Value = u16;
410  }
411 
415  Variant( uint32 u32 ) : m_type( VariantType::UInt32 )
416  {
417  m_data.uint32Value = u32;
418  }
419 
424  : m_type( VariantType::UInt64 )
425  {
426  m_data.uint64Value = u64;
427  }
428 
433  Variant( float f )
434  : m_type( VariantType::Float )
435  {
436  m_data.float32Value = f;
437  }
438 
443  Variant( double d )
444  : m_type( VariantType::Double )
445  {
446  m_data.float64Value = d;
447  }
448 
454  : m_type( VariantType::FComplex )
455  {
456  m_data.anyValue = 0;
457  m_data.complex32Value = new fcomplex( fc );
458  }
459 
465  : m_type( VariantType::DComplex )
466  {
467  m_data.anyValue = 0;
468  m_data.complex64Value = new dcomplex( dc );
469  }
470 
474  Variant( const TimePoint& t )
475  : m_type( VariantType::TimePoint )
476  {
477  m_data.anyValue = 0;
478  m_data.timePointValue = new TimePoint( t );
479  }
480 
485  Variant( const Point& p )
486  : m_type( VariantType::Point )
487  {
488  m_data.anyValue = 0;
489  m_data.i32PointValue = new Point( p );
490  }
491 
496  Variant( const FPoint& fp )
497  : m_type( VariantType::FPoint )
498  {
499  m_data.anyValue = 0;
500  m_data.f32PointValue = new FPoint( fp );
501  }
502 
507  Variant( const DPoint& dp )
508  : m_type( VariantType::DPoint )
509  {
510  m_data.anyValue = 0;
511  m_data.f64PointValue = new DPoint( dp );
512  }
513 
518  Variant( const Rect& r )
519  : m_type( VariantType::Rect )
520  {
521  m_data.anyValue = 0;
522  m_data.i32RectValue = new Rect( r );
523  }
524 
529  Variant( const FRect& fr )
530  : m_type( VariantType::FRect )
531  {
532  m_data.anyValue = 0;
533  m_data.f32RectValue = new FRect( fr );
534  }
535 
540  Variant( const DRect& dr )
541  : m_type( VariantType::DRect )
542  {
543  m_data.anyValue = 0;
544  m_data.f64RectValue = new DRect( dr );
545  }
546 
551  Variant( const CharVector& cv )
552  : m_type( VariantType::CharVector )
553  {
554  m_data.anyValue = 0;
555  m_data.i8VectorValue = new CharVector( cv );
556  }
557 
562  Variant( const ByteVector& bv )
563  : m_type( VariantType::ByteVector )
564  {
565  m_data.anyValue = 0;
566  m_data.ui8VectorValue = new ByteVector( bv );
567  }
568 
573  Variant( const I16Vector& i16v )
574  : m_type( VariantType::I16Vector )
575  {
576  m_data.anyValue = 0;
577  m_data.i16VectorValue = new I16Vector( i16v );
578  }
579 
584  Variant( const UI16Vector& ui16v )
585  : m_type( VariantType::UI16Vector )
586  {
587  m_data.anyValue = 0;
588  m_data.ui16VectorValue = new UI16Vector( ui16v );
589  }
590 
595  Variant( const IVector& iv )
596  : m_type( VariantType::IVector )
597  {
598  m_data.anyValue = 0;
599  m_data.i32VectorValue = new IVector( iv );
600  }
601 
606  Variant( const UIVector& uiv )
607  : m_type( VariantType::UIVector )
608  {
609  m_data.anyValue = 0;
610  m_data.ui32VectorValue = new UIVector( uiv );
611  }
612 
617  Variant( const I64Vector& i64v )
618  : m_type( VariantType::I64Vector )
619  {
620  m_data.anyValue = 0;
621  m_data.i64VectorValue = new I64Vector( i64v );
622  }
623 
628  Variant( const UI64Vector& ui64v )
629  : m_type( VariantType::UI64Vector )
630  {
631  m_data.anyValue = 0;
632  m_data.ui64VectorValue = new UI64Vector( ui64v );
633  }
634 
639  Variant( const FVector& fv )
640  : m_type( VariantType::FVector )
641  {
642  m_data.anyValue = 0;
643  m_data.f32VectorValue = new FVector( fv );
644  }
645 
650  Variant( const DVector& dv )
651  : m_type( VariantType::DVector )
652  {
653  m_data.anyValue = 0;
654  m_data.f64VectorValue = new DVector( dv );
655  }
656 
661  Variant( const C32Vector& c32v )
662  : m_type( VariantType::C32Vector )
663  {
664  m_data.anyValue = 0;
665  m_data.c32VectorValue = new C32Vector( c32v );
666  }
667 
672  Variant( const C64Vector& c64v )
673  : m_type( VariantType::C64Vector )
674  {
675  m_data.anyValue = 0;
676  m_data.c64VectorValue = new C64Vector( c64v );
677  }
678 
683  Variant( const CharMatrix& cm )
684  : m_type( VariantType::CharMatrix )
685  {
686  m_data.anyValue = 0;
687  m_data.i8MatrixValue = new CharMatrix( cm );
688  }
689 
694  Variant( const ByteMatrix& bm )
695  : m_type( VariantType::ByteMatrix )
696  {
697  m_data.anyValue = 0;
698  m_data.ui8MatrixValue = new ByteMatrix( bm );
699  }
700 
705  Variant( const I16Matrix& i16m )
706  : m_type( VariantType::I16Matrix )
707  {
708  m_data.anyValue = 0;
709  m_data.i16MatrixValue = new I16Matrix( i16m );
710  }
711 
716  Variant( const UI16Matrix& ui16m )
717  : m_type( VariantType::UI16Matrix )
718  {
719  m_data.anyValue = 0;
720  m_data.ui16MatrixValue = new UI16Matrix( ui16m );
721  }
722 
727  Variant( const IMatrix& im )
728  : m_type( VariantType::IMatrix )
729  {
730  m_data.anyValue = 0;
731  m_data.i32MatrixValue = new IMatrix( im );
732  }
733 
738  Variant( const UIMatrix& uim )
739  : m_type( VariantType::UIMatrix )
740  {
741  m_data.anyValue = 0;
742  m_data.ui32MatrixValue = new UIMatrix( uim );
743  }
744 
749  Variant( const I64Matrix& i64m )
750  : m_type( VariantType::I64Matrix )
751  {
752  m_data.anyValue = 0;
753  m_data.i64MatrixValue = new I64Matrix( i64m );
754  }
755 
760  Variant( const UI64Matrix& ui64m )
761  : m_type( VariantType::UI64Matrix )
762  {
763  m_data.anyValue = 0;
764  m_data.ui64MatrixValue = new UI64Matrix( ui64m );
765  }
766 
771  Variant( const FMatrix& fm )
772  : m_type( VariantType::FMatrix )
773  {
774  m_data.anyValue = 0;
775  m_data.f32MatrixValue = new FMatrix( fm );
776  }
777 
782  Variant( const DMatrix& dm )
783  : m_type( VariantType::DMatrix )
784  {
785  m_data.anyValue = 0;
786  m_data.f64MatrixValue = new DMatrix( dm );
787  }
788 
793  Variant( const C32Matrix& c32m )
794  : m_type( VariantType::C32Matrix )
795  {
796  m_data.anyValue = 0;
797  m_data.c32MatrixValue = new C32Matrix( c32m );
798  }
799 
804  Variant( const C64Matrix& c64m )
805  : m_type( VariantType::C64Matrix )
806  {
807  m_data.anyValue = 0;
808  m_data.c64MatrixValue = new C64Matrix( c64m );
809  }
810 
815  Variant( const ByteArray& ba )
816  : m_type( VariantType::ByteArray )
817  {
818  m_data.anyValue = 0;
819  m_data.byteArrayValue = new ByteArray( ba );
820  }
821 
825  Variant( const String& s )
826  : m_type( VariantType::String )
827  {
828  m_data.anyValue = 0;
829  m_data.stringValue = new String( s );
830  }
831 
836  Variant( const IsoString& s8 )
837  : m_type( VariantType::IsoString )
838  {
839  m_data.anyValue = 0;
840  m_data.isoStringValue = new IsoString( s8 );
841  }
842 
847  Variant( const char* cp )
848  : m_type( VariantType::IsoString )
849  {
850  m_data.anyValue = 0;
851  m_data.isoStringValue = new IsoString( cp );
852  }
853 
858  Variant( const StringList& sl )
859  : m_type( VariantType::StringList )
860  {
861  m_data.anyValue = 0;
862  m_data.stringListValue = new StringList( sl );
863  }
864 
869  Variant( const IsoStringList& isl )
870  : m_type( VariantType::IsoStringList )
871  {
872  m_data.anyValue = 0;
873  m_data.isoStringListValue = new IsoStringList( isl );
874  }
875 
880  Variant( const StringKeyValue& skv )
881  : m_type( VariantType::StringKeyValue )
882  {
883  m_data.anyValue = 0;
884  m_data.stringKeyValueValue = new StringKeyValue( skv );
885  }
886 
891  Variant( const IsoStringKeyValue& iskv )
892  : m_type( VariantType::IsoStringKeyValue )
893  {
894  m_data.anyValue = 0;
895  m_data.isoStringKeyValueValue = new IsoStringKeyValue( iskv );
896  }
897 
903  : m_type( VariantType::StringKeyValueList )
904  {
905  m_data.anyValue = 0;
906  m_data.stringKeyValueListValue = new StringKeyValueList( skvl );
907  }
908 
914  : m_type( VariantType::IsoStringKeyValueList )
915  {
916  m_data.anyValue = 0;
917  m_data.isoStringKeyValueListValue = new IsoStringKeyValueList( iskvl );
918  }
919 
924  Variant( const Variant& x )
925  : m_type( VariantType::Invalid )
926  {
927  m_data.anyValue = 0;
928  Copy( x );
929  }
930 
935  {
936  m_type = x.m_type;
937  m_data.anyValue = x.m_data.anyValue;
938  x.m_type = VariantType::Invalid;
939  }
940 
944  virtual ~Variant()
945  {
946  Clear();
947  }
948 
953  Variant& operator =( const Variant& x )
954  {
955  Assign( x );
956  return *this;
957  }
958 
963  void Assign( const Variant& x )
964  {
965  if ( &x != this )
966  {
967  Clear();
968  Copy( x );
969  }
970  }
971 
975  Variant& operator =( Variant&& x )
976  {
977  Transfer( x );
978  return *this;
979  }
980 
985  void Transfer( Variant& x )
986  {
987  if ( &x != this )
988  {
989  Clear();
990  m_type = x.m_type;
991  m_data.anyValue = x.m_data.anyValue;
992  x.m_type = VariantType::Invalid;
993  }
994  }
995 
1000  void Transfer( Variant&& x )
1001  {
1002  if ( &x != this )
1003  {
1004  Clear();
1005  m_type = x.m_type;
1006  m_data.anyValue = x.m_data.anyValue;
1007  x.m_type = VariantType::Invalid;
1008  }
1009  }
1010 
1015  bool IsValid() const
1016  {
1017  return m_type != VariantType::Invalid;
1018  }
1019 
1023  data_type Type() const
1024  {
1025  return data_type( m_type );
1026  }
1027 
1038  Variant ToType( data_type type ) const;
1039 
1044  void Clear();
1045 
1064  int Compare( const Variant& x ) const;
1065 
1074  bool operator ==( const Variant& x ) const
1075  {
1076  return Compare( x ) == 0;
1077  }
1078 
1087  bool operator <( const Variant& x ) const
1088  {
1089  return Compare( x ) < 0;
1090  }
1091 
1099  bool ToBool() const;
1100 
1104  bool ToBoolean() const
1105  {
1106  return ToBool();
1107  }
1108 
1116  int ToInt() const;
1117 
1125  int64 ToInt64() const;
1126 
1134  unsigned int ToUInt() const;
1135 
1143  uint64 ToUInt64() const;
1144 
1152  float ToFloat() const;
1153 
1161  double ToDouble() const;
1162 
1170  fcomplex ToFComplex() const;
1171 
1179  dcomplex ToDComplex() const;
1180 
1185  {
1186  return ToDComplex();
1187  }
1188 
1196  TimePoint ToTimePoint() const;
1197 
1205  Point ToPoint() const;
1206 
1214  FPoint ToFPoint() const;
1215 
1223  DPoint ToDPoint() const;
1224 
1233  Rect ToRect() const;
1234 
1243  FRect ToFRect() const;
1244 
1253  DRect ToDRect() const;
1254 
1262  CharVector ToCharVector() const;
1263 
1271  ByteVector ToByteVector() const;
1272 
1280  I16Vector ToI16Vector() const;
1281 
1289  UI16Vector ToUI16Vector() const;
1290 
1298  IVector ToIVector() const;
1299 
1307  UIVector ToUIVector() const;
1308 
1316  I64Vector ToI64Vector() const;
1317 
1325  UI64Vector ToUI64Vector() const;
1326 
1334  FVector ToFVector() const;
1335 
1343  DVector ToDVector() const;
1344 
1349  {
1350  return ToDVector();
1351  }
1352 
1361  C32Vector ToC32Vector() const;
1362 
1371  C64Vector ToC64Vector() const;
1372 
1380  CharMatrix ToCharMatrix() const;
1381 
1389  ByteMatrix ToByteMatrix() const;
1390 
1398  I16Matrix ToI16Matrix() const;
1399 
1407  UI16Matrix ToUI16Matrix() const;
1408 
1416  IMatrix ToIMatrix() const;
1417 
1425  UIMatrix ToUIMatrix() const;
1426 
1434  I64Matrix ToI64Matrix() const;
1435 
1443  UI64Matrix ToUI64Matrix() const;
1444 
1452  FMatrix ToFMatrix() const;
1453 
1461  DMatrix ToDMatrix() const;
1462 
1467  {
1468  return ToDMatrix();
1469  }
1470 
1479  C32Matrix ToC32Matrix() const;
1480 
1489  C64Matrix ToC64Matrix() const;
1490 
1498  ByteArray ToByteArray() const;
1499 
1507  String ToString() const;
1508 
1516  IsoString ToIsoString() const;
1517 
1525  StringList ToStringList() const;
1526 
1534  IsoStringList ToIsoStringList() const;
1535 
1543  StringKeyValue ToStringKeyValue() const;
1544 
1552  IsoStringKeyValue ToIsoStringKeyValue() const;
1553 
1562  StringKeyValueList ToStringKeyValueList() const;
1563 
1572  IsoStringKeyValueList ToIsoStringKeyValueList() const;
1573 
1589  const void* InternalBlockAddress() const;
1590 
1598  size_type VectorLength() const;
1599 
1611  Rect MatrixDimensions() const;
1612 
1623  size_type BlockSize() const;
1624 
1631  static int BytesPerBlockElementForType( int type );
1632 
1641  {
1642  return BytesPerBlockElementForType( m_type );
1643  }
1644 
1650  static bool IsScalarType( int type );
1651 
1657  bool IsScalar() const
1658  {
1659  return IsScalarType( m_type );
1660  }
1661 
1666  static bool IsComplexType( int type )
1667  {
1668  return type == VariantType::Complex32 || type == VariantType::Complex64;
1669  }
1670 
1675  bool IsComplex() const
1676  {
1677  return IsComplexType( m_type );
1678  }
1679 
1683  static bool IsTimePointType( int type )
1684  {
1685  return type == VariantType::TimePoint;
1686  }
1687 
1692  bool IsTimePoint() const
1693  {
1694  return IsTimePointType( m_type );
1695  }
1696 
1702  static bool IsVectorType( int type );
1703 
1709  bool IsVector() const
1710  {
1711  return IsVectorType( m_type );
1712  }
1713 
1719  static bool IsMatrixType( int type );
1720 
1726  bool IsMatrix() const
1727  {
1728  return IsMatrixType( m_type );
1729  }
1730 
1735  static bool IsStringType( int type )
1736  {
1737  return type == VariantType::String || type == VariantType::IsoString;
1738  }
1739 
1744  bool IsString() const
1745  {
1746  return IsStringType( m_type );
1747  }
1748 
1755  static bool IsStructuredType( int type );
1756 
1767  bool IsStructured() const
1768  {
1769  return IsStructuredType( m_type );
1770  }
1771 
1776  static const char* TypeAsString( int type );
1777 
1778 private:
1779 
1780  union Data
1781  {
1782  bool boolValue;
1783 
1784  int8 int8Value;
1785  int16 int16Value;
1786  int32 int32Value;
1787  int64 int64Value;
1788 
1789  uint8 uint8Value;
1790  uint16 uint16Value;
1791  uint32 uint32Value;
1792  uint64 uint64Value;
1793 
1794  float float32Value;
1795  double float64Value;
1796 
1797  fcomplex* complex32Value;
1798  dcomplex* complex64Value;
1799 
1800  TimePoint* timePointValue;
1801 
1802  I32Point* i32PointValue;
1803  F32Point* f32PointValue;
1804  F64Point* f64PointValue;
1805 
1806  I32Rect* i32RectValue;
1807  F32Rect* f32RectValue;
1808  F64Rect* f64RectValue;
1809 
1810  I8Vector* i8VectorValue;
1811  UI8Vector* ui8VectorValue;
1812  I16Vector* i16VectorValue;
1813  UI16Vector* ui16VectorValue;
1814  I32Vector* i32VectorValue;
1815  UI32Vector* ui32VectorValue;
1816  I64Vector* i64VectorValue;
1817  UI64Vector* ui64VectorValue;
1818  F32Vector* f32VectorValue;
1819  F64Vector* f64VectorValue;
1820  C32Vector* c32VectorValue;
1821  C64Vector* c64VectorValue;
1822 
1823  I8Matrix* i8MatrixValue;
1824  UI8Matrix* ui8MatrixValue;
1825  I16Matrix* i16MatrixValue;
1826  UI16Matrix* ui16MatrixValue;
1827  I32Matrix* i32MatrixValue;
1828  UI32Matrix* ui32MatrixValue;
1829  I64Matrix* i64MatrixValue;
1830  UI64Matrix* ui64MatrixValue;
1831  F32Matrix* f32MatrixValue;
1832  F64Matrix* f64MatrixValue;
1833  C32Matrix* c32MatrixValue;
1834  C64Matrix* c64MatrixValue;
1835 
1836  ByteArray* byteArrayValue;
1837 
1838  String* stringValue;
1839  IsoString* isoStringValue;
1840 
1841  StringList* stringListValue;
1842  IsoStringList* isoStringListValue;
1843 
1844  StringKeyValue* stringKeyValueValue;
1845  IsoStringKeyValue* isoStringKeyValueValue;
1846 
1847  StringKeyValueList* stringKeyValueListValue;
1848  IsoStringKeyValueList* isoStringKeyValueListValue;
1849 
1850  uint64 anyValue;
1851  };
1852 
1853  Data m_data;
1854  int m_type;
1855 
1856  // Internal
1857  void Copy( const Variant& );
1858 
1859  friend class PCL_AssertVariantSize;
1860 };
1861 
1862 class PCL_AssertVariantSize
1863 {
1864 #ifndef _MSC_VER
1865 # ifdef __clang__
1866  _Pragma("clang diagnostic push")
1867  _Pragma("clang diagnostic ignored \"-Wunused-private-field\"")
1868 # endif
1869  Variant* v;
1870  static_assert( sizeof( v->m_data ) == sizeof( uint64 ), "Invalid sizeof( Variant::m_data )" );
1871  static_assert( sizeof( v->m_data.anyValue ) == sizeof( v->m_data ), "Invalid sizeof( Variant::m_data.anyValue )" );
1872 # ifdef __clang__
1873  _Pragma("clang diagnostic pop")
1874 # endif
1875 #else
1876  static_assert( sizeof( Variant::Data ) == sizeof( uint64 ), "Invalid sizeof( Variant::m_data )" );
1877 #endif
1878 };
1879 
1880 // ----------------------------------------------------------------------------
1881 
1882 } // pcl
1883 
1888 struct api_property_value;
1889 namespace pcl
1890 {
1891  Variant VariantFromAPIPropertyValue( const api_property_value& );
1892  void APIPropertyValueFromVariant( api_property_value&, const Variant& );
1893  Variant::data_type VariantTypeFromAPIPropertyType( uint64 );
1894  uint64 APIPropertyTypeFromVariantType( Variant::data_type );
1895 } // pcl
1896 
1897 #endif // __PCL_Variant_h
1898 
1899 // ----------------------------------------------------------------------------
1900 // EOF pcl/Variant.h - Released 2020-12-17T15:46:29Z
Variant(const UI16Vector &ui16v)
Definition: Variant.h:584
Variant(bool b)
Definition: Variant.h:352
Vector ToVector() const
Definition: Variant.h:1348
8-bit signed integer vector.
16-bit signed integer vector.
64-bit floating-point point in the R^2 space.
static bool IsStringType(int type)
Definition: Variant.h:1735
Variant(const char *cp)
Definition: Variant.h:847
An instant in any timescale.
Definition: TimePoint.h:102
Variant(int64 i64)
Definition: Variant.h:388
32-bit signed integer vector.
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Definition: Array.h:2092
32-bit floating point complex vector.
32-bit floating point real vector.
Variant(const String &s)
Definition: Variant.h:825
unsigned char uint8
Definition: Defs.h:638
Variant(const StringKeyValueList &skvl)
Definition: Variant.h:902
Dynamic list of 8-bit strings.
signed short int16
Definition: Defs.h:644
virtual ~Variant()
Definition: Variant.h:944
PCL root namespace.
Definition: AbstractImage.h:76
Key-value association of two Unicode (UTF-16) strings.
Variant(const StringKeyValue &skv)
Definition: Variant.h:880
32-bit unsigned integer vector.
static bool IsComplexType(int type)
Definition: Variant.h:1666
32-bit signed integer matrix.
32-bit floating point real matrix.
64-bit integer matrix.
32-bit floating point complex matrix.
64-bit floating point real matrix.
bool IsVector() const
Definition: Variant.h:1709
64-bit floating point complex matrix.
64-bit integer vector.
32-bit floating-point rectangle in the R^2 space.
Dynamic array of 8-bit unsigned integers.
64-bit floating point complex vector.
64-bit floating point real vector.
Variant(const TimePoint &t)
Definition: Variant.h:474
bool IsValid() const
Definition: Variant.h:1015
bool IsScalar() const
Definition: Variant.h:1657
8-bit signed integer matrix.
static bool IsTimePointType(int type)
Definition: Variant.h:1683
64-bit floating point real matrix.
Variant(const DPoint &dp)
Definition: Variant.h:507
bool IsComplex() const
Definition: Variant.h:1675
Variant(float f)
Definition: Variant.h:433
Dynamic list of key-value associations implemented as 8-bit strings.
Variant(const DVector &dv)
Definition: Variant.h:650
Unsigned integer matrix.
Variant(const CharVector &cv)
Definition: Variant.h:551
Variant(const C32Vector &c32v)
Definition: Variant.h:661
32-bit integer point on the plane.
Variant(const I16Vector &i16v)
Definition: Variant.h:573
int BytesPerBlockElement() const
Definition: Variant.h:1640
Variant(const FRect &fr)
Definition: Variant.h:529
bool IsStructured() const
Definition: Variant.h:1767
size_t size_type
Definition: Defs.h:605
8-bit unsigned integer matrix.
64-bit floating-point rectangle in the R^2 space.
Variant(const ByteVector &bv)
Definition: Variant.h:562
Variant(const DRect &dr)
Definition: Variant.h:540
Variant(const IsoStringList &isl)
Definition: Variant.h:869
8-bit unsigned integer vector.
64-bit floating point real matrix.
Variant(Variant &&x)
Definition: Variant.h:934
Variant(const IsoStringKeyValueList &iskvl)
Definition: Variant.h:913
int Compare(FI1 i1, FI1 j1, FI2 i2, FI2 j2) noexcept
Definition: Utility.h:639
Variant(const C32Matrix &c32m)
Definition: Variant.h:793
Variant(const C64Vector &c64v)
Definition: Variant.h:672
Variant(const Variant &x)
Definition: Variant.h:924
Unicode (UTF-16) string.
Definition: String.h:7923
unsigned long long uint64
Definition: Defs.h:678
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Definition: Array.h:2103
signed char int8
Definition: Defs.h:632
64-bit unsigned integer matrix.
8-bit signed integer vector.
64-bit floating point real vector.
Variant(const ByteMatrix &bm)
Definition: Variant.h:694
Variant(uint16 u16)
Definition: Variant.h:406
8-bit signed integer matrix.
unsigned short uint16
Definition: Defs.h:650
16-bit signed integer matrix.
Variant(uint8 u8)
Definition: Variant.h:397
bool ToBoolean() const
Definition: Variant.h:1104
bool IsMatrix() const
Definition: Variant.h:1726
Variant(const IsoStringKeyValue &iskv)
Definition: Variant.h:891
Variant(const Rect &r)
Definition: Variant.h:518
Variant(const CharMatrix &cm)
Definition: Variant.h:683
Dynamic list of key-value associations implemented as Unicode (UTF-16) strings.
32-bit unsigned integer matrix.
signed int int32
Definition: Defs.h:656
Dynamic list of Unicode (UTF-16) strings.
32-bit floating-point rectangle in the R^2 space.
32-bit unsigned integer vector.
Variant(uint32 u32)
Definition: Variant.h:415
Variant(int16 i16)
Definition: Variant.h:370
Variant(const UI16Matrix &ui16m)
Definition: Variant.h:716
64-bit unsigned integer vector.
A complex number whose components are 64-bit floating point real numbers.
void Assign(const Variant &x)
Definition: Variant.h:963
Variant(uint64 u64)
Definition: Variant.h:423
32-bit floating-point point in the R^2 space.
void Transfer(Variant &&x)
Definition: Variant.h:1000
Variant(const UIMatrix &uim)
Definition: Variant.h:738
Variant(fcomplex fc)
Definition: Variant.h:453
64-bit floating point real vector.
16-bit unsigned integer vector.
Variant(dcomplex dc)
Definition: Variant.h:464
Variant(const UI64Vector &ui64v)
Definition: Variant.h:628
Acts like a union to store instances of different data types.
Definition: Variant.h:331
Variant(const DMatrix &dm)
Definition: Variant.h:782
Variant(const IVector &iv)
Definition: Variant.h:595
Variant(const I16Matrix &i16m)
Definition: Variant.h:705
Variant(const IsoString &s8)
Definition: Variant.h:836
8-bit unsigned integer vector.
32-bit signed integer matrix.
data_type Type() const
Definition: Variant.h:1023
64-bit floating-point point in the R^2 space.
Variant(const IMatrix &im)
Definition: Variant.h:727
Variant(const UIVector &uiv)
Definition: Variant.h:606
16-bit unsigned integer matrix.
A complex number whose components are 64-bit floating point real numbers.
32-bit integer point on the plane.
Variant(const FPoint &fp)
Definition: Variant.h:496
Variant(const I64Matrix &i64m)
Definition: Variant.h:749
Variant(const C64Matrix &c64m)
Definition: Variant.h:804
Variant(int8 i8)
Definition: Variant.h:361
VariantType::value_type data_type
Definition: Variant.h:338
32-bit floating point real matrix.
32-bit signed integer vector.
Variant(const StringList &sl)
Definition: Variant.h:858
Key-value association of two 8-bit strings.
complex ToComplex() const
Definition: Variant.h:1184
64-bit floating-point rectangle in the R^2 space.
32-bit integer rectangle on the plane.
Variant(int32 i32)
Definition: Variant.h:379
32-bit floating-point point in the R^2 space.
void Transfer(Variant &x)
Definition: Variant.h:985
Variant(const ByteArray &ba)
Definition: Variant.h:815
A complex number whose components are 32-bit floating point real numbers.
bool IsString() const
Definition: Variant.h:1744
Variant(const FVector &fv)
Definition: Variant.h:639
bool IsTimePoint() const
Definition: Variant.h:1692
Variant(const Point &p)
Definition: Variant.h:485
32-bit floating point real vector.
unsigned int uint32
Definition: Defs.h:662
signed long long int64
Definition: Defs.h:672
32-bit integer rectangle on the plane.
Variant(const UI64Matrix &ui64m)
Definition: Variant.h:760
Variant(double d)
Definition: Variant.h:443
Variant(const FMatrix &fm)
Definition: Variant.h:771
Matrix ToMatrix() const
Definition: Variant.h:1466
Variant(const I64Vector &i64v)
Definition: Variant.h:617
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Definition: String.h:5397
8-bit unsigned integer matrix.