Workspace 6.21.5
Public Member Functions | List of all members
Clonable Class Referenceabstract

Base class for clonable objects. More...

#include <Workspace/Application/LanguageUtils/clonable.h>

Inheritance diagram for Clonable:
[legend]

Public Member Functions

virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 

Detailed Description

The virtual clone() member function is the main reason for this class to exist. By making Clonable a base class, a subclass is advertising that it can be cloned and that the clone() function can be called to create a clone of the object without having to know what specific type the object actually is. This is a very common design pattern.

The workspace often treats Clonable types specially, such as creating template specializations for Clonable objects. If your class supports the clone() design pattern, then consider making Clonable one of its base classes (or derive from a class that is itself a subclass of Clonable). Some commonly used base classes are already subclasses of Clonable, notably ObjectGroup.

Constructor & Destructor Documentation

◆ ~Clonable()

virtual ~Clonable ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual Clonable * clone ( ) const
pure virtual
Returns
A clone of this object.
Note
Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.

Implemented in Array3dNullTyped< T >, ColorScale, Array3dNull, Array3dTypedAdaptor< ContainerType, T, Reader, Writer, DeepCopier >, Array3dTypedAdaptor< CSIRO::DataAnalysis::Array3dTyped, double >, Array3dTypedAdaptor< CSIRO::DataAnalysis::Array3dData< CSIRO::Rendering::WSGLSparseOctree::Cell >, QRgb >, Array3dTypedAdaptor< Array3dScalar, QRgb, ImageReader, ImageWriter >, ArrayNdEmpty, ArrayNdData< T >, ArrayNdData< double >, ArrayNdDimensionFilterTyped< T >, ArrayNdInterface< T >, ArrayNdPermutationTyped< T >, ArrayNdSliceTyped< T >, NullDataSeries, SequenceDataSeries, StandardDataSeries< T, Evaluator >, DimensionInfo, ImageTileSet::Image, ImageTileSet, ManyToManyRelation< T >, ManyToOneRelation< T >, NamedDimensionRange, DiscreteNamedDimensionRangeFilter, NullNamedDimensionRangeFilter, NdTo3dAdaptor, OneToManyRelation< T >, OneToOneRelation< T >, ScriptedDataSeriesMapper, InvalidSqlBoundObjectGroup, TransferFunction2dClassification, TypedSqlBoundObjectGroup< Derived, PrimaryKeyType >, UnchangedDataSeriesMapper, ImageOverlay, AxisSettings, Hdf5MeshModelInterface, ElementScriptMapper, ElementStateMapper, MeshFeatureIdentifier, FilteredMeshModelInterface, GeometricPlaneFilter, HierarchicalReferenceMeshModelInterface, LargeStreamlinedMeshModelInterface, LodMeshModelInterface, NullOperationMeshModelFilter, PrimevalMeshModelInterface, ScalarNodeStateFilter, StreamlinedMeshModelInterface, NullNodeMapper, NodeScriptMapper, NodeStateMapper, NodeTextureMapper, VectorNodeStateMapper, VectorNodeTextureMapper, BoundingBox, BoundingCylinder, BoundingPlane, BoundingSphere, ElementCriterionAllPass, ElementCriterionInRegion, Matrix3x3Group, NodeCriterionAllPass, NodeCriterionInRegion, NodeIdCriterion, TransformGroup, TruncatedCone, Vector3dGroup, LinuxDesktopIcon, PackageDirectoryItemData, PackageEnvironmentVariableItemData, PackageExecutableItemData, PackageFileItemData, PackageItemContainer, StartMenuItem, PythonNumpyInterface, PythonObjectGroupBase, PythonObjectGroup< T >, Annotation, Camera, CameraInteractionOptions, AmbientLight, DirectionalLight, LightAttenuationFactors, PointLight, SpotLight, ClipRegion, MeshModelInstance, RodGlypher, SphereGlypher, SquareGlypher, StreakGlypher, SuperquadricGlypher, Texture2D, Texture3D, NoTexture, VectorGlypher, PlotGrid3dRenderOptions, RenderSettings, SceneItemInstance, SceneOverlay, BillboardImageShader, BlinnPhongShader, ColorStateShader, DepthShader, ElementColoringShader, HighlightElementShader, HighlightNodeShader, LambertShader, LineOfSightShader, NodeColoringShader, NormalShader, OctreeShader, NullShader, SymbolShader, TextureCoordShader, TextureProjectionShader, VolumeShader, Transform, PickFilter, RenderFilter, AnchorDifference, AttributeDifference, ConnectionDifference, DisplayDifference, ElementDifference, FeatureDifference, InputDifference, ItemDifference, NoteDifference, OperationDifference, OutputDifference, PluginDifference, ViewDifference, ValidationData, DirIteratorFlags, EmptyGroup, FileFilter, FileSortFlags, NamePath, Array3d, Array3dTyped< T >, Array3dTyped< double >, Array3dTyped< QRgb >, ArrayNd, ArrayNdTyped< T >, ArrayNdTyped< double >, DataSeries, DataSeriesMapper, NamedDimensionRangeFilter, SqlBindingRelation, SqlBoundObjectGroup, ElementMapper, MeshModelFilter, MeshModelInterface, NodeMapper, VectorNodeMapper, ElementCriterion, NodeCriterion, PackageItem, Light, Glypher, Texturizer, SceneItem, Shader, TypedShader< Derived >, TypedShader< BillboardImageShader >, TypedShader< BlinnPhongShader >, TypedShader< ColorStateShader >, TypedShader< DepthShader >, TypedShader< ElementColoringShader >, TypedShader< HighlightElementShader >, TypedShader< HighlightNodeShader >, TypedShader< LambertShader >, TypedShader< LineOfSightShader >, TypedShader< NodeColoringShader >, TypedShader< NormalShader >, TypedShader< OctreeShader >, TypedShader< SymbolShader >, TypedShader< TextureCoordShader >, TypedShader< TextureProjectionShader >, TypedShader< VolumeShader >, ObjectGroup, and ProvenanceReporter::Reporter.